Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

closes #19: Changed the defaults for bndPrivatePackage and bndClasspath.

  • Loading branch information...
commit a077bdd243547316e866813aa788d574bf9876c0 1 parent 890514a
Heiko Seeberger authored
8 src/main/scala/BNDPlugin.scala
View
@@ -47,11 +47,17 @@ trait BNDPlugin extends DefaultProject with BNDPluginProperties {
private def createBundle() {
val builder = new Builder
builder setProperties properties
- builder setClasspath bndClasspath.getFiles.toArray
+ builder setClasspath classpath
val jar = builder.build
jar write bndOutput.absolutePath
}
+ private def classpath = {
+ val cp = bndClasspath.getFiles.toArray
+ log debug "Using the following classpath for BND: %s".format(cp mkString ":")
+ cp
+ }
+
private def properties = {
val properties = new Properties
8 src/main/scala/properties.scala
View
@@ -59,8 +59,8 @@ private[bnd4sbt] trait BNDPluginProperties extends ProjectAccessor {
/** The value for Bundle-RequiredExecutionEnvironment. Defaults to empty set, i.e. no execution environments are defined. */
protected def bndExecutionEnvironment = Set[ExecutionEnvironments]()
- /** The value for Private-Package. Defaults to "*", i.e. contains everything. */
- protected def bndPrivatePackage = Seq("*")
+ /** The value for Private-Package. Defaults to BNDPlugin.bndBundleSymbolicName.*, i.e. contains the root package and all subpackages. */
+ protected def bndPrivatePackage = Seq(bndBundleSymbolicName + ".*")
/** The value for Export-Package. Defaults to empty sequence, i.e. nothing is exported. */
protected def bndExportPackage = Seq[String]()
@@ -95,8 +95,8 @@ private[bnd4sbt] trait BNDPluginProperties extends ProjectAccessor {
/** The output path used by BND. Defaults to the outputPath of this project plus the value of BNDPlugin.bndFileName. ATTENTION: Better not change this, but the appropriate SBT default properties! */
protected def bndOutput = project.outputPath / bndFileName
- /** The classpath used by BND. Attention: Don't mistake this for the Bundle-Classpath! Defaults to the mainCompilePath of this project. */
- protected def bndClasspath: PathFinder = project.mainCompilePath
+ /** The classpath used by BND. Attention: Don't mistake this for the Bundle-Classpath! Defaults to the runClasspath of this project. */
+ protected def bndClasspath: PathFinder = project.runClasspath
private[bnd4sbt] def bundleClasspath =
if (bndEmbedDependencies) Set(".") ++ (project.publicClasspath.get filter { !_.isDirectory } map { _.name })
2  test/a/src/main/scala/a.scala
View
@@ -1,4 +1,4 @@
-package a
+package com.weiglewilczek.bnd4sbttest.a
object A {
val name = "A"
4 test/b/src/main/scala/b.scala
View
@@ -1,6 +1,6 @@
-package b.internal
+package com.weiglewilczek.bnd4sbttest.b.internal
-import a.A
+import com.weiglewilczek.bnd4sbttest.a.A
import org.osgi.framework.{ BundleActivator, BundleContext }
class Activator extends BundleActivator {
2  test/c/src/main/scala/c.scala
View
@@ -1,4 +1,4 @@
-package c
+package com.weiglewilczek.bnd4sbttest.c
object C {
val name = "C"
2  test/c/src/test/scala/test.scala
View
@@ -1,3 +1,3 @@
-package c
+package com.weiglewilczek.bnd4sbttest.c
class Test
4 test/d/src/main/scala/d.scala
View
@@ -1,6 +1,6 @@
-package d.internal
+package com.weiglewilczek.bnd4sbttest.d.internal
-import c.C
+import com.weiglewilczek.bnd4sbttest.c.C
import org.apache.commons.logging.LogFactory
import org.osgi.framework.{ BundleActivator, BundleContext }
2  test/d/src/test/scala/test.scala
View
@@ -1,4 +1,4 @@
-package d
+package com.weiglewilczek.bnd4sbttest.d
object Test
4 test/project/build.properties
View
@@ -1,7 +1,7 @@
#Project properties
#Mon May 10 09:58:30 CEST 2010
-project.organization=com.weiglewilczek
-project.name=bnd4sbt-test
+project.organization=com.weiglewilczek.bnd4sbttest
+project.name=bnd4sbttest
sbt.version=0.7.4
project.version=1.0
build.scala.versions=2.7.7
8 test/project/build/Project.scala
View
@@ -7,21 +7,21 @@ class TestProject(info: ProjectInfo) extends ParentProject(info: ProjectInfo) {
class A(info: ProjectInfo) extends DefaultProject(info) with BNDPlugin {
import com.weiglewilczek.bnd4sbt.ExecutionEnvironments._
override def bndBundleLicense = Some("Eclipse Public License v1.0")
- override def bndExportPackage = Seq("a;version=1.0")
+ override def bndExportPackage = Seq("com.weiglewilczek.bnd4sbttest.a;version=1.0")
override def bndExecutionEnvironment = Set(Java5, Java6)
override def bndDynamicImportPackage = Seq("x.y.z")
override def bndVersionPolicy = Some("[$(@),$(@)]")
override def bndNoUses = true
override def packageOptions =
ManifestAttributes("Bundle-Name" -> "ILLEGAL") ::
- ManifestAttributes("test" -> "TEST") ::
+ ManifestAttributes("Test" -> "TEST") :: // Only uppercase headers are copied to the manifest by BND!
Nil
}
lazy val b = project("b", "b", new B(_), a)
class B(info: ProjectInfo) extends DefaultProject(info) with BNDPlugin {
lazy val osgiCore = "org.osgi" % "org.osgi.core" % "4.2.0" % "provided"
- override def bndBundleActivator = Some("b.internal.Activator")
+ override def bndBundleActivator = Some("com.weiglewilczek.bnd4sbttest.b.internal.Activator")
}
lazy val c = project("c", "c", new C(_))
@@ -33,7 +33,7 @@ class TestProject(info: ProjectInfo) extends ParentProject(info: ProjectInfo) {
class D(info: ProjectInfo) extends DefaultProject(info) with BNDPlugin {
lazy val osgiCore = "org.osgi" % "org.osgi.core" % "4.2.0" % "provided"
lazy val commonsLogging = "commons-logging" % "commons-logging-api" % "1.1"
- override def bndBundleActivator = Some("d.internal.Activator")
+ override def bndBundleActivator = Some("com.weiglewilczek.bnd4sbttest.d.internal.Activator")
override def bndEmbedDependencies = true
}
}
19 test/project/plugins/Plugins.scala
View
@@ -2,10 +2,23 @@ import sbt._
class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
+ // ===================================================================================================================
// Repositories
- def aquteRepo = "aQute Maven Repository" at "http://www.aqute.biz/repo"
- lazy val aquteModuleConfig = ModuleConfiguration("biz.aQute", aquteRepo)
+ // ===================================================================================================================
+ object Repositories {
+ lazy val aquteRepo = "aQute Maven Repository" at "http://www.aqute.biz/repo"
+ }
+
+ // ===================================================================================================================
+ // ModuleConfigurations
+ // ===================================================================================================================
+
+ lazy val aquteModuleConfig = ModuleConfiguration("biz.aQute", Repositories.aquteRepo)
+
+ // ===================================================================================================================
// Dependencies
- lazy val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.0.RC3"
+ // ===================================================================================================================
+
+ lazy val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.0.RC5"
}
2  test/project/plugins/project/build.properties
View
@@ -1,3 +1,3 @@
#Project properties
-#Sun Jun 20 22:10:00 CEST 2010
+#Thu Jul 22 10:14:18 CEST 2010
plugin.uptodate=true
Please sign in to comment.
Something went wrong with that request. Please try again.