Share source directory between Scala 2.13 and Scala 3 (#30384)

This commit is contained in:
Arnout Engelen 2021-07-12 18:32:01 +02:00 committed by GitHub
parent b65f02e6b4
commit 9b5aad942f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 10 additions and 133 deletions

View file

@ -130,6 +130,16 @@ object AkkaBuild {
Compile / javacOptions ++= (if (allWarnings) Seq("-Xlint:deprecation") else Nil),
doc / javacOptions := Seq(),
crossVersion := CrossVersion.binary,
// Adds a `src/main/scala-2.13+` source directory for code shared
// between Scala 2.13 and Scala 3
unmanagedSourceDirectories in Compile ++= {
val sourceDir = (sourceDirectory in Compile).value
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, n)) => Seq(sourceDir / "scala-2.13+")
case Some((2, n)) if n >= 13 => Seq(sourceDir / "scala-2.13+")
case _ => Nil
}
},
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/")),