Use Def.settings (#26945)

This commit is contained in:
Dale Wijnand 2019-05-21 17:35:42 +01:00 committed by Arnout Engelen
parent a4a61649f6
commit 5a893fff7b

View file

@ -22,8 +22,9 @@ object AkkaBuild {
val parallelExecutionByDefault = false // TODO: enable this once we're sure it does not break things
lazy val buildSettings = Dependencies.Versions ++ Seq(
lazy val buildSettings = Def.settings(
organization := "com.typesafe.akka",
Dependencies.Versions,
// use the same value as in the build scope
version := (version in ThisBuild).value)
@ -44,9 +45,10 @@ object AkkaBuild {
}
}
lazy val rootSettings = Release.settings ++
UnidocRoot.akkaSettings ++
Protobuf.settings ++ Seq(
lazy val rootSettings = Def.settings(
Release.settings,
UnidocRoot.akkaSettings,
Protobuf.settings,
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString).toBoolean,
version in ThisBuild := akkaVersion
)
@ -87,18 +89,16 @@ object AkkaBuild {
overwrite = true)))
}
lazy val resolverSettings = {
lazy val resolverSettings = Def.settings(
// should we be allowed to use artifacts published to the local maven repository
if (System.getProperty("akka.build.useLocalMavenResolver", "false").toBoolean)
Seq(resolvers += mavenLocalResolver)
else Seq.empty
} ++ {
resolvers += mavenLocalResolver
else Seq.empty,
// should we be allowed to use artifacts from sonatype snapshots
if (System.getProperty("akka.build.useSnapshotSonatypeResolver", "false").toBoolean)
Seq(resolvers += Resolver.sonatypeRepo("snapshots"))
else Seq.empty
} ++ Seq(
pomIncludeRepository := (_ => false) // do not leak internal repositories during staging
resolvers += Resolver.sonatypeRepo("snapshots")
else Seq.empty,
pomIncludeRepository := (_ => false), // do not leak internal repositories during staging
)
private def allWarnings: Boolean = System.getProperty("akka.allwarnings", "false").toBoolean
@ -108,9 +108,11 @@ object AkkaBuild {
// -XDignore.symbol.file suppresses sun.misc.Unsafe warnings
final val DefaultJavacOptions = Seq("-encoding", "UTF-8", "-Xlint:unchecked", "-XDignore.symbol.file")
lazy val defaultSettings = resolverSettings ++
TestExtras.Filter.settings ++
Protobuf.settings ++ Seq[Setting[_]](
lazy val defaultSettings: Seq[Setting[_]] = Def.settings(
resolverSettings,
TestExtras.Filter.settings,
Protobuf.settings,
// compile options
scalacOptions in Compile ++= DefaultScalacOptions,
// Makes sure that, even when compiling with a jdk version greater than 8, the resulting jar will not refer to
@ -229,10 +231,12 @@ object AkkaBuild {
logBuffered in Test := System.getProperty("akka.logBufferedTests", "false").toBoolean,
// show full stack traces and test case durations
testOptions in Test += Tests.Argument("-oDF")) ++
mavenLocalResolverSettings ++
docLintingSettings ++
CrossJava.crossJavaSettings
testOptions in Test += Tests.Argument("-oDF"),
mavenLocalResolverSettings,
docLintingSettings,
CrossJava.crossJavaSettings,
)
lazy val docLintingSettings = Seq(
javacOptions in compile ++= Seq("-Xdoclint:none"),