Updates to build for 2.12
This commit is contained in:
parent
0ecc820132
commit
26bc1f14ca
@ -49,3 +49,8 @@ end users will be listed here.
|
||||
#### 0.11.1
|
||||
|
||||
* Update to Akka 2.4.11.
|
||||
|
||||
#### 0.11.2
|
||||
|
||||
* Update to Akka 2.4.14.
|
||||
* Add support for Scala 2.12
|
||||
|
@ -62,8 +62,8 @@ object BasicSettings extends AutoPlugin with Basics {
|
||||
scalaVersion := buildScalaVersion,
|
||||
crossScalaVersions := buildScalaVersions,
|
||||
|
||||
scalacOptions ++= buildScalacOptions,
|
||||
javacOptions ++= buildJavacOptions,
|
||||
addScalacOptions(),
|
||||
addJavacOptions(),
|
||||
autoAPIMappings := true,
|
||||
|
||||
updateOptions := updateOptions.value.withCachedResolution(cachedResolution),
|
||||
@ -88,30 +88,62 @@ object BasicSettings extends AutoPlugin with Basics {
|
||||
|
||||
lazy val buildScalaVersions = buildScalaVersion +: extraScalaVersions
|
||||
|
||||
val buildScalacOptions = Seq (
|
||||
"-unchecked",
|
||||
"-feature",
|
||||
"-target:jvm-" + minimumJavaVersion
|
||||
) ++ (
|
||||
if (deprecation) Seq("-deprecation") else Seq.empty
|
||||
) ++ (
|
||||
if (optimize) Seq("-optimize") else Seq.empty
|
||||
) ++ (
|
||||
if (inlineWarn) Seq("-Yinline-warnings") else Seq.empty
|
||||
) ++ (
|
||||
if (unusedWarn) Seq("-Ywarn-unused") else Seq.empty
|
||||
) ++ (
|
||||
if (importWarn) Seq("-Ywarn-unused-import") else Seq.empty
|
||||
) ++ (
|
||||
if (newBackend) Seq("-Ybackend:GenBCode", "-Yopt:l:classpath") else Seq.empty
|
||||
)
|
||||
def addScalacOptions(optim: Boolean = optimize) = Def.derive {
|
||||
scalacOptions ++= {
|
||||
val sv = SVer(scalaBinaryVersion.value)
|
||||
var options = Seq.empty[String]
|
||||
|
||||
/* Java build setup */
|
||||
val buildJavacOptions = Seq(
|
||||
options :+= "-unchecked"
|
||||
options :+= "-feature"
|
||||
if (deprecation) {
|
||||
options :+= "-deprecation"
|
||||
}
|
||||
if (inlineWarn) {
|
||||
options :+= "-Yinline-warnings"
|
||||
}
|
||||
if (unusedWarn) {
|
||||
options :+= "-Ywarn-unused"
|
||||
}
|
||||
if (importWarn) {
|
||||
options :+= "-Ywarn-unused-import"
|
||||
}
|
||||
if (!sv.requireJava8) {
|
||||
options :+= "-target:jvm-" + minimumJavaVersion
|
||||
}
|
||||
if (optim) {
|
||||
if (sv.newOptimize || sv.supportsNewBackend && newBackend) {
|
||||
options :+= "-opt:l:project"
|
||||
} else if (!sv.requireJava8) {
|
||||
options :+= "-optimize"
|
||||
}
|
||||
}
|
||||
if (sv.supportsNewBackend && newBackend && !sv.requireJava8) {
|
||||
options :+= "-Ybackend:GenBCode"
|
||||
}
|
||||
|
||||
options
|
||||
}
|
||||
}
|
||||
|
||||
def addJavacOptions() = Def.derive {
|
||||
javacOptions ++= {
|
||||
val sv = SVer(scalaBinaryVersion.value)
|
||||
var options = Seq.empty[String]
|
||||
|
||||
if (sv.requireJava8) {
|
||||
options ++= Seq[String](
|
||||
"-target", "1.8",
|
||||
"-source", "1.8"
|
||||
)
|
||||
} else {
|
||||
options ++= Seq[String](
|
||||
"-target", minimumJavaVersion,
|
||||
"-source", minimumJavaVersion
|
||||
) ++ (
|
||||
if (deprecation) Seq("-Xlint:deprecation") else Seq.empty
|
||||
)
|
||||
}
|
||||
|
||||
options
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,41 +20,27 @@ object Helpers {
|
||||
}
|
||||
|
||||
sealed trait SVer {
|
||||
def requireJava8: Boolean
|
||||
val supportsNewBackend: Boolean = false
|
||||
val requireJava8: Boolean = true
|
||||
val newOptimize: Boolean = false
|
||||
}
|
||||
object SVer {
|
||||
def apply(scalaVersion: String): SVer = {
|
||||
scalaVersion match {
|
||||
case "2.10" => SVer2_10
|
||||
case "2.11" => SVer2_11
|
||||
case "2.12.0-M1" => SVer2_12M1
|
||||
case "2.12.0-M2" => SVer2_12M2
|
||||
case "2.12.0-M3" => SVer2_12M3
|
||||
case "2.12.0-M4" => SVer2_12M4
|
||||
case "2.12" => SVer2_12
|
||||
}
|
||||
}
|
||||
}
|
||||
case object SVer2_10 extends SVer {
|
||||
def requireJava8 = false
|
||||
override val requireJava8 = false
|
||||
}
|
||||
case object SVer2_11 extends SVer {
|
||||
def requireJava8 = false
|
||||
}
|
||||
case object SVer2_12M1 extends SVer {
|
||||
def requireJava8 = true
|
||||
}
|
||||
case object SVer2_12M2 extends SVer {
|
||||
def requireJava8 = true
|
||||
}
|
||||
case object SVer2_12M3 extends SVer {
|
||||
def requireJava8 = true
|
||||
}
|
||||
case object SVer2_12M4 extends SVer {
|
||||
def requireJava8 = true
|
||||
override val supportsNewBackend = true
|
||||
override val requireJava8 = false
|
||||
}
|
||||
case object SVer2_12 extends SVer {
|
||||
def requireJava8 = true
|
||||
override val newOptimize = true
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user