sbt option to explicitly specify the jdk8 jdk to use (#28107)
* Nicer error message when jdk home path is not found * Also allow setting it via the environment
This commit is contained in:
parent
52952a5050
commit
a47886c4f5
2 changed files with 20 additions and 8 deletions
|
|
@ -134,14 +134,14 @@ object AkkaBuild {
|
|||
// compile options
|
||||
scalacOptions in Compile ++= DefaultScalacOptions,
|
||||
scalacOptions in Compile ++=
|
||||
JdkOptions.targetJdkScalacOptions(targetSystemJdk.value, fullJavaHomes.value),
|
||||
JdkOptions.targetJdkScalacOptions(targetSystemJdk.value, optionalDir(jdk8home.value), fullJavaHomes.value),
|
||||
scalacOptions in Compile ++= (if (allWarnings) Seq("-deprecation") else Nil),
|
||||
scalacOptions in Test := (scalacOptions in Test).value.filterNot(opt =>
|
||||
opt == "-Xlog-reflective-calls" || opt.contains("genjavadoc")),
|
||||
javacOptions in compile ++= DefaultJavacOptions ++
|
||||
JdkOptions.targetJdkJavacOptions(targetSystemJdk.value, fullJavaHomes.value),
|
||||
JdkOptions.targetJdkJavacOptions(targetSystemJdk.value, optionalDir(jdk8home.value), fullJavaHomes.value),
|
||||
javacOptions in test ++= DefaultJavacOptions ++
|
||||
JdkOptions.targetJdkJavacOptions(targetSystemJdk.value, fullJavaHomes.value),
|
||||
JdkOptions.targetJdkJavacOptions(targetSystemJdk.value, optionalDir(jdk8home.value), fullJavaHomes.value),
|
||||
javacOptions in compile ++= (if (allWarnings) Seq("-Xlint:deprecation") else Nil),
|
||||
javacOptions in doc ++= Seq(),
|
||||
|
||||
|
|
@ -263,6 +263,14 @@ object AkkaBuild {
|
|||
},
|
||||
)
|
||||
|
||||
private def optionalDir(path: String): Option[File] =
|
||||
Option(path).filter(_.nonEmpty).map { path =>
|
||||
val dir = new File(path)
|
||||
if (!dir.exists)
|
||||
throw new IllegalArgumentException(s"Path [$path] not found")
|
||||
dir
|
||||
}
|
||||
|
||||
lazy val docLintingSettings = Seq(
|
||||
javacOptions in compile ++= Seq("-Xdoclint:none"),
|
||||
javacOptions in test ++= Seq("-Xdoclint:none"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue