Skip to content
Browse files

Add OSGi support for modules

  • Loading branch information...
1 parent 4017d8b commit 10c37e52352da60c16a23a8c09fcce308b7b920f @indrajitr indrajitr committed
Showing with 11 additions and 2 deletions.
  1. +9 −1 project/build/LiftModulesProject.scala
  2. +2 −1 project/plugins/Plugins.scala
View
10 project/build/LiftModulesProject.scala
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+import com.weiglewilczek.bnd4sbt.BNDPlugin
import net.liftweb.sbt._
import sbt._
@@ -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
View
3 project/plugins/Plugins.scala
@@ -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.
Something went wrong with that request. Please try again.