Allow build to run on JDK 8 (#26642)

Ref #26233

Currently Akka fails to build on sbt community build, which runs on JDK 8. Likely it will fail on Scala community build as well due to `--ignore-source-errors`.
This makes the flag conditional based on the running JDK.

It will be useful for Scala toolchain to be able to validate its latest using latest Akka if possible.
This commit is contained in:
eugene yokota 2019-04-03 09:28:56 -04:00 committed by Arnout Engelen
parent abbbfb5b54
commit 1a2cf3d4c6
2 changed files with 13 additions and 3 deletions

View file

@ -19,6 +19,8 @@ object AkkaBuild {
val parallelExecutionByDefault = false // TODO: enable this once we're sure it does not break things
val jdkVersion = sys.props("java.specification.version")
lazy val buildSettings = Dependencies.Versions ++ Seq(
organization := "com.typesafe.akka",
// use the same value as in the build scope, so it can be overriden by stampVersion
@ -231,7 +233,11 @@ object AkkaBuild {
lazy val docLintingSettings = Seq(
javacOptions in compile ++= Seq("-Xdoclint:none"),
javacOptions in test ++= Seq("-Xdoclint:none"),
javacOptions in doc ++= Seq("-Xdoclint:none", "--ignore-source-errors"))
javacOptions in doc ++= {
if (jdkVersion == "1.8") Seq("-Xdoclint:none")
else Seq("-Xdoclint:none", "--ignore-source-errors")
}
)
def loadSystemProperties(fileName: String): Unit = {

View file

@ -125,11 +125,15 @@ object UnidocRoot extends AutoPlugin {
val akkaSettings = UnidocRoot.CliOptions.genjavadocEnabled
.ifTrue(
Seq(
javacOptions in (JavaUnidoc, unidoc) := Seq(
javacOptions in (JavaUnidoc, unidoc) := {
if (AkkaBuild.jdkVersion == "1.8") Seq("-Xdoclint:none")
else Seq(
"-Xdoclint:none",
"--frames",
"--ignore-source-errors",
"--no-module-directories")))
"--no-module-directories")
}
))
.getOrElse(Nil)
override lazy val projectSettings = {