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/01/14 21:52:34 UTC

(incubator-pekko-http) branch main updated: enable compile inline (upgrade sbt-pekko-build) (#418)

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/incubator-pekko-http.git


The following commit(s) were added to refs/heads/main by this push:
     new 8d9455f46 enable compile inline (upgrade sbt-pekko-build) (#418)
8d9455f46 is described below

commit 8d9455f46ba33ff30e35cd017cdce9fa5c5f2d43
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Sun Jan 14 22:52:28 2024 +0100

    enable compile inline (upgrade sbt-pekko-build) (#418)
    
    * enable compile inline
    
    * Update PekkoCoreDependency.scala
    
    * set pekkoInlineEnabled explicitly
---
 build.sbt                         | 65 ++++++++++++++++++++-------------------
 project/PekkoCoreDependency.scala | 24 +++++++++++++++
 project/VersionGenerator.scala    |  3 +-
 project/plugins.sbt               |  3 +-
 4 files changed, 60 insertions(+), 35 deletions(-)

diff --git a/build.sbt b/build.sbt
index b751d1f13..a7cef3019 100644
--- a/build.sbt
+++ b/build.sbt
@@ -28,6 +28,9 @@ commands := commands.value.filterNot { command =>
   }
 }
 
+// pekkoInlineEnabled must be set to false when this is backported to 1.0.x branch
+ThisBuild / pekkoInlineEnabled := true
+
 ThisBuild / reproducibleBuildsCheckResolver := Resolver.ApacheMavenStagingRepo
 
 addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; +headerCheckAll; javafmtCheckAll")
@@ -49,7 +52,7 @@ inThisBuild(Def.settings(
   concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
   onLoad in Global := {
     sLog.value.info(
-      s"Building Pekko HTTP ${version.value} against Pekko ${PekkoDependency.pekkoVersion} on Scala ${(httpCore / scalaVersion).value}")
+      s"Building Pekko HTTP ${version.value} against Pekko ${PekkoCoreDependency.version} on Scala ${(httpCore / scalaVersion).value}")
     (onLoad in Global).value
   },
   projectInfoVersion := (if (isSnapshot.value) "snapshot" else version.value),
@@ -130,7 +133,7 @@ val scalaMacroSupport = Seq(
 lazy val parsing = project("parsing")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http.parsing"))
-  .addPekkoModuleDependency("pekko-actor", "provided")
+  .addPekkoModuleDependency("pekko-actor", "provided", PekkoCoreDependency.default)
   .settings(Dependencies.parsing)
   .settings(scalacOptions += "-language:_")
   .settings(scalaMacroSupport)
@@ -143,11 +146,11 @@ lazy val httpCore = project("http-core")
   .settings(AutomaticModuleName.settings("pekko.http.core"))
   .settings(AddMetaInfLicenseFiles.httpCoreSettings)
   .dependsOn(parsing /*, httpScalafixRules % ScalafixConfig*/ )
-  .addPekkoModuleDependency("pekko-stream", "provided")
+  .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
   .addPekkoModuleDependency(
     "pekko-stream-testkit",
     "test",
-    PekkoDependency.default)
+    PekkoCoreDependency.default)
   .settings(Dependencies.httpCore)
   .settings(VersionGenerator.versionSettings)
   .settings(scalaMacroSupport)
@@ -162,7 +165,7 @@ lazy val http = project("http")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http"))
   .dependsOn(httpCore)
-  .addPekkoModuleDependency("pekko-stream", "provided")
+  .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
   .settings(Dependencies.http)
   .settings(
     Compile / scalacOptions += "-language:_")
@@ -177,8 +180,8 @@ lazy val http2Tests = project("http2-tests")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http.http2"))
   .dependsOn(httpCore, httpTestkit % "test", httpCore % "test->test")
-  .addPekkoModuleDependency("pekko-stream", "provided")
-  .addPekkoModuleDependency("pekko-stream-testkit", "test")
+  .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
+  .addPekkoModuleDependency("pekko-stream-testkit", "test", PekkoCoreDependency.default)
   .settings(Dependencies.http2Tests)
   .settings {
     lazy val h2specPath = Def.task {
@@ -219,8 +222,8 @@ lazy val httpTestkit = project("http-testkit")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http.testkit"))
   .dependsOn(http)
-  .addPekkoModuleDependency("pekko-stream-testkit", "provided")
-  .addPekkoModuleDependency("pekko-testkit", "provided")
+  .addPekkoModuleDependency("pekko-stream-testkit", "provided", PekkoCoreDependency.default)
+  .addPekkoModuleDependency("pekko-testkit", "provided", PekkoCoreDependency.default)
   .settings(Dependencies.httpTestkit)
   .settings(
     // don't ignore Suites which is the default for the junit-interface
@@ -242,8 +245,8 @@ lazy val httpTests = project("http-tests")
   .disablePlugins(MimaPlugin) // this is only tests
   .configs(MultiJvm)
   .settings(headerSettings(MultiJvm))
-  .addPekkoModuleDependency("pekko-stream", "provided")
-  .addPekkoModuleDependency("pekko-multi-node-testkit", "test")
+  .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
+  .addPekkoModuleDependency("pekko-multi-node-testkit", "test", PekkoCoreDependency.default)
   .settings(
     // Fix to reenable scala-steward, see https://gitter.im/scala-steward-org/scala-steward?at=6183bb66d78911028a1b7cd8
     // Putting that jar file with the complicated name into the git tree directly breaks if something in the environment
@@ -262,7 +265,7 @@ lazy val httpTests = project("http-tests")
 lazy val httpJmhBench = project("http-bench-jmh")
   .settings(commonSettings)
   .dependsOn(http, httpCors, http2Tests % "compile->compile,test")
-  .addPekkoModuleDependency("pekko-stream")
+  .addPekkoModuleDependency("pekko-stream", "", PekkoCoreDependency.default)
   .enablePlugins(JmhPlugin)
   .enablePlugins(NoPublish) // don't release benchs
   .disablePlugins(MimaPlugin)
@@ -276,13 +279,13 @@ lazy val httpMarshallersScala = project("http-marshallers-scala")
 lazy val httpXml =
   httpMarshallersScalaSubproject("xml")
     .settings(AutomaticModuleName.settings("pekko.http.marshallers.scalaxml"))
-    .addPekkoModuleDependency("pekko-stream", "provided")
+    .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
     .settings(Dependencies.httpXml)
 
 lazy val httpSprayJson =
   httpMarshallersScalaSubproject("spray-json")
     .settings(AutomaticModuleName.settings("pekko.http.marshallers.sprayjson"))
-    .addPekkoModuleDependency("pekko-stream", "provided")
+    .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
     .settings(Dependencies.httpSprayJson)
 
 lazy val httpMarshallersJava = project("http-marshallers-java")
@@ -294,8 +297,8 @@ lazy val httpMarshallersJava = project("http-marshallers-java")
 lazy val httpJackson =
   httpMarshallersJavaSubproject("jackson")
     .settings(AutomaticModuleName.settings("pekko.http.marshallers.jackson"))
-    .addPekkoModuleDependency("pekko-stream", "provided")
-    .addPekkoModuleDependency("pekko-stream-testkit", "test")
+    .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
+    .addPekkoModuleDependency("pekko-stream-testkit", "test", PekkoCoreDependency.default)
     .dependsOn(httpTestkit % "test")
     .settings(Dependencies.httpJackson)
     .enablePlugins(ScaladocNoVerificationOfDiagrams)
@@ -305,8 +308,8 @@ lazy val httpCaching = project("http-caching")
     name := "pekko-http-caching")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http.caching"))
-  .addPekkoModuleDependency("pekko-stream", "provided")
-  .addPekkoModuleDependency("pekko-stream-testkit", "provided")
+  .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
+  .addPekkoModuleDependency("pekko-stream-testkit", "provided", PekkoCoreDependency.default)
   .settings(Dependencies.httpCaching)
   .dependsOn(http, httpCore, httpTestkit % "test")
   .enablePlugins(BootstrapGenjavadoc)
@@ -317,8 +320,8 @@ lazy val httpCors = project("http-cors")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http.cors"))
   .settings(AddMetaInfLicenseFiles.httpCorsSettings)
-  .addPekkoModuleDependency("pekko-stream", "provided")
-  .addPekkoModuleDependency("pekko-stream-testkit", "provided")
+  .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
+  .addPekkoModuleDependency("pekko-stream-testkit", "provided", PekkoCoreDependency.default)
   .settings(Dependencies.httpCors)
   .dependsOn(http, httpCore, httpTestkit % "test")
   .enablePlugins(BootstrapGenjavadoc)
@@ -365,7 +368,7 @@ lazy val httpScalafixRules =
 lazy val httpScalafixTestInput =
   Project(id = "http-scalafix-test-input", base = file("http-scalafix/scalafix-test-input"))
     .dependsOn(http)
-    .addPekkoModuleDependency("pekko-stream")
+    .addPekkoModuleDependency("pekko-stream", "", PekkoCoreDependency.default)
     .enablePlugins(NoPublish, NoScala3)
     .disablePlugins(MimaPlugin, HeaderPlugin /* because it gets confused about metaheader required for tests */ )
     .settings(
@@ -379,7 +382,7 @@ lazy val httpScalafixTestInput =
 lazy val httpScalafixTestOutput =
   Project(id = "http-scalafix-test-output", base = file("http-scalafix/scalafix-test-output"))
     .dependsOn(http)
-    .addPekkoModuleDependency("pekko-stream")
+    .addPekkoModuleDependency("pekko-stream", "", PekkoCoreDependency.default)
     .enablePlugins(NoPublish, NoScala3)
     .disablePlugins(MimaPlugin, HeaderPlugin /* because it gets confused about metaheader required for tests */ )
 
@@ -406,11 +409,11 @@ lazy val httpScalafixTests =
 lazy val docs = project("docs")
   .enablePlugins(ParadoxPlugin, PekkoParadoxPlugin, NoPublish)
   .disablePlugins(MimaPlugin)
-  .addPekkoModuleDependency("pekko-stream", "provided")
-  .addPekkoModuleDependency("pekko-actor-typed", "provided")
-  .addPekkoModuleDependency("pekko-multi-node-testkit", "provided")
-  .addPekkoModuleDependency("pekko-stream-testkit", "provided")
-  .addPekkoModuleDependency("pekko-actor-testkit-typed", "provided")
+  .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
+  .addPekkoModuleDependency("pekko-actor-typed", "provided", PekkoCoreDependency.default)
+  .addPekkoModuleDependency("pekko-multi-node-testkit", "provided", PekkoCoreDependency.default)
+  .addPekkoModuleDependency("pekko-stream-testkit", "provided", PekkoCoreDependency.default)
+  .addPekkoModuleDependency("pekko-actor-testkit-typed", "provided", PekkoCoreDependency.default)
   .dependsOn(
     httpCore, http, httpXml, http2Tests, httpMarshallersJava, httpMarshallersScala, httpCaching, httpCors,
     httpTests % "compile;test->test", httpTestkit % "compile;test->test", httpScalafixRules % ScalafixConfig)
@@ -440,15 +443,15 @@ lazy val docs = project("docs")
     Compile / paradoxProperties ++= Map(
       "project.name" -> "Apache Pekko HTTP",
       "canonical.base_url" -> "https://pekko.apache.org/docs/pekko-http/current",
-      "pekko.version" -> PekkoDependency.pekkoVersion,
+      "pekko.version" -> PekkoCoreDependency.version,
       "jackson.xml.version" -> Dependencies.jacksonXmlVersion,
       "scalafix.version" -> _root_.scalafix.sbt.BuildInfo.scalafixVersion, // grab from scalafix plugin directly
       "extref.pekko-docs.base_url" -> s"https://pekko.apache.org/docs/pekko/current/%s",
       "javadoc.java.base_url" -> "https://docs.oracle.com/en/java/javase/11/docs/api/java.base/",
       "javadoc.java.link_style" -> "direct",
-      "javadoc.org.apache.pekko.base_url" -> s"https://pekko.apache.org/japi/pekko/${PekkoDependency.default.link}",
+      "javadoc.org.apache.pekko.base_url" -> s"https://pekko.apache.org/japi/pekko/${PekkoCoreDependency.default.link}",
       "javadoc.org.apache.pekko.link_style" -> "direct",
-      "scaladoc.org.apache.pekko.base_url" -> s"https://pekko.apache.org/api/pekko/${PekkoDependency.default.link}",
+      "scaladoc.org.apache.pekko.base_url" -> s"https://pekko.apache.org/api/pekko/${PekkoCoreDependency.default.link}",
       "scaladoc.org.apache.pekko.link_style" -> "direct",
       "javadoc.org.apache.pekko.http.base_url" -> s"https://pekko.apache.org/api/pekko-http/${projectInfoVersion.value}",
       "scaladoc.org.apache.pekko.http.base_url" -> s"https://pekko.apache.org/japi/pekko-http/${projectInfoVersion.value}",
@@ -461,7 +464,7 @@ lazy val docs = project("docs")
 lazy val compatibilityTests = Project("http-compatibility-tests", file("http-compatibility-tests"))
   .enablePlugins(NoPublish, NoScala3)
   .disablePlugins(MimaPlugin)
-  .addPekkoModuleDependency("pekko-stream", "provided")
+  .addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
   .settings(
     libraryDependencies ++= Seq(
       "org.apache.pekko" %% "pekko-http" % MiMa.latest101Version % "provided",
diff --git a/project/PekkoCoreDependency.scala b/project/PekkoCoreDependency.scala
new file mode 100644
index 000000000..b3244a599
--- /dev/null
+++ b/project/PekkoCoreDependency.scala
@@ -0,0 +1,24 @@
+/*
+ * 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 com.github.pjfanning.pekkobuild.PekkoDependency
+
+object PekkoCoreDependency extends PekkoDependency {
+  override val checkProject: String = "pekko-cluster-sharding-typed"
+  override val module: Option[String] = None
+  override val currentVersion: String = "1.0.2"
+}
diff --git a/project/VersionGenerator.scala b/project/VersionGenerator.scala
index d4167e2f5..6a368015e 100644
--- a/project/VersionGenerator.scala
+++ b/project/VersionGenerator.scala
@@ -13,7 +13,6 @@
 
 import sbt._
 import sbt.Keys._
-import com.github.pjfanning.pekkobuild.PekkoDependency
 
 /**
  * Generate version.conf and pekko/Version.scala files based on the version setting.
@@ -45,7 +44,7 @@ object VersionGenerator {
 
   def generateVersion(dir: SettingKey[File], locate: File => File, template: String) = Def.task[Seq[File]] {
     val file = locate(dir.value)
-    val content = template.stripMargin.format(version.value, PekkoDependency.minPekkoVersion)
+    val content = template.stripMargin.format(version.value, PekkoCoreDependency.minVersion)
     if (!file.exists || IO.read(file) != content) IO.write(file, content)
     Seq(file)
   }
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 880135e73..bd0c79db5 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -9,7 +9,6 @@
 
 resolvers += Classpaths.sbtPluginReleases
 resolvers += Classpaths.typesafeReleases
-resolvers ++= Resolver.sonatypeOssRepos("releases") // to more quickly obtain paradox right after release
 
 addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.4.0")
 addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")
@@ -39,7 +38,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1")
 addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
 addSbtPlugin("org.mdedetrich" % "sbt-apache-sonatype" % "0.1.10")
 addSbtPlugin("com.github.pjfanning" % "sbt-source-dist" % "0.1.11")
-addSbtPlugin("com.github.pjfanning" % "sbt-pekko-build" % "0.2.0")
+addSbtPlugin("com.github.pjfanning" % "sbt-pekko-build" % "0.3.0")
 addSbtPlugin("net.virtual-void" % "sbt-hackers-digest" % "0.1.2")
 addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0")
 


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