mirror of https://github.com/sbt/sbt.git
commit
ead69fe395
|
|
@ -62,6 +62,12 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test("sbt -D arguments") {
|
||||||
|
val out = sbtProcess("-Dsbt.supershell=false compile -v").!!.linesIterator.toList
|
||||||
|
assert(out.contains[String]("-Dsbt.supershell=false"))
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
test("sbt --sbt-version") {
|
test("sbt --sbt-version") {
|
||||||
val out = sbtProcess("--sbt-version 1.3.0 compile -v").!!.linesIterator.toList
|
val out = sbtProcess("--sbt-version 1.3.0 compile -v").!!.linesIterator.toList
|
||||||
assert(out.contains[String]("-Dsbt.version=1.3.0"))
|
assert(out.contains[String]("-Dsbt.version=1.3.0"))
|
||||||
|
|
|
||||||
|
|
@ -374,23 +374,29 @@ if defined _java_home_arg (
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if /I "%~0" == "new" (
|
if "%~0" == "new" (
|
||||||
if not defined SBT_ARGS (
|
if not defined SBT_ARGS (
|
||||||
set sbt_new=true
|
set sbt_new=true
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if /I "%g:~0,2%" == "-D" (
|
if "%g:~0,2%" == "-D" (
|
||||||
rem special handling for -D since '=' gets parsed away
|
rem special handling for -D since '=' gets parsed away
|
||||||
if x%g:^==% == x%g% (
|
echo "%g%" | find "=" > null
|
||||||
|
if ERRORLEVEL 1 (
|
||||||
if not "%~1" == "" (
|
if not "%~1" == "" (
|
||||||
set SBT_ARGS=!SBT_ARGS! %0=%1
|
call :dlog [args_loop] -D argument %~0=%~1
|
||||||
|
set "SBT_ARGS=!SBT_ARGS! %~0=%~1"
|
||||||
shift
|
shift
|
||||||
goto args_loop
|
goto args_loop
|
||||||
) else (
|
) else (
|
||||||
echo %g is missing a value
|
echo %g% is missing a value
|
||||||
goto error
|
goto error
|
||||||
)
|
)
|
||||||
|
) else (
|
||||||
|
call :dlog [args_loop] -D argument %~0
|
||||||
|
set "SBT_ARGS=!SBT_ARGS! %~0"
|
||||||
|
goto args_loop
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -529,7 +535,7 @@ if defined sbt_args_verbose (
|
||||||
if defined _JAVA_OPTS ( call :echolist !_JAVA_OPTS! )
|
if defined _JAVA_OPTS ( call :echolist !_JAVA_OPTS! )
|
||||||
if defined _SBT_OPTS ( call :echolist !_SBT_OPTS! )
|
if defined _SBT_OPTS ( call :echolist !_SBT_OPTS! )
|
||||||
echo -cp "!SBT_HOME!\bin\sbt-launch.jar" xsbt.boot.Boot
|
echo -cp "!SBT_HOME!\bin\sbt-launch.jar" xsbt.boot.Boot
|
||||||
if defined %* ( call :echolist %* )
|
if not [%~1] == [] ( call :echolist %* )
|
||||||
echo.
|
echo.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -547,10 +553,11 @@ if [%0] EQU [] goto echolist_end
|
||||||
set "p=%0"
|
set "p=%0"
|
||||||
|
|
||||||
rem special handling for -D since '=' gets parsed away
|
rem special handling for -D since '=' gets parsed away
|
||||||
if /I "%p:~0,2%" == "-D" (
|
if "%p:~0,2%" == "-D" (
|
||||||
rem if "-Dscala.ext.dirs" (replace all = with nothing) == "-Dscala.ext.dirs"
|
rem if "-Dscala.ext.dirs" (replace all = with nothing) == "-Dscala.ext.dirs"
|
||||||
rem (e.g. verify it doesn't have the = already)
|
rem (e.g. verify it doesn't have the = already)
|
||||||
if x%p:^==% == x%p% if not "%~1" == "" (
|
|
||||||
|
if "x%p:^==%" == "x%p%" if not "%~1" == "" (
|
||||||
echo %0=%1
|
echo %0=%1
|
||||||
shift
|
shift
|
||||||
goto echolist
|
goto echolist
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue