Skip to content

Commit

Permalink
Add OSGi support for modules
Browse files Browse the repository at this point in the history
  • Loading branch information
indrajitr committed May 15, 2011
1 parent 4017d8b commit 10c37e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion project/build/LiftModulesProject.scala
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import com.weiglewilczek.bnd4sbt.BNDPlugin
import net.liftweb.sbt._
import sbt._

Expand Down Expand Up @@ -69,10 +70,17 @@ class LiftModulesProject(info: ProjectInfo) extends ParentProject(info) with Lif

// Default base
// ------------
class ModulesProject(info: ProjectInfo, libs: ModuleID*) extends DefaultProject(info) with LiftDefaultProject {
class ModulesProject(info: ProjectInfo, libs: ModuleID*) extends DefaultProject(info) with BNDPlugin with LiftDefaultProject {

override def libraryDependencies = super.libraryDependencies ++ libs

// OSGi Attributes
override def bndExportPackage = Seq("net.liftweb.*;version=\"%s\"".format(projectVersion.value))
override def bndImportPackage = "net.liftweb.*;version=\"%s\"".format(projectVersion.value) :: super.bndImportPackage.toList

// BNDPlugin should include mainResourcesOutputPath too, to include the generated resources
override def bndIncludeResource = super.bndIncludeResource ++ Seq(mainResourcesOutputPath.absolutePath)

// System properties necessary during test
override def testAction =
super.testAction dependsOn
Expand Down
3 changes: 2 additions & 1 deletion project/plugins/Plugins.scala
Expand Up @@ -5,5 +5,6 @@ class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
lazy val snapshots = ScalaToolsSnapshots

// Add plugin
lazy val a = "net.liftweb" % "lift-sbt" % "2.4-SNAPSHOT"
lazy val liftsbt = "net.liftweb" % "lift-sbt" % "2.4-SNAPSHOT"
lazy val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.2"
}

0 comments on commit 10c37e5

Please sign in to comment.