12 lines
789 B
Batchfile
12 lines
789 B
Batchfile
@echo off
|
|||
|
|
setlocal
|
||
|
|
set "GRADLE_VERSION=8.9"
|
||
|
|
set "INSTALL_ROOT=%USERPROFILE%\.gradle\manual-wrapper\gradle-%GRADLE_VERSION%"
|
||
|
|
set "GRADLE_BIN=%INSTALL_ROOT%\gradle-%GRADLE_VERSION%\bin\gradle.bat"
|
||
|
|
if not exist "%GRADLE_BIN%" (
|
||
|
|
echo Gradle %GRADLE_VERSION% 尚未安装,正在下载……
|
||
|
|
powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $root='%INSTALL_ROOT%'; New-Item -ItemType Directory -Force -Path $root | Out-Null; $zip=Join-Path $root 'gradle-%GRADLE_VERSION%-bin.zip'; Invoke-WebRequest -Uri 'https://services.gradle.org/distributions/gradle-%GRADLE_VERSION%-bin.zip' -OutFile $zip; Expand-Archive -Path $zip -DestinationPath $root -Force; Remove-Item $zip -Force"
|
||
|
|
if errorlevel 1 exit /b 1
|
||
|
|
)
|
||
|
|
call "%GRADLE_BIN%" %*
|
||
|
|
exit /b %ERRORLEVEL%
|