disable -Werror when using Java 20 (#467)

This commit is contained in:
PJ Fanning 2023-07-03 18:57:55 +01:00 committed by GitHub
parent 5ad32f1072
commit 0db5d8d6f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,6 +91,11 @@ object PekkoDisciplinePlugin extends AutoPlugin {
),
Compile / doc / scalacOptions := Seq())
// ignore Scala compile warnings for Java 20+
lazy val jvmIgnoreWarnings = {
System.getProperty("java.version").startsWith("2")
}
/**
* We are a little less strict in docs
*/
@ -115,11 +120,10 @@ object PekkoDisciplinePlugin extends AutoPlugin {
Compile / scalacOptions ++= Seq("-Xfatal-warnings"),
Test / scalacOptions --= testUndiscipline,
Compile / javacOptions ++= (
if (scalaVersion.value.startsWith("3.")) {
Seq()
if (jvmIgnoreWarnings || scalaVersion.value.startsWith("3.") || nonFatalJavaWarningsFor(name.value)) {
Seq.empty
} else {
if (!nonFatalJavaWarningsFor(name.value)) Seq("-Werror", "-Xlint:deprecation", "-Xlint:unchecked")
else Seq.empty
Seq("-Werror", "-Xlint:deprecation", "-Xlint:unchecked")
}
),
Compile / doc / javacOptions := Seq("-Xdoclint:none"),