From 1a2cf3d4c66d85f4435f42663c835305ed71e054 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Wed, 3 Apr 2019 09:28:56 -0400 Subject: [PATCH] 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. --- project/AkkaBuild.scala | 8 +++++++- project/Doc.scala | 8 ++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index c587946e2e..f2b1bf3f00 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -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 = { diff --git a/project/Doc.scala b/project/Doc.scala index 273bea2d43..1c880902a4 100644 --- a/project/Doc.scala +++ b/project/Doc.scala @@ -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 = {