diff options
Diffstat (limited to 'project/Osgi.scala')
-rw-r--r-- | project/Osgi.scala | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/project/Osgi.scala b/project/Osgi.scala index 4456c94190..36803c0e44 100644 --- a/project/Osgi.scala +++ b/project/Osgi.scala @@ -1,9 +1,9 @@ -import aQute.lib.osgi.Builder -import aQute.lib.osgi.Constants._ +import aQute.bnd.osgi.Builder +import aQute.bnd.osgi.Constants._ import java.util.Properties import sbt._ import sbt.Keys._ -import scala.collection.JavaConversions._ +import collection.JavaConverters._ import VersionUtil.versionProperties /** OSGi packaging for the Scala build, distilled from sbt-osgi. We do not use sbt-osgi because it @@ -29,13 +29,14 @@ object Osgi { "Export-Package" -> ("*;version=${ver}"), "Import-Package" -> ("scala.*;version=\"${range;[==,=+);${ver}}\",*"), "Bundle-Version" -> v, - "Bundle-RequiredExecutionEnvironment" -> "JavaSE-1.6, JavaSE-1.7", + "Bundle-RequiredExecutionEnvironment" -> "JavaSE-1.8", "-eclipse" -> "false" ) }, bundle <<= Def.task { + val res = (products in Compile in packageBin).value bundleTask(headers.value.toMap, (products in Compile in packageBin).value, - (artifactPath in (Compile, packageBin)).value, Nil, streams.value) + (artifactPath in (Compile, packageBin)).value, res, streams.value) }, packagedArtifact in (Compile, packageBin) <<= (artifact in (Compile, packageBin), bundle).identityMap, // Also create OSGi source bundles: @@ -55,12 +56,12 @@ object Osgi { headers foreach { case (k, v) => builder.setProperty(k, v) } val includeRes = resourceDirectories.filter(_.exists).map(_.getAbsolutePath).mkString(",") if(!includeRes.isEmpty) builder.setProperty(INCLUDERESOURCE, includeRes) - builder.getProperties.foreach { case (k, v) => log.debug(s"bnd: $k: $v") } + builder.getProperties.asScala.foreach { case (k, v) => log.debug(s"bnd: $k: $v") } // builder.build is not thread-safe because it uses a static SimpleDateFormat. This ensures // that all calls to builder.build are serialized. val jar = synchronized { builder.build } - builder.getWarnings.foreach(s => log.warn(s"bnd: $s")) - builder.getErrors.foreach(s => log.error(s"bnd: $s")) + builder.getWarnings.asScala.foreach(s => log.warn(s"bnd: $s")) + builder.getErrors.asScala.foreach(s => log.error(s"bnd: $s")) IO.createDirectory(artifactPath.getParentFile) jar.write(artifactPath) artifactPath |