Skip to content

chore: align the --source flag with the --target when compiling Java code #23749

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

Merged
merged 2 commits into from
Aug 15, 2025
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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,9 @@ jobs:
- name: Cleanup
run: .github/workflows/cleanup.sh

- name: Set JDK 17 as default
run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH

- name: Git Checkout
uses: actions/checkout@v5

Expand Down Expand Up @@ -859,7 +862,7 @@ jobs:
scala3-${{ env.RELEASE_TAG }}*.zip \
scala3-${{ env.RELEASE_TAG }}*.tar.gz \
scala3-${{ env.RELEASE_TAG }}*.sha256 \
scala3-${{ env.RELEASE_TAG }}.msi
scala3-${{ env.RELEASE_TAG }}.msi

- name: Publish Release
run: ./project/scripts/sbtPublish ";project scala3-bootstrapped ;publishSigned ;sonaUpload"
Expand Down
20 changes: 10 additions & 10 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ object Build {
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Add all the project's external dependencies
libraryDependencies ++= Seq(
Expand Down Expand Up @@ -1486,7 +1486,7 @@ object Build {
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Add all the project's external dependencies
libraryDependencies ++= Seq(
Expand Down Expand Up @@ -1556,7 +1556,7 @@ object Build {
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Packaging configuration of `scala3-staging`
Compile / packageBin / publishArtifact := true,
Expand Down Expand Up @@ -1613,7 +1613,7 @@ object Build {
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Packaging configuration of `scala3-staging`
Compile / packageBin / publishArtifact := true,
Expand Down Expand Up @@ -1676,7 +1676,7 @@ object Build {
"-sourcepath", (Compile / sourceDirectories).value.map(_.getCanonicalPath).distinct.mkString(File.pathSeparator),
),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Expand Down Expand Up @@ -1752,7 +1752,7 @@ object Build {
"-sourcepath", (Compile / sourceDirectories).value.map(_.getCanonicalPath).distinct.mkString(File.pathSeparator),
),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Expand Down Expand Up @@ -2006,7 +2006,7 @@ object Build {
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Add all the project's external dependencies
libraryDependencies ++= Seq(
Expand Down Expand Up @@ -2065,7 +2065,7 @@ object Build {
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Add all the project's external dependencies
libraryDependencies ++= Seq(
Expand Down Expand Up @@ -2146,7 +2146,7 @@ object Build {
// TODO: Enable these flags when the new stdlib is explicitelly null checked
//Compile / scalacOptions ++= Seq("-Yexplicit-nulls", "-Wsafe-init"),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Expand Down Expand Up @@ -2267,7 +2267,7 @@ object Build {
// TODO: Enable these flags when the new stdlib is explicitelly null checked
//Compile / scalacOptions ++= Seq("-Yexplicit-nulls", "-Wsafe-init"),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Expand Down
Loading