Commit Graph

254 Commits

Author SHA1 Message Date
Ethan Atkins 19dc8d1bfd Replace spaces with %20 in path names
If there are strings in the path name, the sbt-script argument will be
interpreted as multiple arguments. The thin client also needs to be
updated to handle %20 in path names.
2020-10-25 19:06:25 -07:00
Ethan Atkins 9ffddfbd25 Pass the sanitized args to thin client in sbt.bat
Passing the unsanitized arguments was problematic in sbt.bat because it
caused sbt --client to run sbtn with --client as a parameter. This
caused sbtn to launch sbt with the --client which caused a loop. This
manifested as a weird error about not being able to get the console
mode.
2020-10-25 17:11:37 -07:00
Ethan Atkins ff638e36bc Set sbt script parameter for sbt.bat
This brings parity with the bash script.
2020-10-25 17:10:55 -07:00
Ethan Atkins 3aa2f5eb75 Pass verbose flag to sbtn when running sbt --client 2020-10-25 17:10:40 -07:00
Ethan Atkins d4156d3ed7 Set sbt script when running sbtn
There are scenarios where sbt is not on the path and may be invoked as
an absolute path from the shell. When this is the case, sbtn will fail
to start a server because of the missing sbt on the path. We can fix
this by setting the --sbt-script parameter.
2020-10-24 12:40:26 -07:00
Eugene Yokota 75257e759b Fix sbt --client slowness
Before:

```
$ time sbt --client exit
[info] entering *experimental* thin client - BEEP WHIRR
[info] terminate the server with `shutdown`
sbt --client exit  0.16s user 0.15s system 101% cpu 0.303 total
```

sbt --client was running around 303ms (median out of 5) on my machine.

```
$ time sbtn exit
[info] entering *experimental* thin client - BEEP WHIRR
[info] terminate the server with `shutdown`
sbtn exit  0.05s user 0.05s system 112% cpu 0.085 total
```

On the other hand, sbtn ran in 85ms (median out of 5).

After:

```
$ time ~/work/sbt-modules/sbt-launcher-package/target/universal/stage/bin/sbt --client exit
[info] entering *experimental* thin client - BEEP WHIRR
[info] terminate the server with `shutdown`
~/work/sbt-modules/sbt-launcher-package/target/universal/stage/bin/sbt  exit  0.06s user 0.08s system 111% cpu 0.127 total
```

By delaying the java version detection, I got it down to 127ms.
2020-10-19 15:13:23 -04:00
Claudio Bley 234273db41 Handle `--ivy` option in `SBT_OPTS` too
Fixes sbt/sbt#5885
2020-10-01 21:21:03 +02:00
Claudio Bley a7c034aa99 Fix handling of `--no-share` option
Using `--no-share` as a command line option resulted in a single additional
argument added to the java command:

`-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy`

Actually, three separate arguments need to be added.
2020-10-01 21:21:03 +02:00
Eugene Yokota 2def5ef636 sbtn support
Ref https://github.com/sbt/sbt/issues/5665

This implements `--client` option to use `sbt` script as the sbtn runner. The build user can also set the env variable `SBT_NATIVE_CLIENT` to `true`.

The script will attempt to parse `project/build.properties` and use sbtn only when it's sbt 1.4 or above.
2020-09-20 17:13:04 -04:00
eugene yokota 7d75936b02
Merge pull request #325 from er1c/robocopy-silent
Make robocopy output silent in sbt.bat to match bash bootstrap copy output
2020-06-27 17:40:43 -04:00
eugene yokota 1e71ba13b6
Merge pull request #322 from henricook/debug-in-sbt-opts
Support the -debug flag in SBT_OPTS
2020-06-19 16:26:23 -04:00
Henri Cook 1bc60adbe7 Tidy up -debug in SBT_OPTS for submission 2020-06-19 17:38:23 +01:00
Eric Peters 4e5e3fbb29 Make robocopy output silent in sbt.bat to match bash bootstrap copy output 2020-06-19 08:07:48 -07:00
l-konov 5ce1b4b61b
Fix issue https://github.com/sbt/sbt/issues/5420 2020-06-11 16:40:10 +03:00
Henri Cook 4872ddf3ef Add tests for supporting -debug flag in SBT_OPTSs 2020-05-25 19:39:54 +01:00
Henri Cook b7558e11b9 Support debug flags in SBT_OPTs 2020-05-25 18:57:53 +01:00
abe bcf5f020fe Fix --verbose output with --jvm-debug on Windows 2020-03-04 11:48:56 +09:00
abe 8143bbfc24 Fix --jvm-debug not working on Windows 2020-03-03 14:39:00 +09:00
Gunnar Lilleaasen 415e566577
Fixed expansion of args with whitespace in JDK 9+.
Solves the issue where providing sbt_options and java_args containing whitespaces on Java 9 and higher would fail. Expansion of sbt_options and java_args containing whitespaces would not expand correctly in copyRt(), but instead would create an invalid java command due to missing quotes.
2020-01-13 10:44:28 +01:00
Eugene Yokota 1a2ca2610b Fix unintended glob expansion
Fixes https://github.com/sbt/sbt/issues/5343
2020-01-08 10:10:09 -05:00
Eugene Yokota c11040c968 Fixes quoted arugment with whitespace
Ref https://github.com/sbt/sbt/issues/5343
Fixes https://github.com/sbt/sbt/issues/5210
2020-01-04 15:05:13 -05:00
Eugene Yokota d35fe3aeaf rsync flags
Fixes https://github.com/sbt/sbt/issues/5035

