gradlew.bat 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. @if "%DEBUG%" == "" @echo off
  2. @rem ##########################################################################
  3. @rem ##
  4. @rem Gradle startup script for Windows ##
  5. @rem ##
  6. @rem ##########################################################################
  7. @rem
  8. @rem $Revision: 10602 $ $Date: 2008-01-25 02:49:54 +0100 (ven., 25 janv. 2008) $
  9. @rem
  10. @rem Set local scope for the variables with windows NT shell
  11. if "%OS%"=="Windows_NT" setlocal
  12. @rem Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
  13. @rem set GRADLE_OPTS=%GRADLE_OPTS% -Xmx512
  14. @rem set JAVA_OPTS=%JAVA_OPTS% -Xmx512
  15. set DIRNAME=%~dp0
  16. if "%DIRNAME%" == "" set DIRNAME=.\
  17. @rem Determine the command interpreter to execute the "CD" later
  18. set COMMAND_COM="cmd.exe"
  19. if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
  20. if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"
  21. @rem Use explicit find.exe to prevent cygwin and others find.exe from being used
  22. set FIND_EXE="find.exe"
  23. if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
  24. if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"
  25. :check_JAVA_HOME
  26. @rem Make sure we have a valid JAVA_HOME
  27. if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
  28. echo.
  29. echo ERROR: Environment variable JAVA_HOME has not been set.
  30. echo.
  31. echo Please set the JAVA_HOME variable in your environment to match the
  32. echo location of your Java installation.
  33. echo.
  34. goto end
  35. :have_JAVA_HOME
  36. @rem Validate JAVA_HOME
  37. %COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
  38. if not errorlevel 1 goto init
  39. echo.
  40. echo ERROR: JAVA_HOME might be set to an invalid directory: %JAVA_HOME%
  41. echo.
  42. echo Please set the JAVA_HOME variable in your environment to match the
  43. echo location of your Java installation if there are problems.
  44. echo.
  45. :init
  46. @rem get name of script to launch with full path
  47. @rem Get command-line arguments, handling Windowz variants
  48. SET _marker=%JAVA_HOME: =%
  49. @rem IF NOT "%_marker%" == "%JAVA_HOME%" ECHO JAVA_HOME "%JAVA_HOME%" contains spaces. Please change to a location without spaces if this causes problems.
  50. if not "%OS%" == "Windows_NT" goto win9xME_args
  51. if "%eval[2+2]" == "4" goto 4NT_args
  52. IF "%_marker%" == "%JAVA_HOME%" goto :win9xME_args
  53. set _FIXPATH=
  54. call :fixpath "%JAVA_HOME%"
  55. set JAVA_HOME=%_FIXPATH:~1%
  56. goto win9xME_args
  57. :fixpath
  58. if not %1.==. (
  59. for /f "tokens=1* delims=;" %%a in (%1) do (
  60. call :shortfilename "%%a" & call :fixpath "%%b"
  61. )
  62. )
  63. goto :EOF
  64. :shortfilename
  65. for %%i in (%1) do set _FIXPATH=%_FIXPATH%;%%~fsi
  66. goto :EOF
  67. :win9xME_args
  68. @rem Slurp the command line arguments.
  69. set CMD_LINE_ARGS=
  70. set _SKIP=2
  71. :win9xME_args_slurp
  72. if "x%~1" == "x" goto execute
  73. set CMD_LINE_ARGS=%*
  74. goto execute
  75. :4NT_args
  76. @rem Get arguments from the 4NT Shell from JP Software
  77. set CMD_LINE_ARGS=%$
  78. :execute
  79. @rem Setup the command line
  80. set STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
  81. set CLASSPATH=%DIRNAME%\gradle\wrapper\gradle-wrapper.jar
  82. set WRAPPER_PROPERTIES=%DIRNAME%\gradle\wrapper\gradle-wrapper.properties
  83. set JAVA_EXE=%JAVA_HOME%\bin\java.exe
  84. set GRADLE_OPTS=%JAVA_OPTS% %GRADLE_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%"
  85. "%JAVA_EXE%" %GRADLE_OPTS% -classpath "%CLASSPATH%" %STARTER_MAIN_CLASS% %CMD_LINE_ARGS%
  86. :end
  87. @rem End local scope for the variables with windows NT shell
  88. if "%ERRORLEVEL%"=="0" goto mainEnd
  89. if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1
  90. rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
  91. rem the _cmd.exe /c_ return code!
  92. if not "" == "%GRADLE_EXIT_CONSOLE%" exit "%ERRORLEVEL%"
  93. exit /b "%ERRORLEVEL%"
  94. :mainEnd
  95. if "%OS%"=="Windows_NT" endlocal
  96. :omega