Some minor build clean ups

- Resolve some warnings due to depracations
- Fix an infinite recursion
- Minor refactoring to use sys.props instead of System.getProperty
This commit is contained in:
Marcos Pereira 2021-08-19 20:03:07 -04:00
parent 9f83f437f9
commit 7cdca36ab8
No known key found for this signature in database
GPG key ID: F7EBB0FF122A3D87
3 changed files with 6 additions and 7 deletions

View file

@ -360,7 +360,7 @@ lazy val protobufV3 = akkaModule("akka-protobuf-v3")
// https://github.com/sbt/sbt-assembly/issues/400
.inLibrary(Dependencies.Compile.Provided.protobufRuntime)
.inProject),
assembly / assemblyOption := (assembly / assemblyOption).value.copy(includeScala = false, includeBin = false),
assembly / assemblyOption := (assembly / assemblyOption).value.withIncludeScala(false).withIncludeBin(false),
autoScalaLibrary := false, // do not include scala dependency in pom
exportJars := true, // in dependent projects, use assembled and shaded jar
makePomConfiguration := makePomConfiguration.value

View file

@ -132,8 +132,8 @@ object AkkaBuild {
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
Compile / unmanagedSourceDirectories ++= {
val sourceDir = (Compile / sourceDirectory).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+")
@ -213,7 +213,7 @@ object AkkaBuild {
group.runPolicy match {
case Tests.SubProcess(forkOptions) =>
// format: off
group.copy(runPolicy = Tests.SubProcess(
group.withRunPolicy(Tests.SubProcess(
forkOptions.withWorkingDirectory(workingDirectory = Some(new File(System.getProperty("user.dir"))))))
// format: on
case _ => group

View file

@ -24,8 +24,7 @@ object MultiNode extends AutoPlugin {
// MultiJvm tests can be excluded from normal test target an validatePullRequest
// with -Dakka.test.multi-in-test=false
val multiNodeTestInTest: Boolean =
System.getProperty("akka.test.multi-in-test", "true") == "true"
val multiNodeTestInTest: Boolean = sys.props.getOrElse("akka.test.multi-in-test", "true").toBoolean
object CliOptions {
val multiNode = CliOption("akka.test.multi-node", false)
@ -85,7 +84,7 @@ object MultiNode extends AutoPlugin {
(name: String) =>
new Logger {
def trace(t: => Throwable): Unit = { logger.trace(t) }
def success(message: => String): Unit = { success(message) }
def success(message: => String): Unit = { logger.success(message) }
def log(level: Level.Value, message: => String): Unit =
logger.log(level, s"[${scala.Console.BLUE}$name${scala.Console.RESET}] $message")
}