From 6be42a94ca4bcafef54ede5e4c7cb5a51e6a4ca0 Mon Sep 17 00:00:00 2001 From: Arjen Wisse Date: Tue, 15 Dec 2015 12:47:11 +0100 Subject: [PATCH] Proper package support for osgi bundles --- src/main/scala/com/typesafe/sbt/osgi/Osgi.scala | 5 +++-- src/main/scala/com/typesafe/sbt/osgi/SbtOsgi.scala | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/scala/com/typesafe/sbt/osgi/Osgi.scala b/src/main/scala/com/typesafe/sbt/osgi/Osgi.scala index 3572ddb..d9657fd 100644 --- a/src/main/scala/com/typesafe/sbt/osgi/Osgi.scala +++ b/src/main/scala/com/typesafe/sbt/osgi/Osgi.scala @@ -29,14 +29,15 @@ private object Osgi { def bundleTask( headers: OsgiManifestHeaders, additionalHeaders: Map[String, String], - fullClasspath: Seq[Attributed[File]], + dependencyClasspath: Seq[Attributed[File]], + products: Seq[File], artifactPath: File, resourceDirectories: Seq[File], embeddedJars: Seq[File], explodedJars: Seq[File], streams: TaskStreams): File = { val builder = new Builder - builder.setClasspath(fullClasspath map (_.data) toArray) + builder.setClasspath((dependencyClasspath.files ++ products) toArray) builder.setProperties(headersToProperties(headers, additionalHeaders)) includeResourceProperty(resourceDirectories.filter(_.exists), embeddedJars, explodedJars) foreach (dirs => builder.setProperty(INCLUDERESOURCE, dirs) diff --git a/src/main/scala/com/typesafe/sbt/osgi/SbtOsgi.scala b/src/main/scala/com/typesafe/sbt/osgi/SbtOsgi.scala index 26ef6bc..a3adb75 100644 --- a/src/main/scala/com/typesafe/sbt/osgi/SbtOsgi.scala +++ b/src/main/scala/com/typesafe/sbt/osgi/SbtOsgi.scala @@ -34,7 +34,7 @@ object SbtOsgi extends AutoPlugin { val OsgiKeys = com.typesafe.sbt.osgi.OsgiKeys def osgiSettings: Seq[Setting[_]] = Seq( - packagedArtifact in (Compile, packageBin) <<= (artifact in (Compile, packageBin), OsgiKeys.bundle).identityMap, + packageBin in Compile <<= OsgiKeys.bundle, artifact in (Compile, packageBin) ~= (_.copy(`type` = "bundle")) ) } @@ -45,7 +45,8 @@ object SbtOsgi extends AutoPlugin { bundle <<= ( manifestHeaders, additionalHeaders, - fullClasspath in Compile, + dependencyClasspath in Compile, + products in Compile, artifactPath in (Compile, packageBin), resourceDirectories in Compile, embeddedJars,