diff --git a/.github/workflows/binary-compatibility-checks.yml b/.github/workflows/binary-compatibility-checks.yml index 0dcfe4c26c..3fb91a1c2e 100644 --- a/.github/workflows/binary-compatibility-checks.yml +++ b/.github/workflows/binary-compatibility-checks.yml @@ -38,6 +38,9 @@ jobs: - name: Compile code run: sbt +compile + - name: Check if the dependency task in the built correctly + run: sbt dependWalkerCheck + - name: Report MiMa Binary Issues run: |- sbt +mimaReportBinaryIssues diff --git a/.github/workflows/nightly-builds.yml b/.github/workflows/nightly-builds.yml index 38f2d82027..f46edc92c3 100644 --- a/.github/workflows/nightly-builds.yml +++ b/.github/workflows/nightly-builds.yml @@ -133,6 +133,9 @@ jobs: - name: Enable jvm-opts run: cp .jvmopts-ci .jvmopts + - name: Check if the dependency task in the built correctly + run: sbt dependWalkerCheck + - name: Compile and Test # note that this is not running any multi-jvm tests because multi-in-test=false run: |- diff --git a/build.sbt b/build.sbt index a5450d5e71..e2d172f220 100644 --- a/build.sbt +++ b/build.sbt @@ -188,7 +188,8 @@ lazy val clusterSharding = pekkoModule("cluster-sharding") .settings(AutomaticModuleName.settings("pekko.cluster.sharding")) .settings(OSGi.clusterSharding) .settings(Protobuf.settings) - .enablePlugins(MultiNode, ScaladocNoVerificationOfDiagrams, Jdk9, SbtOsgi) + .settings(PekkoDependWalker.jdk9CompileCheckSetting) + .enablePlugins(MultiNode, ScaladocNoVerificationOfDiagrams, Jdk9, DependWalkerPlugin, SbtOsgi) lazy val clusterTools = pekkoModule("cluster-tools") .dependsOn( @@ -399,7 +400,8 @@ lazy val remote = .settings(Protobuf.settings) .settings(Test / parallelExecution := false) .settings(serialversionRemoverPluginSettings) - .enablePlugins(Jdk9, SbtOsgi) + .settings(PekkoDependWalker.jdk9CompileCheckSetting) + .enablePlugins(Jdk9, DependWalkerPlugin, SbtOsgi) lazy val remoteTests = pekkoModule("remote-tests") .dependsOn( @@ -428,7 +430,8 @@ lazy val stream = pekkoModule("stream") .settings(OSGi.stream) .settings(Protobuf.settings) .settings(VerifyJDK9Classes.settings) - .enablePlugins(BoilerplatePlugin, Jdk9, SbtOsgi) + .settings(PekkoDependWalker.jdk9CompileCheckSetting) + .enablePlugins(BoilerplatePlugin, Jdk9, DependWalkerPlugin, SbtOsgi) lazy val streamTestkit = pekkoModule("stream-testkit") .dependsOn(stream, testkit % "compile->compile;test->test") @@ -483,7 +486,8 @@ lazy val actorTyped = pekkoModule("actor-typed") implicit val timeout = Timeout(5 seconds) """) - .enablePlugins(Jdk9, SbtOsgi) + .settings(PekkoDependWalker.jdk9CompileCheckSetting) + .enablePlugins(Jdk9, DependWalkerPlugin, SbtOsgi) lazy val persistenceTyped = pekkoModule("persistence-typed") .dependsOn( diff --git a/project/PekkoDependWalker.scala b/project/PekkoDependWalker.scala new file mode 100644 index 0000000000..036900388f --- /dev/null +++ b/project/PekkoDependWalker.scala @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Jdk9.CompileJdk9 +import io.github.roiocam.DependWalkerPlugin.autoImport.walkTasks +import io.github.roiocam.TaskDefine._ +import io.github.roiocam._ +import sbt.Keys._ +import sbt._ + +object PekkoDependWalker { + + lazy val jdk9CompileCheckSetting = Seq( + walkTasks := Seq( + WalkTask( + ScopeKeyMatcher((Compile / packageBin).scopedKey, CheckBoth), + ScopeKeyMatcher((CompileJdk9 / compile).scopedKey, CheckConfig)))) + +} diff --git a/project/plugins.sbt b/project/plugins.sbt index 918787f5ee..c3a4838f2f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -29,6 +29,7 @@ addSbtPlugin("com.github.pjfanning" % "sbt-source-dist" % "0.1.11") addSbtPlugin("com.github.pjfanning" % "sbt-pekko-build" % "0.3.2") addSbtPlugin("com.github.reibitto" % "sbt-welcome" % "0.4.0") addSbtPlugin("com.github.sbt" % "sbt-license-report" % "1.6.1") +addSbtPlugin("io.github.roiocam" % "sbt-depend-walker" % "0.1.1") // We have to deliberately use older versions of sbt-paradox because current Pekko sbt build // only loads on JDK 1.8 so we need to bring in older versions of parboiled which support JDK 1.8