Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add OSGi support for modules

  • Loading branch information...
commit 10c37e52352da60c16a23a8c09fcce308b7b920f 1 parent 4017d8b
Indrajit Raychaudhuri authored May 16, 2011
10  project/build/LiftModulesProject.scala
@@ -14,6 +14,7 @@
14 14
  * limitations under the License.
15 15
  */
16 16
 
  17
+import com.weiglewilczek.bnd4sbt.BNDPlugin
17 18
 import net.liftweb.sbt._
18 19
 import sbt._
19 20
 
@@ -69,10 +70,17 @@ class LiftModulesProject(info: ProjectInfo) extends ParentProject(info) with Lif
69 70
 
70 71
   // Default base
71 72
   // ------------
72  
-  class ModulesProject(info: ProjectInfo, libs: ModuleID*) extends DefaultProject(info) with LiftDefaultProject {
  73
+  class ModulesProject(info: ProjectInfo, libs: ModuleID*) extends DefaultProject(info) with BNDPlugin with LiftDefaultProject {
73 74
 
74 75
     override def libraryDependencies = super.libraryDependencies ++ libs
75 76
 
  77
+    // OSGi Attributes
  78
+    override def bndExportPackage = Seq("net.liftweb.*;version=\"%s\"".format(projectVersion.value))
  79
+    override def bndImportPackage = "net.liftweb.*;version=\"%s\"".format(projectVersion.value) :: super.bndImportPackage.toList
  80
+
  81
+    // BNDPlugin should include mainResourcesOutputPath too, to include the generated resources
  82
+    override def bndIncludeResource = super.bndIncludeResource ++ Seq(mainResourcesOutputPath.absolutePath)
  83
+
76 84
     // System properties necessary during test
77 85
     override def testAction =
78 86
       super.testAction dependsOn
3  project/plugins/Plugins.scala
@@ -5,5 +5,6 @@ class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
5 5
   lazy val snapshots = ScalaToolsSnapshots
6 6
 
7 7
   // Add plugin
8  
-  lazy val a = "net.liftweb" % "lift-sbt" % "2.4-SNAPSHOT"
  8
+  lazy val liftsbt = "net.liftweb" % "lift-sbt" % "2.4-SNAPSHOT"
  9
+  lazy val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.2"
9 10
 }

0 notes on commit 10c37e5

Please sign in to comment.
Something went wrong with that request. Please try again.