-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
28 lines (23 loc) · 919 Bytes
/
Copy pathbuild.ps1
File metadata and controls
28 lines (23 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$ErrorActionPreference = 'Stop'
$GradleVersion = '8.10.2'
$ProjectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$DistRoot = Join-Path $ProjectRoot '.gradle-dist'
$ZipPath = Join-Path $DistRoot "gradle-$GradleVersion-bin.zip"
$GradleRoot = Join-Path $DistRoot "gradle-$GradleVersion"
$GradleBat = Join-Path $GradleRoot 'bin\gradle.bat'
New-Item -ItemType Directory -Force -Path $DistRoot | Out-Null
if (-not (Test-Path $GradleBat)) {
if (-not (Test-Path $ZipPath)) {
$Url = "https://services.gradle.org/distributions/gradle-$GradleVersion-bin.zip"
Write-Host "Downloading Gradle $GradleVersion..."
Invoke-WebRequest -Uri $Url -OutFile $ZipPath
}
Write-Host "Extracting Gradle $GradleVersion..."
Expand-Archive -Path $ZipPath -DestinationPath $DistRoot -Force
}
Push-Location $ProjectRoot
try {
& $GradleBat --no-daemon clean build
} finally {
Pop-Location
}