Scala 3 cross compatible akka-actor / akka-testkit / akka-actor-tests (#29956)

* Remove @switch when it doesn't take effect
* Use ActorRef.noSender
* Minor tweaks to SchedulerSpec
* Disambiguate TypedActor for Scala 3
* Bump ScalaTest to a version compatible with Scala 3
* Bump ScalaCheck
* Disambiguate Event in SupervisorHierarchySpec
* Scala 3 compatible EventBusSpec
* Prevent private unused variables to be erased by Scala 3
* Bump mockito
* Explicit actorRef2Scala import
* restore original .scalafix.conf
* Scala 3 compatible tailrec
* Reminder to re add switch annotation in case
* Move to nowarn instead of silencer
* Bump to Scala 2.12.13
* Cross compatible annotations
* fix docs generation
* adapt the build for Scala 3
* fix errors but bus
* remove more SerialVersion from trait
* scalacheck only from scalatest
* cross-compile akka-actor-tests
* restore cross-compilation
* early initializers workaround
* scalacheck switch
* cross compatible FSM.State class
* cross compatible LARS spec
* Change results to pass LineNumberSpec
* fix stackoverflow in AsyncDnsResolverIntegrationSpec
* FSM.State unapply
* fix Scala 2.13 mima
* SerialVersionRemover compiler plugin
* removed unused nowarns
This commit is contained in:
Andrea Peruffo 2021-02-01 15:38:29 +00:00 committed by GitHub
parent 0f27ed6189
commit da70e0ccd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
370 changed files with 4058 additions and 1373 deletions

View file

@ -12,7 +12,6 @@ enablePlugins(
JavaFormatterPlugin)
disablePlugins(MimaPlugin)
// check format and headers
TaskKey[Unit]("verifyCodeFmt") := {
javafmtCheckAll.all(ScopeFilter(inAnyProject)).result.value.toEither.left.foreach { _ =>
@ -31,12 +30,9 @@ addCommandAlias("applyCodeStyle", "headerCreateAll; javafmtAll; scalafmtAll")
addCommandAlias(
name = "fixall",
value =
";scalafixEnable; scalafixAll; scalafmtAll; test:compile; multi-jvm:compile; reload")
value = ";scalafixEnable; scalafixAll; scalafmtAll; test:compile; multi-jvm:compile; reload")
addCommandAlias(
name = "sortImports",
value = ";scalafixEnable; scalafixAll SortImports; scalafmtAll")
addCommandAlias(name = "sortImports", value = ";scalafixEnable; scalafixAll SortImports; scalafmtAll")
import akka.AkkaBuild._
import akka.{ AkkaBuild, Dependencies, OSGi, Protobuf, SigarLoader, VersionGenerator }
@ -107,7 +103,15 @@ lazy val root = Project(id = "akka", base = file("."))
.aggregate(aggregatedProjects: _*)
.enablePlugins(PublishRsyncPlugin)
.settings(rootSettings: _*)
.settings(unidocRootIgnoreProjects := Seq(remoteTests, benchJmh, protobuf, protobufV3, akkaScalaNightly, docs))
.settings(
unidocRootIgnoreProjects := Seq(
remoteTests,
benchJmh,
protobuf,
protobufV3,
akkaScalaNightly,
docs,
serialversionRemoverPlugin))
.settings(unmanagedSources in (Compile, headerCreate) := (baseDirectory.value / "project").**("*.scala").get)
.enablePlugins(CopyrightHeaderForBuild)
@ -120,6 +124,7 @@ lazy val actor = akkaModule("akka-actor")
(scalaSource in Compile).value.getParentFile / s"scala-$ver"
})
.settings(VersionGenerator.settings)
.settings(serialversionRemoverPluginSettings)
.enablePlugins(BoilerplatePlugin)
lazy val actorTests = akkaModule("akka-actor-tests")
@ -571,6 +576,25 @@ lazy val billOfMaterials = Project("akka-bill-of-materials", file("akka-bill-of-
bomIncludeProjects := userProjects,
description := s"${description.value} (depending on Scala ${CrossVersion.binaryScalaVersion(scalaVersion.value)})")
lazy val serialversionRemoverPlugin =
Project(id = "serialVersionRemoverPlugin", base = file("plugins/serialversion-remover-plugin")).settings(
scalaVersion := akka.Dependencies.scala3Version,
libraryDependencies += ("org.scala-lang" %% "scala3-compiler" % akka.Dependencies.scala3Version),
Compile / doc / sources := Nil,
publishArtifact in Compile := false)
lazy val serialversionRemoverPluginSettings = {
if (akka.Dependencies.getScalaVersion() == akka.Dependencies.scala3Version) {
Seq(
autoCompilerPlugins := true,
scalacOptions in Compile += (
"-Xplugin:" + (Keys.`package` in (serialversionRemoverPlugin, Compile)).value.getAbsolutePath.toString
))
} else {
Seq()
}
}
def akkaModule(name: String): Project =
Project(id = name, base = file(name))
.enablePlugins(ReproducibleBuildsPlugin)