You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by fa...@apache.org on 2024/10/09 09:25:10 UTC

(pekko-grpc) branch main updated: use addPekkoModuleDependency (#383)

This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-grpc.git


The following commit(s) were added to refs/heads/main by this push:
     new 295fa4bd use addPekkoModuleDependency (#383)
295fa4bd is described below

commit 295fa4bd6fbb12fb23d5a0aa514b65d06e124c37
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Wed Oct 9 10:25:05 2024 +0100

    use addPekkoModuleDependency (#383)
    
    * use addPekkoModuleDependency
    
    * some issues
---
 build.sbt                  | 24 ++++++++++++++++++------
 project/Dependencies.scala | 26 +-------------------------
 2 files changed, 19 insertions(+), 31 deletions(-)

diff --git a/build.sbt b/build.sbt
index a6c8519e..4cf63fc5 100644
--- a/build.sbt
+++ b/build.sbt
@@ -7,11 +7,11 @@
  * 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, 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
@@ -27,7 +27,6 @@ commands := commands.value.filterNot { command =>
   }
 }
 
-ThisBuild / resolvers += Resolver.ApacheMavenSnapshotsRepo
 ThisBuild / reproducibleBuildsCheckResolver := Resolver.ApacheMavenStagingRepo
 
 // So that gRPC is properly styled
@@ -86,11 +85,18 @@ 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"
 
 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-discovery", "", 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)
@@ -133,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"))
@@ -164,7 +170,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 +179,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 +283,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)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org