From b5b592c8f9007f1c5401532d668505ccfbecff8c Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Tue, 2 Apr 2019 15:16:01 +0200 Subject: [PATCH] Remove Scala 2.11 from crossScalaVersions (#26656) * Remove Scala 2.11 from crossScalaVersions * because +buildRelease doesn't work with mixed crossScalaVersions * let's use akka.build.scalaVersion when building for 2.11 * aggregatedProjects adjusted depending on akka.build.scalaVersion is 2.11 or not, there excluding/including the -typed modules * update travis to use akka.build.scalaVersion --- .travis.yml | 2 +- build.sbt | 35 +++++++-------- project/AkkaBuild.scala | 4 -- project/Dependencies.scala | 90 +++++++++++++++++++++++++++----------- project/scripts/release | 1 + 5 files changed, 81 insertions(+), 51 deletions(-) diff --git a/.travis.yml b/.travis.yml index 440942664b..f85e14412a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ cache: script: - jabba use "adopt@~1.8.202-08" # need to override as the default is to test - - sbt -jvm-opts .jvmopts-travis ";++$TRAVIS_SCALA_VERSION update ;++$TRAVIS_SCALA_VERSION mimaReportBinaryIssues ;++$TRAVIS_SCALA_VERSION test:compile ;++$TRAVIS_SCALA_VERSION validateCompile" + - sbt -jvm-opts .jvmopts-travis -Dakka.build.scalaVersion=$TRAVIS_SCALA_VERSION ";update ;mimaReportBinaryIssues ;test:compile ;validateCompile" # make 'git branch' work again - git branch -f "$TRAVIS_BRANCH" && git checkout "$TRAVIS_BRANCH" # check policies, if on master also upload diff --git a/build.sbt b/build.sbt index c8e4609e59..0ea1a34493 100644 --- a/build.sbt +++ b/build.sbt @@ -22,12 +22,14 @@ initialize := { initialize.value } -// akka.AkkaBuild.buildSettings +akka.AkkaBuild.buildSettings shellPrompt := { s => Project.extract(s).currentProject.id + " > " } resolverSettings +def isScala211: Boolean = System.getProperty("akka.build.scalaVersion", "").startsWith("2.11") + // When this is updated the set of modules in ActorSystem.allModules should also be updated -lazy val aggregatedProjects: Seq[ProjectReference] = Seq( +lazy val aggregatedProjects: Seq[ProjectReference] = List[ProjectReference]( actor, actorTests, agent, benchJmh, @@ -35,7 +37,6 @@ lazy val aggregatedProjects: Seq[ProjectReference] = Seq( cluster, clusterMetrics, clusterSharding, clusterTools, contrib, distributedData, - docs, multiNodeTestkit, osgi, persistence, persistenceQuery, persistenceShared, persistenceTck, @@ -44,14 +45,18 @@ lazy val aggregatedProjects: Seq[ProjectReference] = Seq( slf4j, stream, streamTestkit, streamTests, streamTestsTck, testkit, - actorTyped, actorTypedTests, actorTestkitTyped, - persistenceTyped, - clusterTyped, clusterShardingTyped, - benchJmhTyped, - streamTyped, discovery, coordination -) +) ++ + (if (isScala211) List.empty[ProjectReference] + else List[ProjectReference]( + docs, + actorTyped, actorTypedTests, actorTestkitTyped, + persistenceTyped, + clusterTyped, clusterShardingTyped, + benchJmhTyped, + streamTyped + )) lazy val root = Project( id = "akka", @@ -62,8 +67,7 @@ lazy val root = Project( (CrossVersion.partialVersion(scalaVersion.value) match { case Some((2, n)) if n == 11 => aggregatedProjects // ignore all, don't unidoc when scalaVersion is 2.11 case _ => Seq(remoteTests, benchJmh, benchJmhTyped, protobuf, akkaScalaNightly, docs) - }), - crossScalaVersions := Nil, // Allows some modules (typed) to be only for 2.12 sbt/sbt#3465 + }) ) .settings( unmanagedSources in(Compile, headerCreate) := (baseDirectory.value / "project").**("*.scala").get @@ -124,7 +128,6 @@ lazy val benchJmhTyped = akkaModule("akka-bench-jmh-typed") ).map(_ % "compile->compile;compile->test"): _* ) .settings(Dependencies.benchJmh) - .settings(AkkaBuild.noScala211) .enablePlugins(JmhPlugin, ScaladocNoVerificationOfDiagrams, NoPublish, CopyrightHeader) .disablePlugins(MimaPlugin, WhiteSourcePlugin, ValidatePullRequest, CopyrightHeaderInPr) @@ -269,7 +272,6 @@ lazy val docs = akkaModule("akka-docs") resolvers += Resolver.jcenterRepo, deployRsyncArtifact := List((paradox in Compile).value -> s"www/docs/akka/${version.value}") ) - .settings(AkkaBuild.noScala211) .enablePlugins( AkkaParadoxPlugin, DeployRsync, NoPublish, ParadoxBrowse, ScaladocNoVerificationOfDiagrams, @@ -418,7 +420,6 @@ lazy val actorTyped = akkaModule("akka-actor-typed") .settings(AkkaBuild.mayChangeSettings) .settings(AutomaticModuleName.settings("akka.actor.typed")) // fine for now, eventually new module name to become typed.actor .settings(OSGi.actorTyped) - .settings(AkkaBuild.noScala211) .settings( initialCommands := """ @@ -442,7 +443,6 @@ lazy val persistenceTyped = akkaModule("akka-persistence-typed") ) .settings(Dependencies.persistenceShared) .settings(AkkaBuild.mayChangeSettings) - .settings(AkkaBuild.noScala211) .settings(AutomaticModuleName.settings("akka.persistence.typed")) .settings(OSGi.persistenceTyped) .disablePlugins(MimaPlugin) @@ -461,7 +461,6 @@ lazy val clusterTyped = akkaModule("akka-cluster-typed") remoteTests % "test->test" ) .settings(AkkaBuild.mayChangeSettings) - .settings(AkkaBuild.noScala211) .settings(AutomaticModuleName.settings("akka.cluster.typed")) .disablePlugins(MimaPlugin) .configs(MultiJvm) @@ -478,7 +477,6 @@ lazy val clusterShardingTyped = akkaModule("akka-cluster-sharding-typed") remoteTests % "test->test" ) .settings(AkkaBuild.mayChangeSettings) - .settings(AkkaBuild.noScala211) .settings(AutomaticModuleName.settings("akka.cluster.sharding.typed")) // To be able to import ContainerFormats.proto .settings(Protobuf.importPath := Some(baseDirectory.value / ".." / "akka-remote" / "src" / "main" / "protobuf")) @@ -495,7 +493,6 @@ lazy val streamTyped = akkaModule("akka-stream-typed") actorTypedTests % "test->test" ) .settings(AkkaBuild.mayChangeSettings) - .settings(AkkaBuild.noScala211) .settings(AutomaticModuleName.settings("akka.stream.typed")) .disablePlugins(MimaPlugin) .enablePlugins(ScaladocNoVerificationOfDiagrams) @@ -504,7 +501,6 @@ lazy val actorTestkitTyped = akkaModule("akka-actor-testkit-typed") .dependsOn(actorTyped, testkit % "compile->compile;test->test") .settings(AutomaticModuleName.settings("akka.actor.testkit.typed")) .settings(Dependencies.actorTestkitTyped) - .settings(AkkaBuild.noScala211) .disablePlugins(MimaPlugin) lazy val actorTypedTests = akkaModule("akka-actor-typed-tests") @@ -513,7 +509,6 @@ lazy val actorTypedTests = akkaModule("akka-actor-typed-tests") actorTestkitTyped % "compile->compile;test->test" ) .settings(AkkaBuild.mayChangeSettings) - .settings(AkkaBuild.noScala211) .disablePlugins(MimaPlugin) .enablePlugins(NoPublish) diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index cbfc449c55..c587946e2e 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -234,10 +234,6 @@ object AkkaBuild { javacOptions in doc ++= Seq("-Xdoclint:none", "--ignore-source-errors")) - lazy val noScala211 = Seq( - crossScalaVersions := crossScalaVersions.value.filterNot(_.startsWith("2.11")) - ) - def loadSystemProperties(fileName: String): Unit = { import scala.collection.JavaConverters._ val file = new File(fileName) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 0778ec7482..80768b22d5 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -21,14 +21,15 @@ object Dependencies { val aeronVersion = "1.15.1" val Versions = Seq( - crossScalaVersions := Seq("2.12.8", "2.11.12", "2.13.0-M5"), + crossScalaVersions := Seq("2.12.8", "2.13.0-M5"), scalaVersion := System.getProperty("akka.build.scalaVersion", crossScalaVersions.value.head), scalaStmVersion := sys.props.get("akka.build.scalaStmVersion").getOrElse("0.9"), - scalaCheckVersion := sys.props.get("akka.build.scalaCheckVersion").getOrElse( - CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2, n)) if n >= 12 => "1.14.0" // does not work for 2.11 - case _ => "1.13.2" - }), + scalaCheckVersion := sys.props + .get("akka.build.scalaCheckVersion") + .getOrElse(CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, n)) if n >= 12 => "1.14.0" // does not work for 2.11 + case _ => "1.13.2" + }), scalaTestVersion := "3.0.7", java8CompatVersion := { CrossVersion.partialVersion(scalaVersion.value) match { @@ -41,7 +42,7 @@ object Dependencies { object Compile { // Compile - val camelCore = "org.apache.camel" % "camel-core" % "2.17.7" exclude ("org.slf4j", "slf4j-api") // ApacheV2 + val camelCore = ("org.apache.camel" % "camel-core" % "2.17.7").exclude("org.slf4j", "slf4j-api") // ApacheV2 // when updating config version, update links ActorSystem ScalaDoc to link to the updated version val config = "com.typesafe" % "config" % "1.3.3" // ApacheV2 @@ -77,7 +78,6 @@ object Dependencies { val aeronDriver = "io.aeron" % "aeron-driver" % aeronVersion // ApacheV2 val aeronClient = "io.aeron" % "aeron-client" % aeronVersion // ApacheV2 - object Docs { val sprayJson = "io.spray" %% "spray-json" % "1.3.4" % "test" val gson = "com.google.code.gson" % "gson" % "2.8.5" % "test" @@ -124,18 +124,16 @@ object Dependencies { // If changed, update akka-docs/build.sbt as well val sigarLoader = "io.kamon" % "sigar-loader" % "1.6.6-rev002" % "optional;provided;test" // ApacheV2 - // Non-default module in Java9, removed in Java11. For Camel. + // Non-default module in Java9, removed in Java11. For Camel. val jaxb = "javax.xml.bind" % "jaxb-api" % "2.3.0" % "provided;test" val activation = "com.sun.activation" % "javax.activation" % "1.2.0" % "provided;test" - val levelDB = "org.iq80.leveldb" % "leveldb" % "0.10" % "optional;provided" // ApacheV2 val levelDBmultiJVM = "org.iq80.leveldb" % "leveldb" % "0.10" % "optional;provided;multi-jvm" // ApacheV2 val levelDBNative = "org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8" % "optional;provided" // New BSD val junit = Compile.junit % "optional;provided;test" - val scalatest = Def.setting { "org.scalatest" %% "scalatest" % scalaTestVersion.value % "optional;provided;test" } // ApacheV2 } @@ -155,10 +153,16 @@ object Dependencies { val testkit = l ++= Seq(Test.junit, Test.scalatest.value) ++ Test.metricsAll val actorTests = l ++= Seq( - Test.junit, Test.scalatest.value, Test.commonsCodec, Test.commonsMath, - Test.mockito, Test.scalacheck.value, Test.jimfs, - Test.dockerClient, Provided.activation // dockerClient needs javax.activation.DataSource in JDK 11+ - ) + Test.junit, + Test.scalatest.value, + Test.commonsCodec, + Test.commonsMath, + Test.mockito, + Test.scalacheck.value, + Test.jimfs, + Test.dockerClient, + Provided.activation // dockerClient needs javax.activation.DataSource in JDK 11+ + ) val actorTestkitTyped = l ++= Seq(Provided.junit, Provided.scalatest.value) @@ -170,7 +174,12 @@ object Dependencies { val clusterTools = l ++= Seq(Test.junit, Test.scalatest.value) - val clusterSharding = l ++= Seq(Provided.levelDBmultiJVM, Provided.levelDBNative, Test.junit, Test.scalatest.value, Test.commonsIo) + val clusterSharding = l ++= Seq( + Provided.levelDBmultiJVM, + Provided.levelDBNative, + Test.junit, + Test.scalatest.value, + Test.commonsIo) val clusterMetrics = l ++= Seq(Provided.sigarLoader, Test.slf4jJul, Test.slf4jLog4j, Test.logback, Test.mockito) @@ -180,17 +189,49 @@ object Dependencies { val agent = l ++= Seq(scalaStm.value, Test.scalatest.value, Test.junit) - val persistence = l ++= Seq(Provided.levelDB, Provided.levelDBNative, Test.scalatest.value, Test.junit, Test.commonsIo, Test.commonsCodec, Test.scalaXml) + val persistence = l ++= Seq( + Provided.levelDB, + Provided.levelDBNative, + Test.scalatest.value, + Test.junit, + Test.commonsIo, + Test.commonsCodec, + Test.scalaXml) - val persistenceQuery = l ++= Seq(Test.scalatest.value, Test.junit, Test.commonsIo, Provided.levelDB, Provided.levelDBNative) + val persistenceQuery = l ++= Seq( + Test.scalatest.value, + Test.junit, + Test.commonsIo, + Provided.levelDB, + Provided.levelDBNative) - val persistenceTck = l ++= Seq(Test.scalatest.value.withConfigurations(Some("compile")), Test.junit.withConfigurations(Some("compile")), Provided.levelDB, Provided.levelDBNative) + val persistenceTck = l ++= Seq( + Test.scalatest.value.withConfigurations(Some("compile")), + Test.junit.withConfigurations(Some("compile")), + Provided.levelDB, + Provided.levelDBNative) val persistenceShared = l ++= Seq(Provided.levelDB, Provided.levelDBNative) - val camel = l ++= Seq(camelCore, Provided.jaxb, Provided.activation, Test.scalatest.value, Test.junit, Test.mockito, Test.logback, Test.commonsIo) + val camel = l ++= Seq( + camelCore, + Provided.jaxb, + Provided.activation, + Test.scalatest.value, + Test.junit, + Test.mockito, + Test.logback, + Test.commonsIo) - val osgi = l ++= Seq(osgiCore, osgiCompendium, Test.logback, Test.commonsIo, Test.pojosr, Test.tinybundles, Test.scalatest.value, Test.junit) + val osgi = l ++= Seq( + osgiCore, + osgiCompendium, + Test.logback, + Test.commonsIo, + Test.pojosr, + Test.tinybundles, + Test.scalatest.value, + Test.junit) val docs = l ++= Seq(Test.scalatest.value, Test.junit, Docs.sprayJson, Docs.gson, Provided.levelDB) @@ -200,10 +241,7 @@ object Dependencies { // akka stream - lazy val stream = l ++= Seq[sbt.ModuleID]( - reactiveStreams, - sslConfigCore, - Test.scalatest.value) + lazy val stream = l ++= Seq[sbt.ModuleID](reactiveStreams, sslConfigCore, Test.scalatest.value) lazy val streamTestkit = l ++= Seq(Test.scalatest.value, Test.scalacheck.value, Test.junit) @@ -241,6 +279,6 @@ object DependencyHelpers { // 2.12.0 case version @ ScalaVersion() => version // transforms 2.12.0-custom-version to 2.12.0 - case version => version.takeWhile(_ != '-') + case version => version.takeWhile(_ != '-') } } diff --git a/project/scripts/release b/project/scripts/release index ee4cf7b139..4bc272b5c3 100755 --- a/project/scripts/release +++ b/project/scripts/release @@ -299,6 +299,7 @@ else RELEASE_OPT="-Dakka.genjavadoc.enabled=true" fi try sbt $RELEASE_OPT +buildRelease +try sbt -Dakka.build.scalaVersion=2.11.12 -D$RELEASE_OPT buildRelease try sbt $RELEASE_OPT buildDocs echolog "Successfully created local release"