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

set baseline java version to 17 #397

Merged
merged 1 commit into from
Mar 2, 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
21 changes: 4 additions & 17 deletions project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ object BuildSettings {
"-deprecation",
"-unchecked",
"-Xlint:_,-infer-any",
"-feature")

private val isRecentJdk = System.getProperty("java.specification.version").toDouble >= 11.0
"-feature",
"-release", "17")

lazy val checkLicenseHeaders = taskKey[Unit]("Check the license headers for all source files.")
lazy val formatLicenseHeaders = taskKey[Unit]("Fix the license headers for all source files.")
Expand All @@ -19,20 +18,8 @@ object BuildSettings {
lazy val buildSettings = baseSettings ++ Seq(
organization := "com.netflix.iep-apps",
scalaVersion := Dependencies.Versions.scala,
scalacOptions ++= {
// -release option is not supported in scala 2.11
val v = scalaVersion.value
CrossVersion.partialVersion(v).map(_._2.toInt) match {
case Some(v) if v > 11 && isRecentJdk => compilerFlags ++ Seq("-release", "8")
case _ => compilerFlags ++ Seq("-target:jvm-1.8")
}
},
javacOptions ++= {
if (isRecentJdk)
Seq("--release", "8")
else
Seq("-source", "1.8", "-target", "1.8")
},
scalacOptions ++= compilerFlags,
javacOptions ++= Seq("--release", "17"),
crossPaths := true,
crossScalaVersions := Dependencies.Versions.crossScala,
sourcesInBase := false,
Expand Down