Update Scala to 3.0.0 final, sbt to 1.5.2 (#30248)

Also: Migrate to sbt slash syntax
This commit is contained in:
Lukas Rytz 2021-05-25 12:50:51 +02:00 committed by GitHub
parent 49759617ab
commit aa03e8b089
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 145 additions and 148 deletions

View file

@ -112,16 +112,16 @@ lazy val root = Project(id = "akka", base = file("."))
akkaScalaNightly, akkaScalaNightly,
docs, docs,
serialversionRemoverPlugin)) serialversionRemoverPlugin))
.settings(unmanagedSources in (Compile, headerCreate) := (baseDirectory.value / "project").**("*.scala").get) .settings(Compile / headerCreate / unmanagedSources := (baseDirectory.value / "project").**("*.scala").get)
.enablePlugins(CopyrightHeaderForBuild) .enablePlugins(CopyrightHeaderForBuild)
lazy val actor = akkaModule("akka-actor") lazy val actor = akkaModule("akka-actor")
.settings(Dependencies.actor) .settings(Dependencies.actor)
.settings(OSGi.actor) .settings(OSGi.actor)
.settings(AutomaticModuleName.settings("akka.actor")) .settings(AutomaticModuleName.settings("akka.actor"))
.settings(unmanagedSourceDirectories in Compile += { .settings(Compile / unmanagedSourceDirectories += {
val ver = scalaVersion.value.take(4) val ver = scalaVersion.value.take(4)
(scalaSource in Compile).value.getParentFile / s"scala-$ver" (Compile / scalaSource).value.getParentFile / s"scala-$ver"
}) })
.settings(VersionGenerator.settings) .settings(VersionGenerator.settings)
.settings(serialversionRemoverPluginSettings) .settings(serialversionRemoverPluginSettings)
@ -158,7 +158,7 @@ lazy val cluster = akkaModule("akka-cluster")
.settings(AutomaticModuleName.settings("akka.cluster")) .settings(AutomaticModuleName.settings("akka.cluster"))
.settings(OSGi.cluster) .settings(OSGi.cluster)
.settings(Protobuf.settings) .settings(Protobuf.settings)
.settings(parallelExecution in Test := false) .settings(Test / parallelExecution := false)
.configs(MultiJvm) .configs(MultiJvm)
.enablePlugins(MultiNodeScalaTest) .enablePlugins(MultiNodeScalaTest)
@ -172,7 +172,7 @@ lazy val clusterMetrics = akkaModule("akka-cluster-metrics")
.settings(AutomaticModuleName.settings("akka.cluster.metrics")) .settings(AutomaticModuleName.settings("akka.cluster.metrics"))
.settings(Protobuf.settings) .settings(Protobuf.settings)
.settings(SigarLoader.sigarSettings) .settings(SigarLoader.sigarSettings)
.settings(parallelExecution in Test := false) .settings(Test / parallelExecution := false)
.configs(MultiJvm) .configs(MultiJvm)
.enablePlugins(MultiNodeScalaTest) .enablePlugins(MultiNodeScalaTest)
@ -283,7 +283,7 @@ lazy val osgi = akkaModule("akka-osgi")
.settings(Dependencies.osgi) .settings(Dependencies.osgi)
.settings(AutomaticModuleName.settings("akka.osgi")) .settings(AutomaticModuleName.settings("akka.osgi"))
.settings(OSGi.osgi) .settings(OSGi.osgi)
.settings(parallelExecution in Test := false) .settings(Test / parallelExecution := false)
lazy val persistence = akkaModule("akka-persistence") lazy val persistence = akkaModule("akka-persistence")
.dependsOn(actor, stream, testkit % "test->test") .dependsOn(actor, stream, testkit % "test->test")
@ -291,21 +291,21 @@ lazy val persistence = akkaModule("akka-persistence")
.settings(AutomaticModuleName.settings("akka.persistence")) .settings(AutomaticModuleName.settings("akka.persistence"))
.settings(OSGi.persistence) .settings(OSGi.persistence)
.settings(Protobuf.settings) .settings(Protobuf.settings)
.settings(fork in Test := true) .settings(Test / fork := true)
lazy val persistenceQuery = akkaModule("akka-persistence-query") lazy val persistenceQuery = akkaModule("akka-persistence-query")
.dependsOn(stream, persistence % "compile->compile;test->test", streamTestkit % "test") .dependsOn(stream, persistence % "compile->compile;test->test", streamTestkit % "test")
.settings(Dependencies.persistenceQuery) .settings(Dependencies.persistenceQuery)
.settings(AutomaticModuleName.settings("akka.persistence.query")) .settings(AutomaticModuleName.settings("akka.persistence.query"))
.settings(OSGi.persistenceQuery) .settings(OSGi.persistenceQuery)
.settings(fork in Test := true) .settings(Test / fork := true)
.enablePlugins(ScaladocNoVerificationOfDiagrams) .enablePlugins(ScaladocNoVerificationOfDiagrams)
lazy val persistenceShared = akkaModule("akka-persistence-shared") lazy val persistenceShared = akkaModule("akka-persistence-shared")
.dependsOn(persistence % "test->test", testkit % "test->test", remote % "test") .dependsOn(persistence % "test->test", testkit % "test->test", remote % "test")
.settings(Dependencies.persistenceShared) .settings(Dependencies.persistenceShared)
.settings(AutomaticModuleName.settings("akka.persistence.shared")) .settings(AutomaticModuleName.settings("akka.persistence.shared"))
.settings(fork in Test := true) .settings(Test / fork := true)
.enablePlugins(NoPublish) .enablePlugins(NoPublish)
.disablePlugins(MimaPlugin, WhiteSourcePlugin) .disablePlugins(MimaPlugin, WhiteSourcePlugin)
@ -314,7 +314,7 @@ lazy val persistenceTck = akkaModule("akka-persistence-tck")
.settings(Dependencies.persistenceTck) .settings(Dependencies.persistenceTck)
.settings(AutomaticModuleName.settings("akka.persistence.tck")) .settings(AutomaticModuleName.settings("akka.persistence.tck"))
//.settings(OSGi.persistenceTck) TODO: we do need to export this as OSGi bundle too? //.settings(OSGi.persistenceTck) TODO: we do need to export this as OSGi bundle too?
.settings(fork in Test := true) .settings(Test / fork := true)
.disablePlugins(MimaPlugin) .disablePlugins(MimaPlugin)
lazy val persistenceTestkit = akkaModule("akka-persistence-testkit") lazy val persistenceTestkit = akkaModule("akka-persistence-testkit")
@ -349,25 +349,25 @@ lazy val protobufV3 = akkaModule("akka-protobuf-v3")
.disablePlugins(MimaPlugin) .disablePlugins(MimaPlugin)
.settings( .settings(
libraryDependencies += Dependencies.Compile.Provided.protobufRuntime, libraryDependencies += Dependencies.Compile.Provided.protobufRuntime,
assemblyShadeRules in assembly := Seq( assembly / assemblyShadeRules := Seq(
ShadeRule ShadeRule
.rename("com.google.protobuf.**" -> "akka.protobufv3.internal.@1") .rename("com.google.protobuf.**" -> "akka.protobufv3.internal.@1")
// https://github.com/sbt/sbt-assembly/issues/400 // https://github.com/sbt/sbt-assembly/issues/400
.inLibrary(Dependencies.Compile.Provided.protobufRuntime) .inLibrary(Dependencies.Compile.Provided.protobufRuntime)
.inProject), .inProject),
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false, includeBin = false), assembly / assemblyOption := (assembly / assemblyOption).value.copy(includeScala = false, includeBin = false),
autoScalaLibrary := false, // do not include scala dependency in pom autoScalaLibrary := false, // do not include scala dependency in pom
exportJars := true, // in dependent projects, use assembled and shaded jar exportJars := true, // in dependent projects, use assembled and shaded jar
makePomConfiguration := makePomConfiguration.value makePomConfiguration := makePomConfiguration.value
.withConfigurations(Vector(Compile)), // prevent original dependency to be added to pom as runtime dep .withConfigurations(Vector(Compile)), // prevent original dependency to be added to pom as runtime dep
packagedArtifact in (Compile, packageBin) := Scoped.mkTuple2( Compile / packageBin / packagedArtifact := Scoped.mkTuple2(
(artifact in (Compile, packageBin)).value, (Compile / packageBin / artifact).value,
ReproducibleBuildsPlugin.postProcessJar(OsgiKeys.bundle.value)), ReproducibleBuildsPlugin.postProcessJar(OsgiKeys.bundle.value)),
packageBin in Compile := ReproducibleBuildsPlugin Compile / packageBin := ReproducibleBuildsPlugin
.postProcessJar((assembly in Compile).value), // package by running assembly .postProcessJar((Compile / assembly).value), // package by running assembly
// Prevent cyclic task dependencies, see https://github.com/sbt/sbt-assembly/issues/365 // Prevent cyclic task dependencies, see https://github.com/sbt/sbt-assembly/issues/365
fullClasspath in assembly := (managedClasspath in Runtime).value, // otherwise, there's a cyclic dependency between packageBin and assembly assembly / fullClasspath := (Runtime / managedClasspath).value, // otherwise, there's a cyclic dependency between packageBin and assembly
test in assembly := {}, // assembly runs tests for unknown reason which introduces another cyclic dependency to packageBin via exportedJars assembly / test := {}, // assembly runs tests for unknown reason which introduces another cyclic dependency to packageBin via exportedJars
description := "Akka Protobuf V3 is a shaded version of the protobuf runtime. Original POM: https://github.com/protocolbuffers/protobuf/blob/v3.9.0/java/pom.xml") description := "Akka Protobuf V3 is a shaded version of the protobuf runtime. Original POM: https://github.com/protocolbuffers/protobuf/blob/v3.9.0/java/pom.xml")
lazy val pki = lazy val pki =
@ -393,7 +393,7 @@ lazy val remote =
.settings(AutomaticModuleName.settings("akka.remote")) .settings(AutomaticModuleName.settings("akka.remote"))
.settings(OSGi.remote) .settings(OSGi.remote)
.settings(Protobuf.settings) .settings(Protobuf.settings)
.settings(parallelExecution in Test := false) .settings(Test / parallelExecution := false)
.enablePlugins(Jdk9) .enablePlugins(Jdk9)
lazy val remoteTests = akkaModule("akka-remote-tests") lazy val remoteTests = akkaModule("akka-remote-tests")
@ -405,7 +405,7 @@ lazy val remoteTests = akkaModule("akka-remote-tests")
jackson % "test->test") jackson % "test->test")
.settings(Dependencies.remoteTests) .settings(Dependencies.remoteTests)
.settings(Protobuf.settings) .settings(Protobuf.settings)
.settings(parallelExecution in Test := false) .settings(Test / parallelExecution := false)
.configs(MultiJvm) .configs(MultiJvm)
.enablePlugins(MultiNodeScalaTest, NoPublish) .enablePlugins(MultiNodeScalaTest, NoPublish)
.disablePlugins(MimaPlugin, WhiteSourcePlugin) .disablePlugins(MimaPlugin, WhiteSourcePlugin)
@ -445,7 +445,7 @@ lazy val streamTestsTck = akkaModule("akka-stream-tests-tck")
// is causing long GC pauses when running with G1 on // is causing long GC pauses when running with G1 on
// the CI build servers. Therefore we fork these tests // the CI build servers. Therefore we fork these tests
// to run with small heap without G1. // to run with small heap without G1.
fork in Test := true) Test / fork := true)
.enablePlugins(NoPublish) .enablePlugins(NoPublish)
.disablePlugins(MimaPlugin, WhiteSourcePlugin) .disablePlugins(MimaPlugin, WhiteSourcePlugin)
@ -581,14 +581,14 @@ lazy val serialversionRemoverPlugin =
scalaVersion := akka.Dependencies.scala3Version, scalaVersion := akka.Dependencies.scala3Version,
libraryDependencies += ("org.scala-lang" %% "scala3-compiler" % akka.Dependencies.scala3Version), libraryDependencies += ("org.scala-lang" %% "scala3-compiler" % akka.Dependencies.scala3Version),
Compile / doc / sources := Nil, Compile / doc / sources := Nil,
publishArtifact in Compile := false) Compile / publishArtifact := false)
lazy val serialversionRemoverPluginSettings = { lazy val serialversionRemoverPluginSettings = {
if (akka.Dependencies.getScalaVersion() == akka.Dependencies.scala3Version) { if (akka.Dependencies.getScalaVersion() == akka.Dependencies.scala3Version) {
Seq( Seq(
autoCompilerPlugins := true, autoCompilerPlugins := true,
scalacOptions in Compile += ( Compile / scalacOptions += (
"-Xplugin:" + (Keys.`package` in (serialversionRemoverPlugin, Compile)).value.getAbsolutePath.toString "-Xplugin:" + (serialversionRemoverPlugin / Compile / Keys.`package`).value.getAbsolutePath.toString
)) ))
} else { } else {
Seq() Seq()

View file

@ -30,7 +30,7 @@ object AkkaBuild {
lazy val rootSettings = Def.settings( lazy val rootSettings = Def.settings(
UnidocRoot.akkaSettings, UnidocRoot.akkaSettings,
Protobuf.settings, Protobuf.settings,
parallelExecution in GlobalScope := System GlobalScope / parallelExecution := System
.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString) .getProperty("akka.parallelExecution", parallelExecutionByDefault.toString)
.toBoolean, .toBoolean,
// used for linking to API docs (overwrites `project-info.version`) // used for linking to API docs (overwrites `project-info.version`)
@ -68,7 +68,7 @@ object AkkaBuild {
ivyConfigurations.value.map(c => ConfigRef(c.name)).toVector, ivyConfigurations.value.map(c => ConfigRef(c.name)).toVector,
artifacts = packagedArtifacts.value.toVector, artifacts = packagedArtifacts.value.toVector,
resolverName = resolver.name, resolverName = resolver.name,
checksums = checksums.in(publishM2).value.toVector, checksums = (publishM2 / checksums).value.toVector,
logging = ivyLoggingLevel.value, logging = ivyLoggingLevel.value,
overwrite = true))) overwrite = true)))
} }
@ -115,22 +115,22 @@ object AkkaBuild {
resolverSettings, resolverSettings,
TestExtras.Filter.settings, TestExtras.Filter.settings,
// compile options // compile options
scalacOptions in Compile ++= DefaultScalacOptions, Compile / scalacOptions ++= DefaultScalacOptions,
scalacOptions in Compile ++= Compile / scalacOptions ++=
JdkOptions.targetJdkScalacOptions(targetSystemJdk.value, optionalDir(jdk8home.value), fullJavaHomes.value), JdkOptions.targetJdkScalacOptions(targetSystemJdk.value, optionalDir(jdk8home.value), fullJavaHomes.value),
scalacOptions in Compile ++= (if (allWarnings) Seq("-deprecation") else Nil), Compile / scalacOptions ++= (if (allWarnings) Seq("-deprecation") else Nil),
scalacOptions in Test := (scalacOptions in Test).value.filterNot(opt => Test / scalacOptions := (Test / scalacOptions).value.filterNot(opt =>
opt == "-Xlog-reflective-calls" || opt.contains("genjavadoc")), opt == "-Xlog-reflective-calls" || opt.contains("genjavadoc")),
javacOptions in Compile ++= { Compile / javacOptions ++= {
DefaultJavacOptions ++ DefaultJavacOptions ++
JdkOptions.targetJdkJavacOptions(targetSystemJdk.value, optionalDir(jdk8home.value), fullJavaHomes.value) JdkOptions.targetJdkJavacOptions(targetSystemJdk.value, optionalDir(jdk8home.value), fullJavaHomes.value)
}, },
javacOptions in Test ++= DefaultJavacOptions ++ Test / javacOptions ++= DefaultJavacOptions ++
JdkOptions.targetJdkJavacOptions(targetSystemJdk.value, optionalDir(jdk8home.value), fullJavaHomes.value), JdkOptions.targetJdkJavacOptions(targetSystemJdk.value, optionalDir(jdk8home.value), fullJavaHomes.value),
javacOptions in Compile ++= (if (allWarnings) Seq("-Xlint:deprecation") else Nil), Compile / javacOptions ++= (if (allWarnings) Seq("-Xlint:deprecation") else Nil),
javacOptions in doc := Seq(), doc / javacOptions := Seq(),
crossVersion := CrossVersion.binary, crossVersion := CrossVersion.binary,
ivyLoggingLevel in ThisBuild := UpdateLogging.Quiet, ThisBuild / ivyLoggingLevel := UpdateLogging.Quiet,
licenses := Seq(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html"))), licenses := Seq(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html"))),
homepage := Some(url("https://akka.io/")), homepage := Some(url("https://akka.io/")),
description := "Akka is a toolkit for building highly concurrent, distributed, and resilient message-driven applications for Java and Scala.", description := "Akka is a toolkit for building highly concurrent, distributed, and resilient message-driven applications for Java and Scala.",
@ -158,9 +158,9 @@ object AkkaBuild {
/** /**
* Test settings * Test settings
*/ */
fork in Test := true, Test / fork := true,
// default JVM config for tests // default JVM config for tests
javaOptions in Test ++= { Test / javaOptions ++= {
val defaults = Seq( val defaults = Seq(
// ## core memory settings // ## core memory settings
"-XX:+UseG1GC", "-XX:+UseG1GC",
@ -187,8 +187,8 @@ object AkkaBuild {
defaults defaults
}, },
// all system properties passed to sbt prefixed with "akka." will be passed on to the forked jvms as is // all system properties passed to sbt prefixed with "akka." will be passed on to the forked jvms as is
javaOptions in Test := { Test / javaOptions := {
val base = (javaOptions in Test).value val base = (Test / javaOptions).value
val akkaSysProps: Seq[String] = val akkaSysProps: Seq[String] =
sys.props.filter(_._1.startsWith("akka")).map { case (key, value) => s"-D$key=$value" }(breakOut) sys.props.filter(_._1.startsWith("akka")).map { case (key, value) => s"-D$key=$value" }(breakOut)
@ -196,8 +196,8 @@ object AkkaBuild {
}, },
// with forked tests the working directory is set to each module's home directory // with forked tests the working directory is set to each module's home directory
// rather than the Akka root, some tests depend on Akka root being working dir, so reset // rather than the Akka root, some tests depend on Akka root being working dir, so reset
testGrouping in Test := { Test / testGrouping := {
val original: Seq[Tests.Group] = (testGrouping in Test).value val original: Seq[Tests.Group] = (Test / testGrouping).value
original.map { group => original.map { group =>
group.runPolicy match { group.runPolicy match {
@ -210,12 +210,12 @@ object AkkaBuild {
} }
} }
}, },
parallelExecution in Test := System Test / parallelExecution := System
.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString) .getProperty("akka.parallelExecution", parallelExecutionByDefault.toString)
.toBoolean, .toBoolean,
logBuffered in Test := System.getProperty("akka.logBufferedTests", "false").toBoolean, Test / logBuffered := System.getProperty("akka.logBufferedTests", "false").toBoolean,
// show full stack traces and test case durations // show full stack traces and test case durations
testOptions in Test += Tests.Argument("-oDF"), Test / testOptions += Tests.Argument("-oDF"),
mavenLocalResolverSettings, mavenLocalResolverSettings,
docLintingSettings, docLintingSettings,
JdkOptions.targetJdkSettings, JdkOptions.targetJdkSettings,
@ -238,9 +238,9 @@ object AkkaBuild {
} }
lazy val docLintingSettings = Seq( lazy val docLintingSettings = Seq(
javacOptions in compile ++= Seq("-Xdoclint:none"), compile / javacOptions ++= Seq("-Xdoclint:none"),
javacOptions in test ++= Seq("-Xdoclint:none"), test / javacOptions ++= Seq("-Xdoclint:none"),
javacOptions in doc ++= { doc / javacOptions ++= {
if (JdkOptions.isJdk8) Seq("-Xdoclint:none") if (JdkOptions.isJdk8) Seq("-Xdoclint:none")
else Seq("-Xdoclint:none", "--ignore-source-errors") else Seq("-Xdoclint:none", "--ignore-source-errors")
}) })

View file

@ -106,7 +106,7 @@ object AkkaDisciplinePlugin extends AutoPlugin {
else Seq.empty else Seq.empty
} }
), ),
Compile / javacOptions in doc := Seq("-Xdoclint:none"), Compile / doc / javacOptions := Seq("-Xdoclint:none"),
Compile / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match { Compile / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => case Some((2, 13)) =>
disciplineScalacOptions -- Set( disciplineScalacOptions -- Set(

View file

@ -19,5 +19,5 @@ object AutomaticModuleName {
private val AutomaticModuleName = "Automatic-Module-Name" private val AutomaticModuleName = "Automatic-Module-Name"
def settings(name: String): Seq[Def.Setting[Task[Seq[PackageOption]]]] = def settings(name: String): Seq[Def.Setting[Task[Seq[PackageOption]]]] =
Seq(packageOptions in (Compile, packageBin) += Package.ManifestAttributes(AutomaticModuleName -> name)) Seq(Compile / packageBin / packageOptions += Package.ManifestAttributes(AutomaticModuleName -> name))
} }

View file

@ -31,12 +31,12 @@ trait CopyrightHeader extends AutoPlugin {
override def projectSettings: Seq[Def.Setting[_]] = Def.settings(headerMappingSettings, additional) override def projectSettings: Seq[Def.Setting[_]] = Def.settings(headerMappingSettings, additional)
def additional: Seq[Def.Setting[_]] = def additional: Seq[Def.Setting[_]] =
Def.settings((compile in Compile) := { Def.settings(Compile / compile := {
(headerCreate in Compile).value (Compile / headerCreate).value
(compile in Compile).value (Compile / compile).value
}, (compile in Test) := { }, Test / compile := {
(headerCreate in Test).value (Test / headerCreate).value
(compile in Test).value (Test / compile).value
}) })
// We hard-code this so PR's created in year X will not suddenly fail in X+1. // We hard-code this so PR's created in year X will not suddenly fail in X+1.
@ -101,5 +101,5 @@ object CopyrightHeader extends CopyrightHeader
object CopyrightHeaderInPr extends CopyrightHeader { object CopyrightHeaderInPr extends CopyrightHeader {
override val additional = override val additional =
Def.settings(additionalTasks += headerCheck in Compile, additionalTasks += headerCheck in Test) Def.settings(additionalTasks += Compile / headerCheck, additionalTasks += Test / headerCheck)
} }

View file

@ -18,8 +18,8 @@ object CopyrightHeaderForBoilerplate extends CopyrightHeader {
Seq(Compile, Test).flatMap { config => Seq(Compile, Test).flatMap { config =>
inConfig(config) { inConfig(config) {
Seq( Seq(
headerSources in config ++= config / headerSources ++=
(((sourceDirectory in config).value / "boilerplate") ** "*.template").get, (((config / sourceDirectory).value / "boilerplate") ** "*.template").get,
headerMappings := headerMappings.value ++ Map(HeaderFileType("template") -> cStyleComment)) headerMappings := headerMappings.value ++ Map(HeaderFileType("template") -> cStyleComment))
} }
} }

View file

@ -15,7 +15,7 @@ object CopyrightHeaderForBuild extends CopyrightHeader {
Seq(Compile, Test).flatMap { config => Seq(Compile, Test).flatMap { config =>
inConfig(config) { inConfig(config) {
Seq( Seq(
headerSources in config ++= (((baseDirectory in config).value / "project") ** "*.scala").get, config / headerSources ++= (((config / baseDirectory).value / "project") ** "*.scala").get,
headerMappings := headerMappings.value ++ Map(HeaderFileType.scala -> cStyleComment)) headerMappings := headerMappings.value ++ Map(HeaderFileType.scala -> cStyleComment))
} }
} }

View file

@ -14,13 +14,13 @@ object CopyrightHeaderForJdk9 extends CopyrightHeader {
super.headerMappingSettings super.headerMappingSettings
import Jdk9._ import Jdk9._
Seq( Seq(
headerSources in Compile ++= Compile / headerSources ++=
(((sourceDirectory in Compile).value / SCALA_SOURCE_DIRECTORY) ** "*.scala").get, (((Compile / sourceDirectory).value / SCALA_SOURCE_DIRECTORY) ** "*.scala").get,
headerSources in Test ++= Test / headerSources ++=
(((sourceDirectory in Test).value / SCALA_TEST_SOURCE_DIRECTORY) ** "*.scala").get, (((Test / sourceDirectory).value / SCALA_TEST_SOURCE_DIRECTORY) ** "*.scala").get,
headerSources in Compile ++= Compile / headerSources ++=
(((sourceDirectory in Compile).value / JAVA_SOURCE_DIRECTORY) ** "*.java").get, (((Compile / sourceDirectory).value / JAVA_SOURCE_DIRECTORY) ** "*.java").get,
headerSources in Test ++= Test / headerSources ++=
(((sourceDirectory in Test).value / JAVA_TEST_SOURCE_DIRECTORY) ** "*.java").get) (((Test / sourceDirectory).value / JAVA_TEST_SOURCE_DIRECTORY) ** "*.java").get)
} }
} }

View file

@ -14,8 +14,8 @@ object CopyrightHeaderForProtobuf extends CopyrightHeader {
Seq(Compile, Test).flatMap { config => Seq(Compile, Test).flatMap { config =>
inConfig(config) { inConfig(config) {
Seq( Seq(
headerSources in config ++= config / headerSources ++=
(((sourceDirectory in config).value / "protobuf") ** "*.proto").get, (((config / sourceDirectory).value / "protobuf") ** "*.proto").get,
headerMappings := headerMappings.value ++ Map(HeaderFileType("proto") -> cStyleComment)) headerMappings := headerMappings.value ++ Map(HeaderFileType("proto") -> cStyleComment))
} }
} }

View file

@ -7,12 +7,12 @@ package akka
import sbt._ import sbt._
import Keys._ import Keys._
import scala.language.implicitConversions import scala.language.implicitConversions
import dotty.tools.sbtplugin.DottyPlugin.autoImport.DottyCompatModuleID
object Dependencies { object Dependencies {
import DependencyHelpers._ import DependencyHelpers._
lazy val java8CompatVersion = settingKey[String]("The version of scala-java8-compat to use.") lazy val java8CompatVersion = settingKey[String]("The version of scala-java8-compat to use.")
.withRank(KeyRanks.Invisible) // avoid 'unused key' warning
val junitVersion = "4.13.2" val junitVersion = "4.13.2"
val slf4jVersion = "1.7.30" val slf4jVersion = "1.7.30"
@ -29,7 +29,7 @@ object Dependencies {
val scala212Version = "2.12.13" val scala212Version = "2.12.13"
val scala213Version = "2.13.5" val scala213Version = "2.13.5"
val scala3Version = "3.0.0-RC1" val scala3Version = "3.0.0"
val reactiveStreamsVersion = "1.0.3" val reactiveStreamsVersion = "1.0.3"
@ -37,7 +37,7 @@ object Dependencies {
val scalaTestVersion = { val scalaTestVersion = {
if (getScalaVersion().startsWith("3.0")) { if (getScalaVersion().startsWith("3.0")) {
"3.2.6" "3.2.9"
} else { } else {
"3.1.4" "3.1.4"
} }
@ -99,8 +99,7 @@ object Dependencies {
val reactiveStreams = "org.reactivestreams" % "reactive-streams" % reactiveStreamsVersion // CC0 val reactiveStreams = "org.reactivestreams" % "reactive-streams" % reactiveStreamsVersion // CC0
// ssl-config // ssl-config
val sslConfigCore = DottyCompatModuleID("com.typesafe" %% "ssl-config-core" % sslConfigVersion) val sslConfigCore = ("com.typesafe" %% "ssl-config-core" % sslConfigVersion).cross(CrossVersion.for3Use2_13) // ApacheV2
.withDottyCompat(getScalaVersion()) // ApacheV2
val lmdb = "org.lmdbjava" % "lmdbjava" % "0.7.0" // ApacheV2, OpenLDAP Public License val lmdb = "org.lmdbjava" % "lmdbjava" % "0.7.0" // ApacheV2, OpenLDAP Public License
@ -108,8 +107,7 @@ object Dependencies {
// For Java 8 Conversions // For Java 8 Conversions
val java8Compat = Def.setting { val java8Compat = Def.setting {
DottyCompatModuleID("org.scala-lang.modules" %% "scala-java8-compat" % java8CompatVersion.value) ("org.scala-lang.modules" %% "scala-java8-compat" % java8CompatVersion.value).cross(CrossVersion.for3Use2_13)
.withDottyCompat(getScalaVersion())
} // Scala License } // Scala License
val aeronDriver = "io.aeron" % "aeron-driver" % aeronVersion // ApacheV2 val aeronDriver = "io.aeron" % "aeron-driver" % aeronVersion // ApacheV2

View file

@ -31,14 +31,14 @@ object Scaladoc extends AutoPlugin {
override lazy val projectSettings = { override lazy val projectSettings = {
inTask(doc)( inTask(doc)(
Seq( Seq(
scalacOptions in Compile ++= scaladocOptions(version.value, (baseDirectory in ThisBuild).value), Compile / scalacOptions ++= scaladocOptions(version.value, (ThisBuild / baseDirectory).value),
// -release caused build failures when generating javadoc: // -release caused build failures when generating javadoc:
scalacOptions in Compile --= Seq("-release", "8"), Compile / scalacOptions --= Seq("-release", "8"),
autoAPIMappings := CliOptions.scaladocAutoAPI.get)) ++ autoAPIMappings := CliOptions.scaladocAutoAPI.get)) ++
Seq(validateDiagrams in Compile := true) ++ Seq(Compile / validateDiagrams := true) ++
CliOptions.scaladocDiagramsEnabled.ifTrue(doc in Compile := { CliOptions.scaladocDiagramsEnabled.ifTrue(Compile / doc := {
val docs = (doc in Compile).value val docs = (Compile / doc).value
if ((validateDiagrams in Compile).value) if ((Compile / validateDiagrams).value)
scaladocVerifier(docs) scaladocVerifier(docs)
docs docs
}) })
@ -109,7 +109,7 @@ object ScaladocNoVerificationOfDiagrams extends AutoPlugin {
override def trigger = noTrigger override def trigger = noTrigger
override def requires = Scaladoc override def requires = Scaladoc
override lazy val projectSettings = Seq(Scaladoc.validateDiagrams in Compile := false) override lazy val projectSettings = Seq(Compile / Scaladoc.validateDiagrams := false)
} }
/** /**
@ -134,7 +134,7 @@ object UnidocRoot extends AutoPlugin {
val akkaSettings = UnidocRoot.CliOptions.genjavadocEnabled val akkaSettings = UnidocRoot.CliOptions.genjavadocEnabled
.ifTrue(Seq( .ifTrue(Seq(
javacOptions in (JavaUnidoc, unidoc) := { JavaUnidoc / unidoc / javacOptions := {
if (JdkOptions.isJdk8) Seq("-Xdoclint:none") if (JdkOptions.isJdk8) Seq("-Xdoclint:none")
else Seq("-Xdoclint:none", "--ignore-source-errors", "--no-module-directories") else Seq("-Xdoclint:none", "--ignore-source-errors", "--no-module-directories")
}, },
@ -153,15 +153,15 @@ object UnidocRoot extends AutoPlugin {
inTask(unidoc)( inTask(unidoc)(
Seq( Seq(
unidocProjectFilter in ScalaUnidoc := unidocRootProjectFilter(unidocRootIgnoreProjects.value), ScalaUnidoc / unidocProjectFilter := unidocRootProjectFilter(unidocRootIgnoreProjects.value),
unidocProjectFilter in JavaUnidoc := unidocRootProjectFilter(unidocRootIgnoreProjects.value), JavaUnidoc / unidocProjectFilter := unidocRootProjectFilter(unidocRootIgnoreProjects.value),
apiMappings in ScalaUnidoc := (apiMappings in (Compile, doc)).value) ++ ScalaUnidoc / apiMappings := (Compile / doc / apiMappings).value) ++
UnidocRoot.CliOptions.genjavadocEnabled UnidocRoot.CliOptions.genjavadocEnabled
.ifTrue( .ifTrue(
Seq( Seq(
// akka.stream.scaladsl.GraphDSL.Implicits.ReversePortsOps contains code that // akka.stream.scaladsl.GraphDSL.Implicits.ReversePortsOps contains code that
// genjavadoc turns into (probably incorrect) Java code that in turn confuses the javadoc tool. // genjavadoc turns into (probably incorrect) Java code that in turn confuses the javadoc tool.
unidocAllSources in JavaUnidoc ~= { v => JavaUnidoc / unidocAllSources ~= { v =>
v.map(_.filterNot(_.getAbsolutePath.endsWith("scaladsl/GraphDSL.java"))) v.map(_.filterNot(_.getAbsolutePath.endsWith("scaladsl/GraphDSL.java")))
})) }))
.getOrElse(Nil)) .getOrElse(Nil))
@ -186,6 +186,6 @@ object BootstrapGenjavadoc extends AutoPlugin {
override lazy val projectSettings = UnidocRoot.CliOptions.genjavadocEnabled override lazy val projectSettings = UnidocRoot.CliOptions.genjavadocEnabled
.ifTrue(Seq( .ifTrue(Seq(
unidocGenjavadocVersion := "0.17", unidocGenjavadocVersion := "0.17",
scalacOptions in Compile ++= Seq("-P:genjavadoc:fabricateParams=false", "-P:genjavadoc:suppressSynthetic=false"))) Compile / scalacOptions ++= Seq("-P:genjavadoc:fabricateParams=false", "-P:genjavadoc:suppressSynthetic=false")))
.getOrElse(Nil) .getOrElse(Nil)
} }

View file

@ -25,11 +25,11 @@ object JavaFormatter extends AutoPlugin {
override def projectSettings: Seq[Def.Setting[_]] = override def projectSettings: Seq[Def.Setting[_]] =
Seq( Seq(
//below is for sbt java formatter //below is for sbt java formatter
(excludeFilter in javafmt) := { javafmt / excludeFilter := {
val ignoreSupport = val ignoreSupport =
new ProjectFileIgnoreSupport((baseDirectory in ThisBuild).value / ignoreConfigFileName, descriptor) new ProjectFileIgnoreSupport((ThisBuild / baseDirectory).value / ignoreConfigFileName, descriptor)
val simpleFileFilter = new SimpleFileFilter(file => ignoreSupport.isIgnoredByFileOrPackages(file)) val simpleFileFilter = new SimpleFileFilter(file => ignoreSupport.isIgnoredByFileOrPackages(file))
simpleFileFilter || (excludeFilter in javafmt).value simpleFileFilter || (javafmt / excludeFilter).value
}, },
javafmtOnCompile := formatOnCompile) javafmtOnCompile := formatOnCompile)
} }

View file

@ -38,7 +38,7 @@ object Jdk9 extends AutoPlugin {
javacOptions := AkkaBuild.DefaultJavacOptions ++ notOnJdk8(Seq("--release", "11")), javacOptions := AkkaBuild.DefaultJavacOptions ++ notOnJdk8(Seq("--release", "11")),
compile := compile.dependsOn(CompileJdk9 / compile).value, compile := compile.dependsOn(CompileJdk9 / compile).value,
classpathConfiguration := TestJdk9, classpathConfiguration := TestJdk9,
externalDependencyClasspath := (externalDependencyClasspath in Test).value) externalDependencyClasspath := (Test / externalDependencyClasspath).value)
val compileSettings = Seq( val compileSettings = Seq(
// It might have been more 'neat' to add the jdk9 products to the jar via packageBin/mappings, but that doesn't work with the OSGi plugin, // It might have been more 'neat' to add the jdk9 products to the jar via packageBin/mappings, but that doesn't work with the OSGi plugin,

View file

@ -37,7 +37,7 @@ object JdkOptions extends AutoPlugin {
targetSystemJdk, targetSystemJdk,
jdk8home, jdk8home,
fullJavaHomes, fullJavaHomes,
Seq("-target:jvm-1.8"), Seq(if (Dependencies.getScalaVersion().startsWith("3.0")) "-Xtarget:8" else "-target:jvm-1.8"),
// '-release 8' is not enough, for some reason we need the 8 rt.jar // '-release 8' is not enough, for some reason we need the 8 rt.jar
// explicitly. To test whether this has the desired effect, compile // explicitly. To test whether this has the desired effect, compile
// akka-remote and check the invocation of 'ByteBuffer.clear()' in // akka-remote and check the invocation of 'ByteBuffer.clear()' in

View file

@ -37,8 +37,8 @@ object MultiNode extends AutoPlugin {
} }
val multiExecuteTests = val multiExecuteTests =
CliOptions.multiNode.ifTrue(multiNodeExecuteTests in MultiJvm).getOrElse(executeTests in MultiJvm) CliOptions.multiNode.ifTrue(MultiJvm / multiNodeExecuteTests).getOrElse(MultiJvm / executeTests)
val multiTest = CliOptions.multiNode.ifTrue(multiNodeTest in MultiJvm).getOrElse(test in MultiJvm) val multiTest = CliOptions.multiNode.ifTrue(MultiJvm / multiNodeTest).getOrElse(MultiJvm / test)
override def trigger = noTrigger override def trigger = noTrigger
override def requires = plugins.JvmPlugin override def requires = plugins.JvmPlugin
@ -70,17 +70,17 @@ object MultiNode extends AutoPlugin {
inConfig(MultiJvm)(scalafmtConfigSettings) ++ inConfig(MultiJvm)(scalafmtConfigSettings) ++
Seq( Seq(
// Hack because 'provided' dependencies by default are not picked up by the multi-jvm plugin: // Hack because 'provided' dependencies by default are not picked up by the multi-jvm plugin:
managedClasspath in MultiJvm ++= (managedClasspath in Compile).value.filter(_.data.name.contains("silencer-lib")), MultiJvm / managedClasspath ++= (Compile / managedClasspath).value.filter(_.data.name.contains("silencer-lib")),
jvmOptions in MultiJvm := defaultMultiJvmOptions, MultiJvm / jvmOptions := defaultMultiJvmOptions,
scalacOptions in MultiJvm := (scalacOptions in Test).value, MultiJvm / scalacOptions := (Test / scalacOptions).value,
logLevel in multiJvmCreateLogger := Level.Debug, // to see ssh establishment multiJvmCreateLogger / logLevel := Level.Debug, // to see ssh establishment
assemblyMergeStrategy in assembly in MultiJvm := { MultiJvm / assembly / assemblyMergeStrategy := {
case n if n.endsWith("logback-test.xml") => MergeStrategy.first case n if n.endsWith("logback-test.xml") => MergeStrategy.first
case n if n.toLowerCase.matches("meta-inf.*\\.default") => MergeStrategy.first case n if n.toLowerCase.matches("meta-inf.*\\.default") => MergeStrategy.first
case n => (assemblyMergeStrategy in assembly in MultiJvm).value.apply(n) case n => (MultiJvm / assembly / assemblyMergeStrategy).value.apply(n)
}, },
multiJvmCreateLogger in MultiJvm := { // to use normal sbt logging infra instead of custom sbt-multijvm-one MultiJvm / multiJvmCreateLogger := { // to use normal sbt logging infra instead of custom sbt-multijvm-one
val previous = (multiJvmCreateLogger in MultiJvm).value val previous = (MultiJvm / multiJvmCreateLogger).value
val logger = streams.value.log val logger = streams.value.log
(name: String) => (name: String) =>
new Logger { new Logger {
@ -90,14 +90,14 @@ object MultiNode extends AutoPlugin {
logger.log(level, s"[${scala.Console.BLUE}$name${scala.Console.RESET}] $message") logger.log(level, s"[${scala.Console.BLUE}$name${scala.Console.RESET}] $message")
} }
}) ++ }) ++
CliOptions.hostsFileName.map(multiNodeHostsFileName in MultiJvm := _) ++ CliOptions.hostsFileName.map(MultiJvm / multiNodeHostsFileName := _) ++
CliOptions.javaName.map(multiNodeJavaName in MultiJvm := _) ++ CliOptions.javaName.map(MultiJvm / multiNodeJavaName := _) ++
CliOptions.targetDirName.map(multiNodeTargetDirName in MultiJvm := _) ++ CliOptions.targetDirName.map(MultiJvm / multiNodeTargetDirName := _) ++
(if (multiNodeTestInTest) { (if (multiNodeTestInTest) {
// make sure that MultiJvm tests are executed by the default test target, // make sure that MultiJvm tests are executed by the default test target,
// and combine the results from ordinary test and multi-jvm tests // and combine the results from ordinary test and multi-jvm tests
(executeTests in Test) := { (Test / executeTests) := {
val testResults = (executeTests in Test).value val testResults = (Test / executeTests).value
val multiNodeResults = multiExecuteTests.value val multiNodeResults = multiExecuteTests.value
val overall = val overall =
if (testResults.overall.id < multiNodeResults.overall.id) if (testResults.overall.id < multiNodeResults.overall.id)
@ -111,9 +111,9 @@ object MultiNode extends AutoPlugin {
testResults.summaries ++ multiNodeResults.summaries) testResults.summaries ++ multiNodeResults.summaries)
} }
} else Nil) ++ } else Nil) ++
Def.settings((compile in MultiJvm) := { Def.settings((MultiJvm / compile) := {
(headerCreate in MultiJvm).value (MultiJvm / headerCreate).value
(compile in MultiJvm).value (MultiJvm / compile).value
}) ++ headerSettings(MultiJvm) ++ Seq(validateCompile := compile.?.all(anyConfigsInThisProject).value) }) ++ headerSettings(MultiJvm) ++ Seq(validateCompile := compile.?.all(anyConfigsInThisProject).value)
implicit class TestResultOps(val self: TestResult) extends AnyVal { implicit class TestResultOps(val self: TestResult) extends AnyVal {
@ -134,11 +134,11 @@ object MultiNodeScalaTest extends AutoPlugin {
override lazy val projectSettings = override lazy val projectSettings =
Seq( Seq(
extraOptions in MultiJvm := { MultiJvm / extraOptions := {
val src = (sourceDirectory in MultiJvm).value val src = (MultiJvm / sourceDirectory).value
(name: String) => (src ** (name + ".conf")).get.headOption.map("-Dakka.config=" + _.absolutePath).toSeq (name: String) => (src ** (name + ".conf")).get.headOption.map("-Dakka.config=" + _.absolutePath).toSeq
}, },
scalatestOptions in MultiJvm := { MultiJvm / scalatestOptions := {
Seq("-C", "org.scalatest.extra.QuietReporter") ++ Seq("-C", "org.scalatest.extra.QuietReporter") ++
(if (excludeTestTags.value.isEmpty) Seq.empty (if (excludeTestTags.value.isEmpty) Seq.empty
else else

View file

@ -42,9 +42,9 @@ object Paradox {
"algolia.docsearch.index_name" -> "akka_io", "algolia.docsearch.index_name" -> "akka_io",
"google.analytics.account" -> "UA-21117439-1", "google.analytics.account" -> "UA-21117439-1",
"google.analytics.domain.name" -> "akka.io", "google.analytics.domain.name" -> "akka.io",
"signature.akka.base_dir" -> (baseDirectory in ThisBuild).value.getAbsolutePath, "signature.akka.base_dir" -> (ThisBuild / baseDirectory).value.getAbsolutePath,
"fiddle.code.base_dir" -> (sourceDirectory in Test).value.getAbsolutePath, "fiddle.code.base_dir" -> (Test / sourceDirectory).value.getAbsolutePath,
"fiddle.akka.base_dir" -> (baseDirectory in ThisBuild).value.getAbsolutePath, "fiddle.akka.base_dir" -> (ThisBuild / baseDirectory).value.getAbsolutePath,
"aeron_version" -> Dependencies.aeronVersion, "aeron_version" -> Dependencies.aeronVersion,
"netty_version" -> Dependencies.nettyVersion, "netty_version" -> Dependencies.nettyVersion,
"logback_version" -> Dependencies.logbackVersion)) "logback_version" -> Dependencies.logbackVersion))
@ -75,7 +75,7 @@ object Paradox {
includesSettings ++ includesSettings ++
groupsSettings ++ groupsSettings ++
Seq( Seq(
name in (Compile, paradox) := "Akka", Compile / paradox / name := "Akka",
resolvers += Resolver.jcenterRepo, resolvers += Resolver.jcenterRepo,
ApidocPlugin.autoImport.apidocRootPackage := "akka", ApidocPlugin.autoImport.apidocRootPackage := "akka",
publishRsyncArtifacts += { publishRsyncArtifacts += {

View file

@ -21,7 +21,7 @@ object ParadoxBrowse extends AutoPlugin {
override lazy val projectSettings = Seq(paradoxBrowse := { override lazy val projectSettings = Seq(paradoxBrowse := {
import java.awt.Desktop import java.awt.Desktop
val rootDocFile = (paradox in Compile).value / "index.html" val rootDocFile = (Compile / paradox).value / "index.html"
val log = streams.value.log val log = streams.value.log
if (Desktop.isDesktopSupported) Desktop.getDesktop.open(rootDocFile) if (Desktop.isDesktopSupported) Desktop.getDesktop.open(rootDocFile)
else log.info(s"Couldn't open default browser, but docs are at $rootDocFile") else log.info(s"Couldn't open default browser, but docs are at $rootDocFile")

View file

@ -27,8 +27,8 @@ object Protobuf {
val generate = TaskKey[Unit]("protobuf-generate", "Compile the protobuf sources and do all processing.") val generate = TaskKey[Unit]("protobuf-generate", "Compile the protobuf sources and do all processing.")
lazy val settings: Seq[Setting[_]] = Seq( lazy val settings: Seq[Setting[_]] = Seq(
paths := Seq((sourceDirectory in Compile).value, (sourceDirectory in Test).value).map(_ / "protobuf"), paths := Seq((Compile / sourceDirectory).value, (Test / sourceDirectory).value).map(_ / "protobuf"),
outputPaths := Seq((sourceDirectory in Compile).value, (sourceDirectory in Test).value).map(_ / "java"), outputPaths := Seq((Compile / sourceDirectory).value, (Test / sourceDirectory).value).map(_ / "java"),
importPath := None, importPath := None,
// this keeps intellij happy for files that use the shaded protobuf // this keeps intellij happy for files that use the shaded protobuf
Compile / unmanagedJars += (LocalProject("akka-protobuf-v3") / assembly).value, Compile / unmanagedJars += (LocalProject("akka-protobuf-v3") / assembly).value,

View file

@ -56,5 +56,5 @@ object NoPublish extends AutoPlugin {
override def requires = plugins.JvmPlugin override def requires = plugins.JvmPlugin
override def projectSettings = override def projectSettings =
Seq(skip in publish := true, sources in (Compile, doc) := Seq.empty, whitesourceIgnore := true) Seq(publish / skip := true, Compile / doc / sources := Seq.empty, whitesourceIgnore := true)
} }

View file

@ -15,7 +15,7 @@ object ScalaFixExtraRulesPlugin extends AutoPlugin with ScalafixSupport {
import sbt._ import sbt._
import scalafix.sbt.ScalafixPlugin.autoImport.scalafixDependencies import scalafix.sbt.ScalafixPlugin.autoImport.scalafixDependencies
override def projectSettings: Seq[Def.Setting[_]] = super.projectSettings ++ { override def projectSettings: Seq[Def.Setting[_]] = super.projectSettings ++ {
scalafixDependencies in ThisBuild ++= Seq( ThisBuild / scalafixDependencies ++= Seq(
"com.nequissimus" %% "sort-imports" % "0.5.5", "com.nequissimus" %% "sort-imports" % "0.5.5",
// https://github.com/ohze/scala-rewrites // https://github.com/ohze/scala-rewrites
// an extended version of https://github.com/scala/scala-rewrites // an extended version of https://github.com/scala/scala-rewrites

View file

@ -15,11 +15,11 @@ trait ScalafixSupport {
protected def ignore(configKey: ConfigKey): Def.Setting[Task[Seq[File]]] = { protected def ignore(configKey: ConfigKey): Def.Setting[Task[Seq[File]]] = {
import scalafix.sbt.ScalafixPlugin.autoImport._ import scalafix.sbt.ScalafixPlugin.autoImport._
unmanagedSources.in(configKey, scalafix) := { configKey / scalafix / unmanagedSources := {
val ignoreSupport = val ignoreSupport =
new ProjectFileIgnoreSupport((baseDirectory in ThisBuild).value / ignoreConfigFileName, descriptor) new ProjectFileIgnoreSupport((ThisBuild / baseDirectory).value / ignoreConfigFileName, descriptor)
unmanagedSources.in(configKey, scalafix).value.filterNot(file => ignoreSupport.isIgnoredByFileOrPackages(file)) (configKey / scalafix / unmanagedSources).value.filterNot(file => ignoreSupport.isIgnoredByFileOrPackages(file))
} }
} }

View file

@ -41,8 +41,8 @@ object SigarLoader {
sigarFolder := target.value / "native", sigarFolder := target.value / "native",
sigarOptions := "-javaagent:" + sigarArtifact.value + "=" + sigarFolderProperty + "=" + sigarFolder.value, sigarOptions := "-javaagent:" + sigarArtifact.value + "=" + sigarFolderProperty + "=" + sigarFolder.value,
// //
fork in Test := true) ++ (// Invoke Sigar agent at JVM init time, to extract and load native Sigar library. Test / fork := true) ++ (// Invoke Sigar agent at JVM init time, to extract and load native Sigar library.
if (sigarTestEnabled) Seq(javaOptions in Test += sigarOptions.value) if (sigarTestEnabled) Seq(Test / javaOptions += sigarOptions.value)
else Seq()) else Seq())
} }

View file

@ -38,15 +38,15 @@ object TestExtras {
}, },
onlyTestTags := Params.testTagsOnly, onlyTestTags := Params.testTagsOnly,
// add filters for tests excluded by name // add filters for tests excluded by name
testOptions in Test ++= excludeTestNames.value.toSeq.map(exclude => Test / testOptions ++= excludeTestNames.value.toSeq.map(exclude =>
Tests.Filter(test => !test.contains(exclude))), Tests.Filter(test => !test.contains(exclude))),
// add arguments for tests excluded by tag // add arguments for tests excluded by tag
testOptions in Test ++= { Test / testOptions ++= {
val tags = excludeTestTags.value val tags = excludeTestTags.value
if (tags.isEmpty) Seq.empty else Seq(Tests.Argument("-l", tags.mkString(" "))) if (tags.isEmpty) Seq.empty else Seq(Tests.Argument("-l", tags.mkString(" ")))
}, },
// add arguments for running only tests by tag // add arguments for running only tests by tag
testOptions in Test ++= { Test / testOptions ++= {
val tags = onlyTestTags.value val tags = onlyTestTags.value
if (tags.isEmpty) Seq.empty else Seq(Tests.Argument("-n", tags.mkString(" "))) if (tags.isEmpty) Seq.empty else Seq(Tests.Argument("-n", tags.mkString(" ")))
}, },

View file

@ -44,15 +44,15 @@ object AkkaValidatePullRequest extends AutoPlugin {
prValidatorGithubRepository := Some("akka/akka")) prValidatorGithubRepository := Some("akka/akka"))
override lazy val projectSettings = inConfig(ValidatePR)(Defaults.testTasks) ++ Seq( override lazy val projectSettings = inConfig(ValidatePR)(Defaults.testTasks) ++ Seq(
testOptions in ValidatePR += Tests.Argument(TestFrameworks.ScalaTest, "-l", "performance"), ValidatePR / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-l", "performance"),
testOptions in ValidatePR += Tests.Argument(TestFrameworks.ScalaTest, "-l", "long-running"), ValidatePR / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-l", "long-running"),
testOptions in ValidatePR += Tests.Argument(TestFrameworks.ScalaTest, "-l", "timing"), ValidatePR / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-l", "timing"),
// make it fork just like regular test running // make it fork just like regular test running
fork in ValidatePR := (fork in Test).value, ValidatePR / fork := (Test / fork).value,
testGrouping in ValidatePR := (testGrouping in Test).value, ValidatePR / testGrouping := (Test / testGrouping).value,
javaOptions in ValidatePR := (javaOptions in Test).value, ValidatePR / javaOptions := (Test / javaOptions).value,
prValidatorTasks := Seq(test in ValidatePR) ++ additionalTasks.value, prValidatorTasks := Seq(ValidatePR / test) ++ additionalTasks.value,
prValidatorEnforcedBuildAllTasks := Seq(test in Test) ++ additionalTasks.value) prValidatorEnforcedBuildAllTasks := Seq(Test / test) ++ additionalTasks.value)
} }
/** /**
@ -97,12 +97,12 @@ object ParadoxWithPrValidation extends AutoPlugin {
override def trigger = allRequirements override def trigger = allRequirements
override def requires = AkkaValidatePullRequest && ParadoxPlugin override def requires = AkkaValidatePullRequest && ParadoxPlugin
override lazy val projectSettings = Seq(additionalTasks += paradox in Compile) override lazy val projectSettings = Seq(additionalTasks += Compile / paradox)
} }
object UnidocWithPrValidation extends AutoPlugin { object UnidocWithPrValidation extends AutoPlugin {
import AkkaValidatePullRequest._ import AkkaValidatePullRequest._
override def trigger = noTrigger override def trigger = noTrigger
override lazy val projectSettings = Seq(additionalTasks += unidoc in Compile) override lazy val projectSettings = Seq(additionalTasks += Compile / unidoc)
} }

View file

@ -17,7 +17,7 @@ object Whitesource extends AutoPlugin {
// do not change the value of whitesourceProduct // do not change the value of whitesourceProduct
whitesourceProduct := "Lightbend Reactive Platform", whitesourceProduct := "Lightbend Reactive Platform",
whitesourceAggregateProjectName := { whitesourceAggregateProjectName := {
val name = (moduleName in LocalRootProject).value val name = (LocalRootProject / moduleName).value
val wsVersionName = val wsVersionName =
if (isSnapshot.value) { if (isSnapshot.value) {
val currentGitBranch = "git rev-parse --abbrev-ref HEAD".!!.trim val currentGitBranch = "git rev-parse --abbrev-ref HEAD".!!.trim
@ -25,7 +25,7 @@ object Whitesource extends AutoPlugin {
else "adhoc" else "adhoc"
} else } else
CrossVersion CrossVersion
.partialVersion((version in LocalRootProject).value) .partialVersion((LocalRootProject / version).value)
.map { case (major, minor) => s"$major.$minor-stable" } .map { case (major, minor) => s"$major.$minor-stable" }
.getOrElse("adhoc") .getOrElse("adhoc")

View file

@ -1 +1 @@
sbt.version=1.4.7 sbt.version=1.5.2

View file

@ -1,7 +1,7 @@
libraryDependencies += Defaults.sbtPluginExtra( libraryDependencies += Defaults.sbtPluginExtra(
"com.eed3si9n" % "sbt-assembly" % "0.15.0", "com.eed3si9n" % "sbt-assembly" % "0.15.0",
(sbtBinaryVersion in pluginCrossBuild).value, (pluginCrossBuild / sbtBinaryVersion).value,
(scalaBinaryVersion in pluginCrossBuild).value) (pluginCrossBuild / scalaBinaryVersion).value)
// these comment markers are for including code into the docs // these comment markers are for including code into the docs
//#sbt-multi-jvm //#sbt-multi-jvm
@ -28,4 +28,3 @@ addSbtPlugin("com.hpe.sbt" % "sbt-pull-request-validator" % "1.0.0")
addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.25") addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.25")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("com.lightbend.sbt" % "sbt-publish-rsync" % "0.2") addSbtPlugin("com.lightbend.sbt" % "sbt-publish-rsync" % "0.2")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.4")