From 5b5ec884d30710ad9d0f9aca17de8e00970c27d6 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 9 Oct 2024 01:32:20 +0100 Subject: [PATCH 1/2] use addPekkoModuleDependency --- build.sbt | 17 +++++++++++++++-- project/Dependencies.scala | 26 +------------------------- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/build.sbt b/build.sbt index a6c8519e..c9ea3be2 100644 --- a/build.sbt +++ b/build.sbt @@ -7,6 +7,7 @@ * This file is part of the Apache Pekko project, derived from Akka. */ +import com.github.pjfanning.pekkobuild._ import net.bzzt.reproduciblebuilds.ReproducibleBuildsPlugin.reproducibleBuildsCheckResolver import org.apache.pekko.grpc.Dependencies import org.apache.pekko.grpc.Dependencies.Versions.{ scala212, scala213 } @@ -27,7 +28,6 @@ commands := commands.value.filterNot { command => } } -ThisBuild / resolvers += Resolver.ApacheMavenSnapshotsRepo ThisBuild / reproducibleBuildsCheckResolver := Resolver.ApacheMavenStagingRepo // So that gRPC is properly styled @@ -91,6 +91,13 @@ lazy val codegen = Project(id = "codegen", base = file("codegen")) val mimaCompareVersion = "1.0.2" lazy val runtime = Project(id = "runtime", base = file("runtime")) + .addPekkoModuleDependency("pekko-stream", "", PekkoCoreDependency.default) + .addPekkoModuleDependency("pekko-http-core", "", PekkoHttpDependency.default) + .addPekkoModuleDependency("pekko-http", "", PekkoHttpDependency.default) + .addPekkoModuleDependency("pekko-doscovery", "", PekkoCoreDependency.default) + .addPekkoModuleDependency("pekko-http-cors", "", PekkoHttpDependency.default) + .addPekkoModuleDependency("pekko-testkit", "test", PekkoCoreDependency.default) + .addPekkoModuleDependency("pekko-stream-testkit", "test", PekkoCoreDependency.default) .settings(Dependencies.runtime) .settings(VersionGenerator.settings) .settings(MetaInfLicenseNoticeCopy.runtimeSettings) @@ -164,7 +171,7 @@ lazy val sbtPlugin = Project(id = "sbt-plugin", base = file("sbt-plugin")) val p3 = (runtime / publishLocal).value val p4 = (interopTests / publishLocal).value }, - scriptedSbt := "1.10.0", + scriptedSbt := "1.10.2", scriptedBufferLog := false) .settings( crossScalaVersions := Dependencies.Versions.CrossScalaForPlugin, @@ -173,6 +180,10 @@ lazy val sbtPlugin = Project(id = "sbt-plugin", base = file("sbt-plugin")) lazy val interopTests = Project(id = "interop-tests", base = file("interop-tests")) .disablePlugins(MimaPlugin) + .addPekkoModuleDependency("pekko-http", "", PekkoHttpDependency.default) + .addPekkoModuleDependency("pekko-slf4j", "", PekkoCoreDependency.default) + .addPekkoModuleDependency("pekko-testkit", "test", PekkoCoreDependency.default) + .addPekkoModuleDependency("pekko-stream-testkit", "test", PekkoCoreDependency.default) .settings(Dependencies.interopTests) .settings( crossScalaVersions := Dependencies.Versions.CrossScalaForLib, @@ -273,6 +284,8 @@ lazy val docs = Project(id = "docs", base = file("docs")) lazy val pluginTesterScala = Project(id = "plugin-tester-scala", base = file("plugin-tester-scala")) .disablePlugins(MimaPlugin) + .addPekkoModuleDependency("pekko-http-cors", "", PekkoHttpDependency.default) + .addPekkoModuleDependency("pekko-http", "", PekkoHttpDependency.default) .settings(Dependencies.pluginTester) .settings( name := s"$pekkoPrefix-plugin-tester-scala", diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 8b8bea1a..78c3d161 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -45,13 +45,6 @@ object Dependencies { } object Compile { - val pekkoStream = "org.apache.pekko" %% "pekko-stream" % Versions.pekko - val pekkoHttp = "org.apache.pekko" %% "pekko-http" % Versions.pekkoHttp - val pekkoHttpCore = "org.apache.pekko" %% "pekko-http-core" % Versions.pekkoHttp - val pekkoHttpCors = "org.apache.pekko" %% "pekko-http-cors" % Versions.pekkoHttp - val pekkoDiscovery = "org.apache.pekko" %% "pekko-discovery" % Versions.pekko - val pekkoSlf4j = "org.apache.pekko" %% "pekko-slf4j" % Versions.pekko - val scalapbCompilerPlugin = "com.thesamet.scalapb" %% "compilerplugin" % scalapb.compiler.Version.scalapbVersion val scalapbRuntime = ("com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion) .exclude("io.grpc", "grpc-netty") @@ -79,9 +72,6 @@ object Dependencies { final val Test = sbt.Test val scalaTest = "org.scalatest" %% "scalatest" % Versions.scalaTest % Test val scalaTestPlusJunit = "org.scalatestplus" %% "junit-4-13" % (Versions.scalaTest + ".0") % Test - val pekkoDiscoveryConfig = "org.apache.pekko" %% "pekko-discovery" % Versions.pekko % Test - val pekkoTestkit = "org.apache.pekko" %% "pekko-testkit" % Versions.pekko % Test - val pekkoStreamTestkit = "org.apache.pekko" %% "pekko-stream-testkit" % Versions.pekko % Test } object Runtime { @@ -112,14 +102,6 @@ object Dependencies { Compile.grpcCore, Compile.grpcStub % Provided, // comes from the generators Compile.grpcNettyShaded, - Compile.pekkoStream, - Compile.pekkoHttpCore, - Compile.pekkoHttp, - Compile.pekkoDiscovery, - Compile.pekkoHttpCors, - Compile.pekkoHttp % Provided, - Test.pekkoTestkit, - Test.pekkoStreamTestkit, Test.scalaTest, Test.scalaTestPlusJunit) @@ -139,19 +121,13 @@ object Dependencies { lazy val interopTests = l ++= Seq( Compile.grpcInteropTesting, Compile.grpcInteropTesting % "protobuf", // gets the proto files for interop tests - Compile.pekkoHttp, - Compile.pekkoSlf4j, Runtime.logback, Test.scalaTest.withConfigurations(Some("compile")), - Test.scalaTestPlusJunit.withConfigurations(Some("compile")), - Test.pekkoTestkit, - Test.pekkoStreamTestkit) + Test.scalaTestPlusJunit.withConfigurations(Some("compile"))) lazy val pluginTester = l ++= Seq( // usually automatically added by `suggestedDependencies`, which doesn't work with ReflectiveCodeGen Compile.grpcStub, - Compile.pekkoHttpCors, - Compile.pekkoHttp, Test.scalaTest, Test.scalaTestPlusJunit, Protobuf.googleCommonProtos) From 12f70e578edb0e76d8b0c55f5b314ef2a54bddbf Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 9 Oct 2024 01:44:18 +0100 Subject: [PATCH 2/2] some issues --- build.sbt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index c9ea3be2..4cf63fc5 100644 --- a/build.sbt +++ b/build.sbt @@ -9,10 +9,9 @@ import com.github.pjfanning.pekkobuild._ import net.bzzt.reproduciblebuilds.ReproducibleBuildsPlugin.reproducibleBuildsCheckResolver -import org.apache.pekko.grpc.Dependencies +import org.apache.pekko.grpc.{ Dependencies, NoPublish, PekkoCoreDependency, PekkoHttpDependency } import org.apache.pekko.grpc.Dependencies.Versions.{ scala212, scala213 } import org.apache.pekko.grpc.ProjectExtensions._ -import org.apache.pekko.grpc.NoPublish import org.apache.pekko.grpc.build.ReflectiveCodeGen import com.typesafe.tools.mima.core._ import sbt.Keys.scalaVersion @@ -86,7 +85,7 @@ lazy val codegen = Project(id = "codegen", base = file("codegen")) } }) .settings(addArtifact(Compile / assembly / artifact, assembly)) - .settings(addArtifact(Artifact(pekkoGrpcCodegenId, "bat", "bat", "bat"), mkBatAssemblyTask)) + .settings(addArtifact(sbt.Artifact(pekkoGrpcCodegenId, "bat", "bat", "bat"), mkBatAssemblyTask)) val mimaCompareVersion = "1.0.2" @@ -94,7 +93,7 @@ lazy val runtime = Project(id = "runtime", base = file("runtime")) .addPekkoModuleDependency("pekko-stream", "", PekkoCoreDependency.default) .addPekkoModuleDependency("pekko-http-core", "", PekkoHttpDependency.default) .addPekkoModuleDependency("pekko-http", "", PekkoHttpDependency.default) - .addPekkoModuleDependency("pekko-doscovery", "", PekkoCoreDependency.default) + .addPekkoModuleDependency("pekko-discovery", "", PekkoCoreDependency.default) .addPekkoModuleDependency("pekko-http-cors", "", PekkoHttpDependency.default) .addPekkoModuleDependency("pekko-testkit", "test", PekkoCoreDependency.default) .addPekkoModuleDependency("pekko-stream-testkit", "test", PekkoCoreDependency.default) @@ -140,7 +139,7 @@ lazy val scalapbProtocPlugin = Project(id = "scalapb-protoc-plugin", base = file crossScalaVersions := Dependencies.Versions.CrossScalaForLib, scalaVersion := Dependencies.Versions.CrossScalaForLib.head) .settings(addArtifact(Compile / assembly / artifact, assembly)) - .settings(addArtifact(Artifact(pekkoGrpcProtocPluginId, "bat", "bat", "bat"), mkBatAssemblyTask)) + .settings(addArtifact(sbt.Artifact(pekkoGrpcProtocPluginId, "bat", "bat", "bat"), mkBatAssemblyTask)) .enablePlugins(ReproducibleBuildsPlugin) lazy val mavenPlugin = Project(id = "maven-plugin", base = file("maven-plugin"))