Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sbt-osgi to 0.10.0 #1063

Merged
merged 1 commit into from
Jan 29, 2024
Merged
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
33 changes: 20 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ lazy val actor = pekkoModule("actor")
.settings(AddMetaInfLicenseFiles.actorSettings)
.settings(VersionGenerator.settings)
.settings(serialversionRemoverPluginSettings)
.enablePlugins(BoilerplatePlugin)
.enablePlugins(BoilerplatePlugin, SbtOsgi)

lazy val actorTests = pekkoModule("actor-tests")
.dependsOn(testkit % "compile->compile;test->test", actor)
Expand Down Expand Up @@ -167,7 +167,7 @@ lazy val cluster = pekkoModule("cluster")
.settings(OSGi.cluster)
.settings(Protobuf.settings)
.settings(Test / parallelExecution := false)
.enablePlugins(MultiNodeScalaTest)
.enablePlugins(MultiNodeScalaTest, SbtOsgi)

lazy val clusterMetrics = pekkoModule("cluster-metrics")
.dependsOn(
Expand All @@ -180,7 +180,7 @@ lazy val clusterMetrics = pekkoModule("cluster-metrics")
.settings(Protobuf.settings)
.settings(SigarLoader.sigarSettings)
.settings(Test / parallelExecution := false)
.enablePlugins(MultiNodeScalaTest)
.enablePlugins(MultiNodeScalaTest, SbtOsgi)

lazy val clusterSharding = pekkoModule("cluster-sharding")
// TODO pekko-persistence dependency should be provided in pom.xml artifact.
Expand All @@ -197,8 +197,7 @@ lazy val clusterSharding = pekkoModule("cluster-sharding")
.settings(AutomaticModuleName.settings("pekko.cluster.sharding"))
.settings(OSGi.clusterSharding)
.settings(Protobuf.settings)
.enablePlugins(MultiNode, ScaladocNoVerificationOfDiagrams)
.enablePlugins(Jdk9)
.enablePlugins(MultiNode, ScaladocNoVerificationOfDiagrams, Jdk9, SbtOsgi)

lazy val clusterTools = pekkoModule("cluster-tools")
.dependsOn(
Expand All @@ -209,7 +208,7 @@ lazy val clusterTools = pekkoModule("cluster-tools")
.settings(AutomaticModuleName.settings("pekko.cluster.tools"))
.settings(OSGi.clusterTools)
.settings(Protobuf.settings)
.enablePlugins(MultiNode, ScaladocNoVerificationOfDiagrams)
.enablePlugins(MultiNode, ScaladocNoVerificationOfDiagrams, SbtOsgi)

lazy val distributedData = pekkoModule("distributed-data")
.dependsOn(cluster % "compile->compile;test->test;multi-jvm->multi-jvm", jackson % "test->test")
Expand All @@ -218,7 +217,7 @@ lazy val distributedData = pekkoModule("distributed-data")
.settings(AddMetaInfLicenseFiles.distributedDataSettings)
.settings(OSGi.distributedData)
.settings(Protobuf.settings)
.enablePlugins(MultiNodeScalaTest)
.enablePlugins(MultiNodeScalaTest, SbtOsgi)

lazy val docs = pekkoModule("docs")
.configs(Jdk9.TestJdk9)
Expand Down Expand Up @@ -274,7 +273,7 @@ lazy val jackson = pekkoModule("serialization-jackson")
.settings(AutomaticModuleName.settings("pekko.serialization.jackson"))
.settings(OSGi.jackson)
.settings(javacOptions += "-parameters")
.enablePlugins(ScaladocNoVerificationOfDiagrams)
.enablePlugins(ScaladocNoVerificationOfDiagrams, SbtOsgi)

lazy val multiNodeTestkit = pekkoModule("multi-node-testkit")
.dependsOn(remote, testkit)
Expand All @@ -289,6 +288,7 @@ lazy val osgi = pekkoModule("osgi")
.settings(AutomaticModuleName.settings("pekko.osgi"))
.settings(OSGi.osgi)
.settings(Test / parallelExecution := false)
.enablePlugins(SbtOsgi)

lazy val persistence = pekkoModule("persistence")
.dependsOn(actor, stream, testkit % "test->test")
Expand All @@ -297,6 +297,7 @@ lazy val persistence = pekkoModule("persistence")
.settings(OSGi.persistence)
.settings(Protobuf.settings)
.settings(Test / fork := true)
.enablePlugins(SbtOsgi)

lazy val persistenceQuery = pekkoModule("persistence-query")
.dependsOn(
Expand All @@ -312,7 +313,7 @@ lazy val persistenceQuery = pekkoModule("persistence-query")
// To be able to import ContainerFormats.proto
.settings(Protobuf.importPath := Some(baseDirectory.value / ".." / "remote" / "src" / "main" / "protobuf"))
.settings(Test / fork := true)
.enablePlugins(ScaladocNoVerificationOfDiagrams)
.enablePlugins(ScaladocNoVerificationOfDiagrams, SbtOsgi)

lazy val persistenceShared = pekkoModule("persistence-shared")
.dependsOn(persistence % "test->test", testkit % "test->test", remote % Test)
Expand Down Expand Up @@ -357,7 +358,7 @@ lazy val protobufV3 = pekkoModule("protobuf-v3")
.settings(OSGi.protobufV3)
.settings(AutomaticModuleName.settings("pekko.protobuf.v3"))
.settings(AddMetaInfLicenseFiles.protobufV3Settings)
.enablePlugins(ScaladocNoVerificationOfDiagrams)
.enablePlugins(ScaladocNoVerificationOfDiagrams, SbtOsgi)
.disablePlugins(MimaPlugin)
.settings(
libraryDependencies += Dependencies.Compile.Provided.protobufRuntime,
Expand Down Expand Up @@ -407,7 +408,7 @@ lazy val remote =
.settings(Protobuf.settings)
.settings(Test / parallelExecution := false)
.settings(serialversionRemoverPluginSettings)
.enablePlugins(Jdk9)
.enablePlugins(Jdk9, SbtOsgi)

lazy val remoteTests = pekkoModule("remote-tests")
.dependsOn(
Expand All @@ -427,20 +428,22 @@ lazy val slf4j = pekkoModule("slf4j")
.settings(Dependencies.slf4j)
.settings(AutomaticModuleName.settings("pekko.slf4j"))
.settings(OSGi.slf4j)
.enablePlugins(SbtOsgi)

lazy val stream = pekkoModule("stream")
.dependsOn(actor, protobufV3)
.settings(Dependencies.stream)
.settings(AutomaticModuleName.settings("pekko.stream"))
.settings(OSGi.stream)
.settings(Protobuf.settings)
.enablePlugins(BoilerplatePlugin, Jdk9)
.enablePlugins(BoilerplatePlugin, Jdk9, SbtOsgi)

lazy val streamTestkit = pekkoModule("stream-testkit")
.dependsOn(stream, testkit % "compile->compile;test->test")
.settings(Dependencies.streamTestkit)
.settings(AutomaticModuleName.settings("pekko.stream.testkit"))
.settings(OSGi.streamTestkit)
.enablePlugins(SbtOsgi)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So does the kit.


lazy val streamTests = pekkoModule("stream-tests")
.configs(Jdk9.TestJdk9)
Expand All @@ -467,6 +470,7 @@ lazy val testkit = pekkoModule("testkit")
.settings(AutomaticModuleName.settings("pekko.actor.testkit"))
.settings(OSGi.testkit)
.settings(initialCommands += "import org.apache.pekko.testkit._")
.enablePlugins(SbtOsgi)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the tests need osgi too?

Copy link
Contributor Author

@mdedetrich mdedetrich Jan 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's inherited from the parent project. Note that if it's not done correctly the sbt build won't even load.

The solution is quote simple, whoever OSGi settings were used we now need to enable the plugin explicitly, nothing more or less.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the tests should not have OSGi enabled anyways, OSGi is about packaging the final jar and we don't package tests


lazy val actorTyped = pekkoModule("actor-typed")
.dependsOn(actor, slf4j)
Expand All @@ -487,7 +491,7 @@ lazy val actorTyped = pekkoModule("actor-typed")

implicit val timeout = Timeout(5 seconds)
""")
.enablePlugins(Jdk9)
.enablePlugins(Jdk9, SbtOsgi)

lazy val persistenceTyped = pekkoModule("persistence-typed")
.dependsOn(
Expand All @@ -508,6 +512,7 @@ lazy val persistenceTyped = pekkoModule("persistence-typed")
// To be able to import ContainerFormats.proto
.settings(Protobuf.importPath := Some(baseDirectory.value / ".." / "remote" / "src" / "main" / "protobuf"))
.settings(OSGi.persistenceTyped)
.enablePlugins(SbtOsgi)

lazy val clusterTyped = pekkoModule("cluster-typed")
.dependsOn(
Expand Down Expand Up @@ -580,12 +585,14 @@ lazy val discovery = pekkoModule("discovery")
.settings(Dependencies.discovery)
.settings(AutomaticModuleName.settings("pekko.discovery"))
.settings(OSGi.discovery)
.enablePlugins(SbtOsgi)

lazy val coordination = pekkoModule("coordination")
.dependsOn(actor, testkit % "test->test", actorTests % "test->test")
.settings(Dependencies.coordination)
.settings(AutomaticModuleName.settings("pekko.coordination"))
.settings(OSGi.coordination)
.enablePlugins(SbtOsgi)

lazy val billOfMaterials = Project("bill-of-materials", file("bill-of-materials"))
.enablePlugins(BillOfMaterialsPlugin)
Expand Down
4 changes: 2 additions & 2 deletions project/OSGi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* Copyright (C) 2016-2022 Lightbend Inc. <https://www.lightbend.com>
*/

import com.typesafe.sbt.osgi.OsgiKeys
import com.typesafe.sbt.osgi.SbtOsgi._
import com.github.sbt.osgi.OsgiKeys
import com.github.sbt.osgi.SbtOsgi._
import sbt._
import sbt.Keys._
import sbtassembly.AssemblyKeys.assembly
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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.11")
addSbtPlugin("com.github.sbt" % "sbt-osgi" % "0.10.0")
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")
Expand Down
Loading