Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/scala/com/github/sbt/osgi/SbtOsgi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.github.sbt.osgi

import sbt._
import sbt.Classpaths.concat
import sbt.Keys._
import sbt.plugins.JvmPlugin

Expand Down Expand Up @@ -45,10 +46,12 @@ object SbtOsgi extends AutoPlugin {
lazy val defaultOsgiSettings: Seq[Setting[_]] = {
import OsgiKeys._
Seq(
(Compile / exportJars) := false,
(Compile / fullClasspath) := concat(Compile / exportedProducts, Compile / dependencyClasspathAsJars).value,
bundle := Osgi.bundleTask(
manifestHeaders.value,
additionalHeaders.value,
(Compile / dependencyClasspathAsJars).value.map(_.data) ++ (Compile / products).value,
(Compile / fullClasspath).value.map(_.data),
(Compile / packageBin / artifactPath).value,
(Compile / resourceDirectories).value,
embeddedJars.value,
Expand Down Expand Up @@ -78,7 +81,6 @@ object SbtOsgi extends AutoPlugin {
requireBundle.value,
requireCapability.value
),
Compile / sbt.Keys.packageBin := bundle.value,
bundleSymbolicName := Osgi.defaultBundleSymbolicName(organization.value, normalizedName.value),
privatePackage := bundleSymbolicName(name => List(name + ".*")).value,
bundleVersion := version.value
Expand Down
2 changes: 2 additions & 0 deletions src/sbt-test/sbt-osgi/test-00-defaults/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ version := "1.2.3"

libraryDependencies += "org.osgi" % "org.osgi.core" % "4.3.0" % "provided"

(Compile / packageBin) := OsgiKeys.bundle.value

osgiSettings

TaskKey[Unit]("verifyBundleActivator") := {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ lazy val proj1 = project
name := "proj1",
OsgiKeys.bundleSymbolicName := "proj1",
OsgiKeys.bundleVersion := version.value,
OsgiKeys.exportPackage := Seq("proj1")
OsgiKeys.exportPackage := Seq("proj1"),
(Compile / packageBin) := OsgiKeys.bundle.value
)

lazy val proj2 = project
Expand All @@ -33,7 +34,8 @@ lazy val proj2 = project
name := "proj2",
OsgiKeys.bundleSymbolicName := "proj2",
OsgiKeys.bundleVersion := version.value,
OsgiKeys.exportPackage := Seq("proj2")
OsgiKeys.exportPackage := Seq("proj2"),
(Compile / packageBin) := OsgiKeys.bundle.value
)

TaskKey[Unit]("verifyBundle") := {
Expand Down