< prev index next >

gradlew.bat

Print this page

 4 rem
 5 rem This code is free software; you can redistribute it and/or modify it
 6 rem under the terms of the GNU General Public License version 2 only, as
 7 rem published by the Free Software Foundation.
 8 rem
 9 rem This code is distributed in the hope that it will be useful, but WITHOUT
10 rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 rem version 2 for more details (a copy is included in the LICENSE file that
13 rem accompanied this code).
14 rem
15 rem You should have received a copy of the GNU General Public License version
16 rem 2 along with this work; if not, write to the Free Software Foundation,
17 rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 rem
19 rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 rem or visit www.oracle.com if you need additional information or have any
21 rem questions.
22 
23 for /f "tokens=1,2 delims==" %%A in (deps.env) do (set %%A=%%~B)
24 for /f %%i in ("%JDK_WINDOWS_URL%") do set JDK_WINDOWS_DIR=%%~ni
25 for /f %%i in ("%GRADLE_URL%") do set GRADLE_DIR=%%~ni
26 
27 if exist %~dp0\.jdk\%JDK_WINDOWS_DIR% goto gradle
28 
29 echo Downloading JDK...
30 mkdir %~dp0\.jdk\temp
31 curl -L %JDK_WINDOWS_URL% -o %JDK_WINDOWS_DIR%.zip
32 move %JDK_WINDOWS_DIR%.zip %~dp0\.jdk\
33 for /f "tokens=*" %%i in ('@certutil -hashfile %~dp0/.jdk/%JDK_WINDOWS_DIR%.zip sha256 ^| %WINDIR%\System32\find /v "hash of file" ^| %WINDIR%\System32\find /v "CertUtil"') do set SHA256JDK=%%i
34 if "%SHA256JDK%" == "%JDK_WINDOWS_SHA256%" (goto extractJdk)
35 echo Invalid SHA256 for JDK detected (%SHA256JDK%)
36 goto done
37 
38 :extractJdk
39 echo Extracting JDK...
40 %WINDIR%\System32\tar -xf %~dp0/.jdk/%JDK_WINDOWS_DIR%.zip -C %~dp0/.jdk/temp
41 for /d %%i in (%~dp0\.jdk\temp\*) do move %%i %~dp0\.jdk\%JDK_WINDOWS_DIR%
42 rmdir %~dp0\.jdk\temp
43 
44 :gradle
45 if exist %~dp0\.gradle\%GRADLE_DIR% goto run
46 
47 echo Downloading Gradle...
48 mkdir %~dp0\.gradle\temp
49 curl -L %GRADLE_URL% -o %GRADLE_DIR%.zip
50 move %GRADLE_DIR%.zip %~dp0\.gradle\
51 for /f "tokens=*" %%i in ('@certutil -hashfile %~dp0/.gradle/%GRADLE_DIR%.zip sha256 ^| %WINDIR%\System32\find /v "hash of file" ^| %WINDIR%\System32\find /v "CertUtil"') do set SHA256GRADLE=%%i

 4 rem
 5 rem This code is free software; you can redistribute it and/or modify it
 6 rem under the terms of the GNU General Public License version 2 only, as
 7 rem published by the Free Software Foundation.
 8 rem
 9 rem This code is distributed in the hope that it will be useful, but WITHOUT
10 rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 rem version 2 for more details (a copy is included in the LICENSE file that
13 rem accompanied this code).
14 rem
15 rem You should have received a copy of the GNU General Public License version
16 rem 2 along with this work; if not, write to the Free Software Foundation,
17 rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 rem
19 rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 rem or visit www.oracle.com if you need additional information or have any
21 rem questions.
22 
23 for /f "tokens=1,2 delims==" %%A in (deps.env) do (set %%A=%%~B)
24 for /f %%i in ("%JDK_WINDOWS_X64_URL%") do set JDK_WINDOWS_DIR=%%~ni
25 for /f %%i in ("%GRADLE_URL%") do set GRADLE_DIR=%%~ni
26 
27 if exist %~dp0\.jdk\%JDK_WINDOWS_DIR% goto gradle
28 
29 echo Downloading JDK...
30 mkdir %~dp0\.jdk\temp
31 curl -L %JDK_WINDOWS_X64_URL% -o %JDK_WINDOWS_DIR%.zip
32 move %JDK_WINDOWS_DIR%.zip %~dp0\.jdk\
33 for /f "tokens=*" %%i in ('@certutil -hashfile %~dp0/.jdk/%JDK_WINDOWS_DIR%.zip sha256 ^| %WINDIR%\System32\find /v "hash of file" ^| %WINDIR%\System32\find /v "CertUtil"') do set SHA256JDK=%%i
34 if "%SHA256JDK%" == "%JDK_WINDOWS_SHA256%" (goto extractJdk)
35 echo Invalid SHA256 for JDK detected (%SHA256JDK%)
36 goto done
37 
38 :extractJdk
39 echo Extracting JDK...
40 %WINDIR%\System32\tar -xf %~dp0/.jdk/%JDK_WINDOWS_DIR%.zip -C %~dp0/.jdk/temp
41 for /d %%i in (%~dp0\.jdk\temp\*) do move %%i %~dp0\.jdk\%JDK_WINDOWS_DIR%
42 rmdir %~dp0\.jdk\temp
43 
44 :gradle
45 if exist %~dp0\.gradle\%GRADLE_DIR% goto run
46 
47 echo Downloading Gradle...
48 mkdir %~dp0\.gradle\temp
49 curl -L %GRADLE_URL% -o %GRADLE_DIR%.zip
50 move %GRADLE_DIR%.zip %~dp0\.gradle\
51 for /f "tokens=*" %%i in ('@certutil -hashfile %~dp0/.gradle/%GRADLE_DIR%.zip sha256 ^| %WINDIR%\System32\find /v "hash of file" ^| %WINDIR%\System32\find /v "CertUtil"') do set SHA256GRADLE=%%i
< prev index next >