Currently `sbt` calls `rsync -a`, which expands to `-rlptgoD`, including `--group` and `--owner` flag that preserves the group and owner of the files. This drops the requirement since we just need to copy files around with the right timestamp.
2019-12-24 21:35:01 -05:00
Eugene Yokota 8d06d14019 Fix rsync check path
Starting sbt 1.3.x we use Coursier to build the preloaded local repo using Maven layout.
2019-12-24 15:12:30 -05:00
eugene yokota 7863bd28f6
Merge pull request #313 from eed3si9n/wip/exec
don't use execRunner to copy rt.jar
2019-12-23 14:48:01 -05:00
Eugene Yokota 5559440739 don't use execRunner to copy rt.jar
Ref https://github.com/sbt/sbt-launcher-package/pull/308
Fixes https://github.com/sbt/sbt/issues/5270

The first time `sbt` runs on JDK 11, it copies the `rt.jar` by calling `execRunner java`.. it seems like the control never comes back from it and `sbt` just ends there. This fixes the problem by not calling `execRunner` for that operation.
2019-12-23 01:50:37 -05:00
Eric Peters 29548d7628 Tweak sbt.bat to parse the -debug arguments first 2019-12-19 16:15:25 -08:00
Edward Samson a362c964de Use exec to launch when not in cygwin
This allows, for example, capturing the correct PID when launching sbt
from within a bash script. The original change from
1a07150560 was to address an issue
specific to cygwin.
2019-11-20 13:57:33 +08:00
Eric Peters 63eabf3c8f Update sbt.bat --script-version to execute early and avoid java check/robocopy bootstrap - Fixes #5220 2019-11-17 08:35:30 -08:00
Michael Hsu 1318c0f594 Add special handling for -XX, -XX:+ and -XX:0 2019-11-11 10:59:06 +08:00
Michael Hsu 34ca729719 Fix Travis CI error: find: '=': No such file or directory 2019-11-10 20:46:55 +08:00
Michael Hsu fe43d0b975 Add special handling for -XX
Fix special handling for -D where > null should be > nul
Fix the problem that only the first option of SBT_OPTS and JAVA_OPTS got processed
2019-11-08 10:23:53 +08:00
Eric Peters 5991e803af Add --sbt-jar test and windows sbt.bat support 2019-10-19 20:29:09 -07:00
Eric Peters 819ee47071 Remove unimplemented --sbt-rc and --sbt-snapshot arguments from docs and scripts 2019-10-19 18:34:13 -07:00
Eugene Yokota 9471fab91b Remove debug echo 2019-10-16 13:18:58 -04:00
Eugene Yokota 689fdd682a remove unnecessary /I 2019-10-16 12:00:47 -04:00
eugene yokota 3953c80c73
Update src/universal/bin/sbt.bat
Co-Authored-By: Eric Peters <eric@peters.org>
2019-10-16 11:56:43 -04:00
eugene yokota 7d7e01015f
Update src/universal/bin/sbt.bat
Co-Authored-By: Eric Peters <eric@peters.org>
2019-10-16 11:54:22 -04:00
Eugene Yokota 00e5224fde Add debugging for -D parsing 2019-10-16 10:53:49 -04:00
Eugene Yokota 71a216c037 Fix -D with quotes
Fixe https://github.com/sbt/sbt/issues/5192
2019-10-16 10:48:11 -04:00
Eugene Yokota 546a8b8949 Fix verbose output for SBT_ARGS 2019-10-16 10:45:33 -04:00
eugene yokota ab001f5597
Fix typo around continue/quit
Fixes https://github.com/sbt/sbt/issues/5188
2019-10-15 12:21:07 -04:00
Eric Peters f3b9d7572e Add usage for --debug-inc to bash sbt, add impl to sbt.bat 2019-10-11 09:49:43 -07:00
Eric Peters b5fd78f74b Intial sbt.bat refactor to match the universal bash script - implement --help, --verbose, --version, --script-verion, --numeric-version, .sbtopts, .jvmopts, -D 2019-10-09 19:47:49 -07:00
Alex Zolotko a9d85c6df6 Detect more memory settings
Fixes sbt/sbt#5135
2019-10-09 19:47:45 -07:00
Eugene Yokota 8caa28b57b --verbose mode for Windows 2019-09-25 07:45:16 +01:00
Eugene Yokota 98efb989db Fix equal sign handling for -D
Fixes sbt/sbt#2695
By the time the arguments are passed to a batch script,
it seems like  is parsed away.
for /F did not work since it would not handle double quoted
paths that include whitespaces.
This adds special handling for -D parameters only.
2019-09-25 06:57:07 +01:00
Eric Peters 56cdfcaa90 Add --numeric-version, --script-version, and update --version to print both versions 2019-09-24 16:55:57 -07:00
Eric Peters 7e17407cba Update sbt.1 man page options 2019-09-23 08:30:51 -07:00
Eugene Yokota 0a09fa62ed SBT_ETC_FILE
Travis CI adds `/etc/sbt/sbtopts` that prevents us from testing the out-of-box behavior. This allows us to override the location.
2019-09-22 18:07:28 -04:00
Eugene Yokota 989136debf Fix -v getting on all the time
Fixes https://github.com/sbt/sbt/issues/5108

I messed up in 91b71b39d3 by initializing the variable to 0.
2019-09-20 10:36:16 -04:00