diff --git a/project/OSGi.scala b/project/OSGi.scala index 7417ada953..869bffd371 100644 --- a/project/OSGi.scala +++ b/project/OSGi.scala @@ -3,6 +3,7 @@ */ package akka +import com.typesafe.sbt.osgi.OsgiKeys import com.typesafe.sbt.osgi.SbtOsgi._ import sbt._ import sbt.Keys._ @@ -13,7 +14,10 @@ object OSGi { // in the .../bundles directory which makes testing locally published artifacts // a pain. Create bundles but publish them to the normal .../jars directory. def osgiSettings = defaultOsgiSettings ++ Seq( - packagedArtifact in (Compile, packageBin) <<= (artifact in (Compile, packageBin), OsgiKeys.bundle).identityMap + packagedArtifact in (Compile, packageBin) <<= (artifact in (Compile, packageBin), OsgiKeys.bundle).identityMap, + // This will fail the build instead of accidentally removing classes from the resulting artifact. + // Each package contained in a project MUST be known to be private or exported, if it's undecided we MUST resolve this + OsgiKeys.failOnUndecidedPackage := true ) val actor = osgiSettings ++ Seq( @@ -52,10 +56,17 @@ object OSGi { val httpCore = exports(Seq("akka.http.*"), imports = Seq(scalaJava8CompatImport())) - val http = exports(Seq("akka.http.impl.server", - "akka.http.scaladsl.server.*", "akka.http.javadsl.server.*", - "akka.http.scaladsl.client", "akka.http.scaladsl.coding", "akka.http.scaladsl.common", - "akka.http.scaladsl.marshalling", "akka.http.scaladsl.unmarshalling"), + val http = exports(Seq("akka.http.impl.server") ++ + Seq( + "akka.http.$DSL$.server.*", + "akka.http.$DSL$.client.*", + "akka.http.$DSL$.coding.*", + "akka.http.$DSL$.common.*", + "akka.http.$DSL$.marshalling.*", + "akka.http.$DSL$.unmarshalling.*" + ) flatMap { p => + Seq(p.replace("$DSL$", "scaladsl"), p.replace("$DSL$", "javadsl")) + }, imports = Seq( scalaJava8CompatImport(), akkaImport("akka.stream.*"), diff --git a/project/plugins.sbt b/project/plugins.sbt index 1df9aa3dec..b847781fc9 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -13,7 +13,7 @@ addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0") addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.7.1") -addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.6.0") +addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.1") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.9") @@ -27,6 +27,8 @@ addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "0.2.2") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.11") +addSbtPlugin("pl.project13.sbt" % "sbt-jol" % "0.1.1") + addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0-RC1") // for advanced PR validation features