Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable -Werror when using Java 20 #467

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions project/PekkoDisciplinePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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"),
Expand Down