Skip to content
This repository has been archived by the owner on Apr 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #98 from DarrenBishop/master
Browse files Browse the repository at this point in the history
-jvm-debug for Windows launch script
  • Loading branch information
eed3si9n committed Feb 22, 2016
2 parents 7fd6bee + dc4a56c commit a4a3234
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/universal/bin/sbt.bat
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,34 @@ rem We use the value of the JAVA_OPTS environment variable if defined, rather th
set _JAVA_OPTS=%JAVA_OPTS%
if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%

:run
FOR %%a IN (%*) DO (
if "%%a" == "-jvm-debug" (
set JVM_DEBUG=true
set /a JVM_DEBUG_PORT=5005 2>nul >nul
) else if "!JVM_DEBUG!" == "true" (
set /a JVM_DEBUG_PORT=%%a 2>nul >nul
if not "%%a" == "!JVM_DEBUG_PORT!" (
set SBT_ARGS=!SBT_ARGS! %%a
)
) else (
set SBT_ARGS=!SBT_ARGS! %%a
)
)

if defined JVM_DEBUG_PORT (
set _JAVA_OPTS=!_JAVA_OPTS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=!JVM_DEBUG_PORT!
)

call :run %SBT_ARGS%

"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
if ERRORLEVEL 1 goto error
goto end

:run

"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
goto :eof

:error
@endlocal
exit /B 1
Expand Down

0 comments on commit a4a3234

Please sign in to comment.