From 24ada111620b6a482f0003e8a31504830fa75f03 Mon Sep 17 00:00:00 2001 From: Matthew de Detrich Date: Tue, 9 Jan 2024 20:54:13 +1100 Subject: [PATCH] Use latest sbt-osgi --- .scala-steward.conf | 2 -- project/OSGi.scala | 9 ++++++++- project/plugins.sbt | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.scala-steward.conf b/.scala-steward.conf index 98c2074194f..0bf9ce68f86 100644 --- a/.scala-steward.conf +++ b/.scala-steward.conf @@ -18,8 +18,6 @@ updates.ignore = [ { groupId = "com.lightbend.paradox", artifactId = "sbt-paradox-project-info" } { groupId = "com.lightbend.paradox", artifactId = "sbt-paradox "} { groupId = "com.typesafe", artifactId = "ssl-config-core" } - { groupId = "com.typesafe.sbt", artifactId = "sbt-osgi" } - { groupId = "com.github.sbt", artifactId = "sbt-osgi" } { groupId = "org.agrona", artifactId = "agrona" } { groupId = "org.mockito", artifactId = "mockito-core" } { groupId = "com.lightbend.sbt", artifactId = "sbt-java-formatter" } diff --git a/project/OSGi.scala b/project/OSGi.scala index 0475efc6579..b3842f73944 100644 --- a/project/OSGi.scala +++ b/project/OSGi.scala @@ -15,6 +15,7 @@ import com.typesafe.sbt.osgi.OsgiKeys import com.typesafe.sbt.osgi.SbtOsgi._ import sbt._ import sbt.Keys._ +import sbtassembly.AssemblyKeys.assembly import net.bzzt.reproduciblebuilds.ReproducibleBuildsPlugin object OSGi { @@ -80,7 +81,13 @@ object OSGi { configImport(), "*"), OsgiKeys.exportPackage := Seq("org.apache.pekko.protobufv3.internal.*"), - OsgiKeys.privatePackage := Seq("google.protobuf.*")) + OsgiKeys.privatePackage := Seq("google.protobuf.*"), + // Since the jar's generated by sbt-assembly are not added in dependencyClasspath + // we need to manually add it to sbt-osgi so it can pick it up. Note that since this + // is a fatjar from sbt-assembly we don't have to worry about incorrect osgi + // Import-Package header since the protobuf-V3 sbt-project has no real dependencies + // (including typical ones such as scala runtime) + OsgiKeys.explodedJars := Seq(assembly.value)) val jackson = exports(Seq("org.apache.pekko.serialization.jackson.*")) diff --git a/project/plugins.sbt b/project/plugins.sbt index b1cd4d37d5e..bccf9630ad7 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -13,7 +13,7 @@ addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0") addSbtPlugin("com.lightbend.sbt" % "sbt-bill-of-materials" % "1.0.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1") -addSbtPlugin("com.github.sbt" % "sbt-osgi" % "0.9.4-INVALID-CEN-JAR-PATCH") +addSbtPlugin("com.github.sbt" % "sbt-osgi" % "0.9.10") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")