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

chore: Remove old release options #6734

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
# Do not change the version of Java, it is the minimal version Metals works with
java-version: 17
cache: 'sbt'
- name: Publish
Expand Down
30 changes: 9 additions & 21 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -172,37 +172,25 @@ def lintingOptions(scalaVersion: String) = {

val sharedJavacOptions = List(
Compile / javacOptions ++= {
if (sys.props("java.version").startsWith("1.8"))
if (sys.props("java.version").startsWith("17"))
Nil
else
Seq("--release", "8")
Seq("--release", "17")
}
)

val sharedScalacOptions = List(
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case partialVersion
// Scala 2.12.16 and lower break within the tests if target is set to 11
if isScala211(partialVersion) ||
scalaVersion.value == "2.12.16" ||
isScala212(partialVersion) && V.deprecatedScala2Versions
.contains(scalaVersion.value) =>
List(
"-target:jvm-1.8",
"-Yrangepos",
"-Xexperimental",
) // TODO after release drop 2.11.12
/* Scala 2.12 has a bug on older version that break with `-release, but target
* is enough and we will confirm the compilation on latest Scala 2.12
*/
case partialVersion
if isScala212(partialVersion) && V.scala212 != scalaVersion.value =>
List("-target:11", "-Yrangepos", "-Xexperimental")
// Scala 2.12 and 2.11 cannot output for JDKs > 8
case partialVersion if isScala211(partialVersion) =>
List("-target:jvm-1.8", "-Yrangepos", "-Xexperimental")
case partialVersion if isScala212(partialVersion) =>
List("-Yrangepos", "-Xexperimental")
case partialVersion if isScala3(partialVersion) =>
List("-Xtarget:11", "-language:implicitConversions", "-Xsemanticdb")
List("-Xtarget:17", "-language:implicitConversions", "-Xsemanticdb")
case _ =>
List("-target:11", "-Yrangepos")
List("-target:17", "-Yrangepos")
}
}
)
Expand Down
Loading