Skip to content

Commit

Permalink
set baseline java version to 17 (Netflix-Skunkworks#397)
Browse files Browse the repository at this point in the history
In preparation for Spring 6, drop support for jdk8 and jdk11.
  • Loading branch information
brharrington authored and manolama committed Oct 25, 2023
1 parent 4673cc7 commit ae3e1ef
Showing 1 changed file with 4 additions and 17 deletions.
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

0 comments on commit ae3e1ef

Please sign in to comment.