gradlew.bat 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. @if "%DEBUG%" == "" @echo off
  2. @rem ##########################################################################
  3. @rem ##
  4. @rem Gradle startup script for Windows ##
  5. @rem ##
  6. @rem ##########################################################################
  7. @rem Set local scope for the variables with windows NT shell
  8. if "%OS%"=="Windows_NT" setlocal
  9. @rem Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
  10. @rem set GRADLE_OPTS=%GRADLE_OPTS% -Xmx512m
  11. @rem set JAVA_OPTS=%JAVA_OPTS% -Xmx512m
  12. set DIRNAME=%~dp0
  13. if "%DIRNAME%" == "" set DIRNAME=.\
  14. @rem Find java.exe
  15. set JAVA_EXE=java.exe
  16. if not defined JAVA_HOME goto init
  17. set JAVA_HOME=%JAVA_HOME:"=%
  18. set JAVA_EXE=%JAVA_HOME%/bin/java.exe
  19. if exist "%JAVA_EXE%" goto init
  20. echo.
  21. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
  22. echo.
  23. echo Please set the JAVA_HOME variable in your environment to match the
  24. echo location of your Java installation.
  25. echo.
  26. goto end
  27. :init
  28. @rem Get command-line arguments, handling Windowz variants
  29. if not "%OS%" == "Windows_NT" goto win9xME_args
  30. if "%eval[2+2]" == "4" goto 4NT_args
  31. :win9xME_args
  32. @rem Slurp the command line arguments.
  33. set CMD_LINE_ARGS=
  34. set _SKIP=2
  35. :win9xME_args_slurp
  36. if "x%~1" == "x" goto execute
  37. set CMD_LINE_ARGS=%*
  38. goto execute
  39. :4NT_args
  40. @rem Get arguments from the 4NT Shell from JP Software
  41. set CMD_LINE_ARGS=%$
  42. :execute
  43. @rem Setup the command line
  44. set STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
  45. set CLASSPATH=%DIRNAME%\gradle\wrapper\gradle-wrapper.jar
  46. set WRAPPER_PROPERTIES=%DIRNAME%\gradle\wrapper\gradle-wrapper.properties
  47. set GRADLE_OPTS=%JAVA_OPTS% %GRADLE_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%"
  48. @rem Execute Gradle
  49. "%JAVA_EXE%" %GRADLE_OPTS% -classpath "%CLASSPATH%" %STARTER_MAIN_CLASS% %CMD_LINE_ARGS%
  50. :end
  51. @rem End local scope for the variables with windows NT shell
  52. if "%ERRORLEVEL%"=="0" goto mainEnd
  53. if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1
  54. rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
  55. rem the _cmd.exe /c_ return code!
  56. if not "" == "%GRADLE_EXIT_CONSOLE%" exit "%ERRORLEVEL%"
  57. exit /b "%ERRORLEVEL%"
  58. :mainEnd
  59. if "%OS%"=="Windows_NT" endlocal
  60. :omega