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

@ -30,7 +30,7 @@ object AkkaBuild {
lazy val rootSettings = Def.settings(
UnidocRoot.akkaSettings,
Protobuf.settings,
parallelExecution in GlobalScope := System
GlobalScope / parallelExecution := System
.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString)
.toBoolean,
// used for linking to API docs (overwrites `project-info.version`)
@ -68,7 +68,7 @@ object AkkaBuild {
ivyConfigurations.value.map(c => ConfigRef(c.name)).toVector,
artifacts = packagedArtifacts.value.toVector,
resolverName = resolver.name,
checksums = checksums.in(publishM2).value.toVector,
checksums = (publishM2 / checksums).value.toVector,
logging = ivyLoggingLevel.value,
overwrite = true)))
}
@ -115,22 +115,22 @@ object AkkaBuild {
resolverSettings,
TestExtras.Filter.settings,
// compile options
scalacOptions in Compile ++= DefaultScalacOptions,
scalacOptions in Compile ++=
Compile / scalacOptions ++= DefaultScalacOptions,
Compile / scalacOptions ++=
JdkOptions.targetJdkScalacOptions(targetSystemJdk.value, optionalDir(jdk8home.value), fullJavaHomes.value),
scalacOptions in Compile ++= (if (allWarnings) Seq("-deprecation") else Nil),
scalacOptions in Test := (scalacOptions in Test).value.filterNot(opt =>
Compile / scalacOptions ++= (if (allWarnings) Seq("-deprecation") else Nil),
Test / scalacOptions := (Test / scalacOptions).value.filterNot(opt =>
opt == "-Xlog-reflective-calls" || opt.contains("genjavadoc")),
javacOptions in Compile ++= {
Compile / javacOptions ++= {
DefaultJavacOptions ++
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),
javacOptions in Compile ++= (if (allWarnings) Seq("-Xlint:deprecation") else Nil),
javacOptions in doc := Seq(),
Compile / javacOptions ++= (if (allWarnings) Seq("-Xlint:deprecation") else Nil),
doc / javacOptions := Seq(),
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"))),
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.",
@ -158,9 +158,9 @@ object AkkaBuild {
/**
* Test settings
*/
fork in Test := true,
Test / fork := true,
// default JVM config for tests
javaOptions in Test ++= {
Test / javaOptions ++= {
val defaults = Seq(
// ## core memory settings
"-XX:+UseG1GC",
@ -187,8 +187,8 @@ object AkkaBuild {
defaults
},
// all system properties passed to sbt prefixed with "akka." will be passed on to the forked jvms as is
javaOptions in Test := {
val base = (javaOptions in Test).value
Test / javaOptions := {
val base = (Test / javaOptions).value
val akkaSysProps: Seq[String] =
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
// rather than the Akka root, some tests depend on Akka root being working dir, so reset
testGrouping in Test := {
val original: Seq[Tests.Group] = (testGrouping in Test).value
Test / testGrouping := {
val original: Seq[Tests.Group] = (Test / testGrouping).value
original.map { group =>
group.runPolicy match {
@ -210,12 +210,12 @@ object AkkaBuild {
}
}
},
parallelExecution in Test := System
Test / parallelExecution := System
.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString)
.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
testOptions in Test += Tests.Argument("-oDF"),
Test / testOptions += Tests.Argument("-oDF"),
mavenLocalResolverSettings,
docLintingSettings,
JdkOptions.targetJdkSettings,
@ -238,9 +238,9 @@ object AkkaBuild {
}
lazy val docLintingSettings = Seq(
javacOptions in compile ++= Seq("-Xdoclint:none"),
javacOptions in test ++= Seq("-Xdoclint:none"),
javacOptions in doc ++= {
compile / javacOptions ++= Seq("-Xdoclint:none"),
test / javacOptions ++= Seq("-Xdoclint:none"),
doc / javacOptions ++= {
if (JdkOptions.isJdk8) Seq("-Xdoclint:none")
else Seq("-Xdoclint:none", "--ignore-source-errors")
})

View file

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

View file

@ -19,5 +19,5 @@ object AutomaticModuleName {
private val AutomaticModuleName = "Automatic-Module-Name"
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)
def additional: Seq[Def.Setting[_]] =
Def.settings((compile in Compile) := {
(headerCreate in Compile).value
(compile in Compile).value
}, (compile in Test) := {
(headerCreate in Test).value
(compile in Test).value
Def.settings(Compile / compile := {
(Compile / headerCreate).value
(Compile / compile).value
}, Test / compile := {
(Test / headerCreate).value
(Test / compile).value
})
// 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 {
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 =>
inConfig(config) {
Seq(
headerSources in config ++=
(((sourceDirectory in config).value / "boilerplate") ** "*.template").get,
config / headerSources ++=
(((config / sourceDirectory).value / "boilerplate") ** "*.template").get,
headerMappings := headerMappings.value ++ Map(HeaderFileType("template") -> cStyleComment))
}
}

View file

@ -15,7 +15,7 @@ object CopyrightHeaderForBuild extends CopyrightHeader {
Seq(Compile, Test).flatMap { config =>
inConfig(config) {
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))
}
}

View file

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

View file

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

View file

@ -7,12 +7,12 @@ package akka
import sbt._
import Keys._
import scala.language.implicitConversions
import dotty.tools.sbtplugin.DottyPlugin.autoImport.DottyCompatModuleID
object Dependencies {
import DependencyHelpers._
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 slf4jVersion = "1.7.30"
@ -29,7 +29,7 @@ object Dependencies {
val scala212Version = "2.12.13"
val scala213Version = "2.13.5"
val scala3Version = "3.0.0-RC1"
val scala3Version = "3.0.0"
val reactiveStreamsVersion = "1.0.3"
@ -37,7 +37,7 @@ object Dependencies {
val scalaTestVersion = {
if (getScalaVersion().startsWith("3.0")) {
"3.2.6"
"3.2.9"
} else {
"3.1.4"
}
@ -99,8 +99,7 @@ object Dependencies {
val reactiveStreams = "org.reactivestreams" % "reactive-streams" % reactiveStreamsVersion // CC0
// ssl-config
val sslConfigCore = DottyCompatModuleID("com.typesafe" %% "ssl-config-core" % sslConfigVersion)
.withDottyCompat(getScalaVersion()) // ApacheV2
val sslConfigCore = ("com.typesafe" %% "ssl-config-core" % sslConfigVersion).cross(CrossVersion.for3Use2_13) // ApacheV2
val lmdb = "org.lmdbjava" % "lmdbjava" % "0.7.0" // ApacheV2, OpenLDAP Public License
@ -108,8 +107,7 @@ object Dependencies {
// For Java 8 Conversions
val java8Compat = Def.setting {
DottyCompatModuleID("org.scala-lang.modules" %% "scala-java8-compat" % java8CompatVersion.value)
.withDottyCompat(getScalaVersion())
("org.scala-lang.modules" %% "scala-java8-compat" % java8CompatVersion.value).cross(CrossVersion.for3Use2_13)
} // Scala License
val aeronDriver = "io.aeron" % "aeron-driver" % aeronVersion // ApacheV2

View file

@ -31,14 +31,14 @@ object Scaladoc extends AutoPlugin {
override lazy val projectSettings = {
inTask(doc)(
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:
scalacOptions in Compile --= Seq("-release", "8"),
Compile / scalacOptions --= Seq("-release", "8"),
autoAPIMappings := CliOptions.scaladocAutoAPI.get)) ++
Seq(validateDiagrams in Compile := true) ++
CliOptions.scaladocDiagramsEnabled.ifTrue(doc in Compile := {
val docs = (doc in Compile).value
if ((validateDiagrams in Compile).value)
Seq(Compile / validateDiagrams := true) ++
CliOptions.scaladocDiagramsEnabled.ifTrue(Compile / doc := {
val docs = (Compile / doc).value
if ((Compile / validateDiagrams).value)
scaladocVerifier(docs)
docs
})
@ -109,7 +109,7 @@ object ScaladocNoVerificationOfDiagrams extends AutoPlugin {
override def trigger = noTrigger
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
.ifTrue(Seq(
javacOptions in (JavaUnidoc, unidoc) := {
JavaUnidoc / unidoc / javacOptions := {
if (JdkOptions.isJdk8) Seq("-Xdoclint:none")
else Seq("-Xdoclint:none", "--ignore-source-errors", "--no-module-directories")
},
@ -153,15 +153,15 @@ object UnidocRoot extends AutoPlugin {
inTask(unidoc)(
Seq(
unidocProjectFilter in ScalaUnidoc := unidocRootProjectFilter(unidocRootIgnoreProjects.value),
unidocProjectFilter in JavaUnidoc := unidocRootProjectFilter(unidocRootIgnoreProjects.value),
apiMappings in ScalaUnidoc := (apiMappings in (Compile, doc)).value) ++
ScalaUnidoc / unidocProjectFilter := unidocRootProjectFilter(unidocRootIgnoreProjects.value),
JavaUnidoc / unidocProjectFilter := unidocRootProjectFilter(unidocRootIgnoreProjects.value),
ScalaUnidoc / apiMappings := (Compile / doc / apiMappings).value) ++
UnidocRoot.CliOptions.genjavadocEnabled
.ifTrue(
Seq(
// akka.stream.scaladsl.GraphDSL.Implicits.ReversePortsOps contains code that
// 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")))
}))
.getOrElse(Nil))
@ -186,6 +186,6 @@ object BootstrapGenjavadoc extends AutoPlugin {
override lazy val projectSettings = UnidocRoot.CliOptions.genjavadocEnabled
.ifTrue(Seq(
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)
}

View file

@ -25,11 +25,11 @@ object JavaFormatter extends AutoPlugin {
override def projectSettings: Seq[Def.Setting[_]] =
Seq(
//below is for sbt java formatter
(excludeFilter in javafmt) := {
javafmt / excludeFilter := {
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))
simpleFileFilter || (excludeFilter in javafmt).value
simpleFileFilter || (javafmt / excludeFilter).value
},
javafmtOnCompile := formatOnCompile)
}

View file

@ -38,7 +38,7 @@ object Jdk9 extends AutoPlugin {
javacOptions := AkkaBuild.DefaultJavacOptions ++ notOnJdk8(Seq("--release", "11")),
compile := compile.dependsOn(CompileJdk9 / compile).value,
classpathConfiguration := TestJdk9,
externalDependencyClasspath := (externalDependencyClasspath in Test).value)
externalDependencyClasspath := (Test / externalDependencyClasspath).value)
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,

View file

@ -37,7 +37,7 @@ object JdkOptions extends AutoPlugin {
targetSystemJdk,
jdk8home,
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
// explicitly. To test whether this has the desired effect, compile
// akka-remote and check the invocation of 'ByteBuffer.clear()' in

View file

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

View file

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

View file

@ -21,7 +21,7 @@ object ParadoxBrowse extends AutoPlugin {
override lazy val projectSettings = Seq(paradoxBrowse := {
import java.awt.Desktop
val rootDocFile = (paradox in Compile).value / "index.html"
val rootDocFile = (Compile / paradox).value / "index.html"
val log = streams.value.log
if (Desktop.isDesktopSupported) Desktop.getDesktop.open(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.")
lazy val settings: Seq[Setting[_]] = Seq(
paths := Seq((sourceDirectory in Compile).value, (sourceDirectory in Test).value).map(_ / "protobuf"),
outputPaths := Seq((sourceDirectory in Compile).value, (sourceDirectory in Test).value).map(_ / "java"),
paths := Seq((Compile / sourceDirectory).value, (Test / sourceDirectory).value).map(_ / "protobuf"),
outputPaths := Seq((Compile / sourceDirectory).value, (Test / sourceDirectory).value).map(_ / "java"),
importPath := None,
// this keeps intellij happy for files that use the shaded protobuf
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 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 scalafix.sbt.ScalafixPlugin.autoImport.scalafixDependencies
override def projectSettings: Seq[Def.Setting[_]] = super.projectSettings ++ {
scalafixDependencies in ThisBuild ++= Seq(
ThisBuild / scalafixDependencies ++= Seq(
"com.nequissimus" %% "sort-imports" % "0.5.5",
// https://github.com/ohze/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]]] = {
import scalafix.sbt.ScalafixPlugin.autoImport._
unmanagedSources.in(configKey, scalafix) := {
configKey / scalafix / unmanagedSources := {
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",
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.
if (sigarTestEnabled) Seq(javaOptions in Test += sigarOptions.value)
Test / fork := true) ++ (// Invoke Sigar agent at JVM init time, to extract and load native Sigar library.
if (sigarTestEnabled) Seq(Test / javaOptions += sigarOptions.value)
else Seq())
}

View file

@ -38,15 +38,15 @@ object TestExtras {
},
onlyTestTags := Params.testTagsOnly,
// 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))),
// add arguments for tests excluded by tag
testOptions in Test ++= {
Test / testOptions ++= {
val tags = excludeTestTags.value
if (tags.isEmpty) Seq.empty else Seq(Tests.Argument("-l", tags.mkString(" ")))
},
// add arguments for running only tests by tag
testOptions in Test ++= {
Test / testOptions ++= {
val tags = onlyTestTags.value
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"))
override lazy val projectSettings = inConfig(ValidatePR)(Defaults.testTasks) ++ Seq(
testOptions in ValidatePR += Tests.Argument(TestFrameworks.ScalaTest, "-l", "performance"),
testOptions in ValidatePR += Tests.Argument(TestFrameworks.ScalaTest, "-l", "long-running"),
testOptions in ValidatePR += Tests.Argument(TestFrameworks.ScalaTest, "-l", "timing"),
ValidatePR / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-l", "performance"),
ValidatePR / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-l", "long-running"),
ValidatePR / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-l", "timing"),
// make it fork just like regular test running
fork in ValidatePR := (fork in Test).value,
testGrouping in ValidatePR := (testGrouping in Test).value,
javaOptions in ValidatePR := (javaOptions in Test).value,
prValidatorTasks := Seq(test in ValidatePR) ++ additionalTasks.value,
prValidatorEnforcedBuildAllTasks := Seq(test in Test) ++ additionalTasks.value)
ValidatePR / fork := (Test / fork).value,
ValidatePR / testGrouping := (Test / testGrouping).value,
ValidatePR / javaOptions := (Test / javaOptions).value,
prValidatorTasks := Seq(ValidatePR / test) ++ additionalTasks.value,
prValidatorEnforcedBuildAllTasks := Seq(Test / test) ++ additionalTasks.value)
}
/**
@ -97,12 +97,12 @@ object ParadoxWithPrValidation extends AutoPlugin {
override def trigger = allRequirements
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 {
import AkkaValidatePullRequest._
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
whitesourceProduct := "Lightbend Reactive Platform",
whitesourceAggregateProjectName := {
val name = (moduleName in LocalRootProject).value
val name = (LocalRootProject / moduleName).value
val wsVersionName =
if (isSnapshot.value) {
val currentGitBranch = "git rev-parse --abbrev-ref HEAD".!!.trim
@ -25,7 +25,7 @@ object Whitesource extends AutoPlugin {
else "adhoc"
} else
CrossVersion
.partialVersion((version in LocalRootProject).value)
.partialVersion((LocalRootProject / version).value)
.map { case (major, minor) => s"$major.$minor-stable" }
.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(
"com.eed3si9n" % "sbt-assembly" % "0.15.0",
(sbtBinaryVersion in pluginCrossBuild).value,
(scalaBinaryVersion in pluginCrossBuild).value)
(pluginCrossBuild / sbtBinaryVersion).value,
(pluginCrossBuild / scalaBinaryVersion).value)
// these comment markers are for including code into the docs
//#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("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("com.lightbend.sbt" % "sbt-publish-rsync" % "0.2")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.4")