Commit Graph

112 Commits

Author SHA1 Message Date
Eruis2579 2d26055de0 fix: Avoid file I/O in --version handler to prevent Windows hangs (#8717)
Use already-read build_props_sbt_version and is_this_dir_sbt variables
instead of reading build.properties again in the handler. This avoids
file I/O operations that could cause hangs on Windows.
2026-02-10 16:55:44 +01:00
Eruis2579 95a3fc3288 fix: Read build.properties directly in --version handler to avoid hangs (#8717)
Instead of relying on the early build_props_sbt_version read, read
build.properties directly in the --version handler using a local
variable. This isolates file I/O to only when --version is called and
avoids potential interference with normal script execution that could
cause Windows test hangs.
2026-02-10 12:38:20 +01:00
Eruis2579 8251ac544a fix: Use goto :eof for consistency with --script-version handler (#8717)
Use goto :eof instead of goto :end to match the pattern used by
--script-version and other early exits in the batch file. This should
fix the Windows test hang issue.
2026-02-10 12:34:43 +01:00
Eruis2579 1ae2d3af57 fix: Use goto :end for proper cleanup in --version handler (#8717)
Use goto :end instead of goto :eof to ensure @endlocal is called
and the script exits cleanly. This should fix the Windows test hang
when sbtn calls the script.
2026-02-10 11:03:08 +01:00
Eruis2579 d11f3623e3 fix: Quote variable assignment to prevent trailing space issues in sbt.bat (#8717) 2026-02-10 09:49:47 +01:00
Eruis2579 b691cfadb2 fix: Use goto :eof for consistency with other early exits in sbt.bat (#8717) 2026-02-10 09:48:05 +01:00
Eruis2579 f7c085ff75 fix: Use goto :eof instead of @endlocal/exit for --version in sbt.bat (#8717)
Using goto :eof is the standard way to exit batch scripts and ensures
proper cleanup. The previous @endlocal/exit approach may have caused
hangs in some scenarios.
2026-02-10 01:19:39 +01:00
Eruis2579 ac95afb145 fix: Fix Windows test hang and assertion mismatch for --version (#8717)
- Fix test to check for correct runner name on Windows (sbt-the-batch-script vs sbt-the-shell-script)
- Fix sbt.bat to properly exit using @endlocal and exit /B 0 instead of goto :eof
2026-02-09 13:30:36 +01:00
Eruis2579 fc804a6575 fix: Handle --version flag in sbt.bat before native client for sbt 2.x (#8717) 2026-02-09 11:58:17 +01:00
Eruis2579 e50e8359e8 test: Add citest2 directory for sbt 2.x integration tests 2026-02-09 10:52:13 +01:00
Eruis2579 96340302ff fix: Add missing import for File extension methods in ExtendedRunnerTest 2026-02-09 10:52:13 +01:00
Eruis2579 34276cc90d test: Add tests for --version flag (#8717) 2026-02-09 10:52:13 +01:00
PandaMan de2c27abeb
[2.x] fix: handle --script-version sbt 2.x project dirs (#8715)
When in an sbt 2.x project directory, the script used to delegate to sbtn
before checking --script-version, so 'sbt --script-version' ran sbtn and
failed. Now we print the script version and exit before the native client
branch.
2026-02-07 22:16:21 -05:00
eugene yokota 499ec520a7
[2.x] require coreutils for RPM (#8712)
**Problem**
Apparently sbt can fail when it doesn't have rm,
which can happen "when building relocatable RPM's and building an OS image in a chroot."

**Solution**
It was suggested that we require coreutils.
2026-02-07 17:23:39 -05:00
Pluto 12deebba2b
[2.x] fix: restore CLI precedence over .sbtopts
According to the issue, `.sbtopts` entries are appended after
CLI args in sbt 1.12.x, so `.sbtopts` JVM memory settings (e.g., `-Xmx2g`) override CLI `--mem`,
causing invalid JVM settings.
2026-02-05 18:04:55 -05:00
eugene yokota 5ba750059c
[2.x] Bump to sbtn 1.12.1 (#8683) 2026-02-03 02:05:50 -05:00
eugene yokota 40ef381fa2
[2.x] ExtendedRunnerTest (#8674)
Problem/Solution
Looks like this needs to be reformatted.
2026-02-01 22:25:10 -05:00
PandaMan 461e12d497
[2.x] fix: Handle paths with parentheses in sbt.bat on Windows (#8656)
Windows CMD interprets parentheses as special syntax for command grouping.
When the project directory path contains parentheses (e.g., in username),
the batch script fails with ') was unexpected at this time.' error.

This fix stores the current directory in a variable using delayed expansion
(!CURRENT_DIR!) instead of using %CD% directly, which properly handles
paths containing parentheses and other special characters.

Fixes #8644
2026-01-29 16:51:06 -05:00
eugene yokota ba8c340a2b
Merge pull request #8530 from eed3si9n/wip/scala-3.8.0
[2.x] deps: Update to Scala 3.8.1
2026-01-25 02:07:52 -05:00
Dairus 7a9775c87d
Add integration test for bspConfig & embedded launcher jar (fixes #7794) (#8597)
This adds a scripted integration test to verify that the `bspConfig` task correctly generates a valid BSP connection file (`.bsp/sbt.json`) when the embedded launcher JAR is present in the classpath.
2026-01-24 15:05:51 -05:00
Eugene Yokota 19ca2911d2 Scala 3.8.1 2026-01-24 04:52:28 -05:00
circlecrystalin 55e75faee2
[2.x] fix: Fix flaky client tests (#8580) 2026-01-22 05:35:13 -05:00
calm 37c6eb2cd9
[2.x] test: Add test for sbt --client startup time (#8599)
* Add test for sbt --client startup time
* Skip startup time test on macOS due to slow hostname resolution
2026-01-21 20:00:00 -05:00
circlecrystalin 2f348a09b9
[2.x] fix: Fixes the handling of special characters in dot files (#8558)
- Replace 'eval echo $line' with 'printf "%s\n" "$line"' in loadConfigFile()
- Prevents shell expansion of special characters like |, *, &, etc.
- Fixes issue where properties with pipes, wildcards, and ampersands
  caused 'command not found' or 'unexpected' errors
- Add test to verify special characters are handled correctly on all platforms
2026-01-19 14:37:08 -05:00
E.G 1efebeaa98
fix: Handle -X JVM options on command line (fixes #5742) (#8566)
Previously, passing JVM options like -Xmx1G directly on the command
line would result in an error:

  sbt -v -Xmx1G
  [error] Expected ';'
  [error] -Xmx1G
  [error]       ^

This was because -X options were being passed to sbt as commands
instead of being recognized as JVM arguments.

Changes:
- Added handling for -X options in sbt.bat to pass them to the JVM
- Updated help text to document this feature
- Added integration tests for the new functionality
2026-01-17 14:29:30 -05:00
SID bb02c3331c
[2.x] fix: Fix sbtopts files priority in sbt launch script (#8514)
* Fix sbtopts files priority in sbt launch script (fixes #7179)

- Change project .sbtopts from prepend to append so it appears last
2026-01-13 13:30:13 -05:00
MkDev11 28f7957307
[2.x] fix: Fix sbt new argument parsing on Windows (#8509)
Only recombine split -- arguments after new/init command.

Fixes #7507
2026-01-13 05:19:19 -05:00
MkDev11 d4570e3359
[2.x] fix: Skip native client for sbt new/init commands (#8512)
Fixes #7497
2026-01-13 05:18:05 -05:00
eugene yokota 4606c90f69
[2.x] ci: Integrate launcher package (#8485)
**Problem/Solution**
This is a follow up to launcher package migrating to sbt 1.x.
This joins the launcher package into the main build.
2026-01-11 20:57:59 -05:00
xuwei-k 813078695f Avoid deprecated java.net.URL constructor
- https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/URL.html#%3Cinit%3E(java.lang.String)
- https://bugs.openjdk.org/browse/JDK-8295949
2026-01-12 08:46:04 +09:00
eugene yokota 61899ecd16
ci: Use slash syntax in build.sbt (#8481) 2026-01-11 15:46:00 -05:00
MkDev11 bbeeb25422
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465)
Fixes #7826

Changes:
- Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties
- Remove dead dispatch-http 0.8.10 dependency from plugins.sbt
- Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt)
- Update sbt-pgp from 2.1.2 to 2.3.1
- Replace all dispatch.classic._ HTTP calls with Java URL.openStream()

The dispatch-http library is dead and doesn't support sbt 1.x. This change
uses standard Java networking APIs for HTTP downloads, eliminating the
dependency on outdated libraries.

All HTTP download operations now use:
- java.net.URL.openConnection()
- InputStream with buffered reading
- Proper resource cleanup with try-finally blocks

- Removes the sbt-export-repo plugin dependency
- Defines exportRepo and exportRepoDirectory settings locally
- Removes ExportRepoPlugin from dist project
- Fixes exportRepo task to not reference itself

* fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility
- Use withExtension instead of copy(extension = ...) for Artifact
- Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters
- Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner)

* fix: Use computed status instead of status key in PackageSignerPlugin

* fix: Use withRevision instead of copy for ModuleID in build.sbt

- Add scala.sys.process._ import for shell command execution (! method)
- Fix resolvers setting to use new slash syntax and proper Option handling
- Fix publish/publishLocal to use {} instead of () to avoid deprecation warning
- Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1)
- Add scala.sys.process._ import for shell command execution
- Fix publish/publishLocal to use {} instead of ()
- Remove problematic resolvers setting that caused task/setting dependency issues
- Use IvyActions.publish directly instead of deprecated Classpaths.publishTask
- Fix ModuleID.copy to use withRevision
- Fix Artifact.copy to use withExtension
- Use computed status value instead of status key

Build now compiles successfully with sbt 1.10.7.
2026-01-11 07:17:24 -05:00
xuwei-k 2d14adc721 avoid deprecated scala.App
7ddf329f6f/library/src/scala/App.scala (L65)
2026-01-09 20:10:28 +09:00
mkdev11 79ab58f4af Add regression test for debug options in SBT_OPTS (#8100) 2026-01-06 14:21:03 +02:00
mkdev11 17f03201d3 Fix debug options breaking launcher on Windows
Filter rt-ext-dir output for java9-rt-ext- pattern, matching the
Unix script behavior. This prevents debug agent stdout (e.g.,
'Listening for transport dt_socket at address: 1234') from being
incorrectly parsed as a file path.

Fixes #8100
2026-01-06 11:00:25 +02:00
Eugene Yokota e3f99d39cb Merge branch '1.12.x' into wip/merge-1.12.x 2026-01-05 00:08:21 -05:00
eugene yokota 03d57c5803
Merge pull request #8413 from sideeffffect/1.11.x-JDK_JAVA_OPTIONS
[1.x] Handle JDK_JAVA_OPTIONS
2025-12-17 18:09:27 -05:00
Ondra Pelech d48895df85 Handle JDK_JAVA_OPTIONS 2025-12-12 15:44:25 +01:00
xuwei-k 70960744e7 Scala 2.12.21 2025-12-09 17:28:03 +09:00
Eugene Yokota 5730383340 Merge branch '1.12.x' into wip/merge-1.12.x 2025-11-24 02:14:17 -05:00
Eugene Yokota bd460ae536 Test using JDK 25 2025-09-28 05:53:40 -04:00
Eugene Yokota 51aa789346 Suppress JDK 25 warnings 2025-09-28 04:17:50 -04:00
Eugene Yokota 64dcdafc07 Merge branch '1.11.x' into wip/merge-1.11.x 2025-09-17 23:35:59 -04:00
xuwei-k 64357d7e2a Scala 3.7.3 2025-09-09 12:31:28 +09:00
Eugene Yokota 9186f23839 sbt 1.11.6 2025-09-06 18:42:39 -04:00
Eugene Yokota 9783cd092b Merge branch '1.11.x' into wip/merge-1.11.x 2025-08-25 02:29:12 -04:00
Eugene Yokota 94d20176d9 sbtn 1.11.5 2025-08-24 05:50:16 -04:00
Eugene Yokota af967705e9 Make integrationTest sequential 2025-08-24 04:28:57 -04:00
Eugene Yokota 70070fcf06 Comment out version number tests 2025-08-24 02:04:34 -04:00
Eugene Yokota 49e46c2451 Retry on IO error 2025-08-24 02:04:34 -04:00