[2.x] feat: sbtw launcher (#8742)

- Add sbtwProj: Scala 3.x launcher with scopt, drop-in for sbt.bat
- Config: .sbtopts, .jvmopts, sbtconfig.txt, JAVA_OPTS/SBT_OPTS precedence
- Options: --client, --server, --jvm-client, mem, sbt-version, java-home, etc.
- sbt 2.x defaults to native client; --server forces JVM launcher
- JVM run via xsbt.boot.Boot; native via sbtn with --sbt-script
- build.sbt: sbtwProj in root build and allProjects; NativeImagePlugin
- Fixes: JAVA_OPTS then .jvmopts, build.properties trim, shutdownAll PID, Iterator.lastOption
This commit is contained in:
bitloi
2026-02-16 16:21:30 -05:00
committed by GitHub
parent 34206097cf
commit f870b60b7c
14 changed files with 619 additions and 20 deletions
+6 -4
View File
@@ -51,7 +51,7 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
run: |
# test building sbtn on Linux
# test building sbtn on Linux (sbtw native-image dropped: scopt lazy vals break under Graal)
sbt "-Dsbt.io.virtual=false" nativeImage
# smoke test native Image
./client/target/bin/sbtn --sbt-script=$(pwd)/sbt about
@@ -69,7 +69,7 @@ jobs:
if: ${{ matrix.os == 'macos-latest' }}
shell: bash
run: |
# test building sbtn on macOS
# test building sbtn on macOS (sbtw native-image dropped: scopt lazy vals break under Graal)
./sbt "-Dsbt.io.virtual=false" nativeImage
# test launcher script
launcher-package/bin/coursier resolve
@@ -84,19 +84,21 @@ jobs:
max_attempts: 3
shell: bash
command: |
# test building sbtn on Windows
# test building sbtn on Windows (sbtw native-image dropped: scopt lazy vals break under Graal)
sbt "-Dsbt.io.virtual=false" nativeImage
- name: Client test (Windows)
if: ${{ matrix.os == 'windows-latest' }}
shell: bash
run: |
# smoke test native Image
# smoke test native Image (sbtn)
./client/target/bin/sbtn --sbt-script=$(pwd)/launcher-package/src/universal/bin/sbt.bat about
./client/target/bin/sbtn --sbt-script=$(pwd)/launcher-package/src/universal/bin/sbt.bat shutdown
# test launcher script
echo build using JDK 17 test using JDK 17 and JDK 25
launcher-package/bin/coursier.bat resolve
sbt -Dsbt.build.version=$TEST_SBT_VER launcherPackageIntegrationTest/test
# integration tests with sbtw as drop-in for sbt.bat (JVM runner)
sbt -Dsbt.build.version=$TEST_SBT_VER -Dsbt.test.useSbtw=true launcherPackageIntegrationTest/test
cd launcher-package/citest
./test.bat
test3/test3.bat