Skip to content

Commit

Permalink
Proper package support for osgi bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
arjenw committed Dec 15, 2015
1 parent 66e179d commit 6be42a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/com/typesafe/sbt/osgi/Osgi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions src/main/scala/com/typesafe/sbt/osgi/SbtOsgi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
)
}
Expand All @@ -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,
Expand Down

0 comments on commit 6be42a9

Please sign in to comment.