Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle 8.11 install scripts #9

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install deps
run: apt update && apt install -y sudo wget curl openjdk-17-jdk
- name: Install Gradle
run: sudo bash ./.tools/installGradle-8.10.2.sh
run: sudo bash ./.tools/installGradle-8.11.sh
- name: Check Gradle
run: gradle --version
install-gradle-windows-test:
Expand All @@ -42,7 +42,7 @@ jobs:
}
- name: Install Gradle
shell: pwsh
run: .tools/installGradle-8.10.2.ps1
run: .tools/installGradle-8.11.ps1
- name: Refresh environment
shell: pwsh
run: |
Expand Down
33 changes: 0 additions & 33 deletions .tools/installGradle-8.10.1.ps1

This file was deleted.

3 changes: 0 additions & 3 deletions .tools/installGradle-8.10.2.bat

This file was deleted.

34 changes: 0 additions & 34 deletions .tools/installGradle-8.10.2.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
powershell.exe -ExecutionPolicy Bypass -File "%~dp0installGradle-8.10.1.ps1"
powershell.exe -ExecutionPolicy Bypass -File "%~dp0installGradle-8.11.ps1"
pause
28 changes: 23 additions & 5 deletions .tools/installGradle-8.10.2.ps1 → .tools/installGradle-8.11.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set Gradle version
$GRADLE_VERSION = "8.10.2"
$GRADLE_VERSION = "8.11"

# Set installation directory
$INSTALL_DIR = "C:\Gradle"
Expand All @@ -15,16 +15,34 @@ if (-Not (Test-Path $INSTALL_DIR)) {

# Extract Gradle
Write-Host "Extracting Gradle..."
Expand-Archive -Path "gradle.zip" -DestinationPath $INSTALL_DIR
Expand-Archive -Path "gradle.zip" -DestinationPath $INSTALL_DIR -ErrorAction SilentlyContinue

$GRADLE_HOME = "$INSTALL_DIR\gradle-$GRADLE_VERSION"

# Set GRADLE_HOME environment variable
[Environment]::SetEnvironmentVariable("GRADLE_HOME", "$GRADLE_HOME", [EnvironmentVariableTarget]::Machine)

# Add Gradle to PATH
$env:Path += ";$GRADLE_HOME\bin"
[Environment]::SetEnvironmentVariable("Path", $env:Path, [EnvironmentVariableTarget]::Machine)
# Get the current PATH
$currentPath = [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)

# Split the PATH into an array
$pathArray = $currentPath -split ";"

# Filter out any entries matching the Gradle\bin pattern (case-insensitive)
$gradleBinRegex = "^.*gradle.*$"
$newPathArray = $pathArray | Where-Object { $_ -notmatch $gradleBinRegex -and $_ -ne "" }

# Join the array back into a string
$newPath = $newPathArray -join ";"

# Add the new Gradle\bin directory
$newPath += ";$GRADLE_HOME\bin"

# Set the new PATH
[Environment]::SetEnvironmentVariable("Path", $newPath, [EnvironmentVariableTarget]::Machine)

# Optionally, update the current session's PATH
$env:Path = $newPath

# Clean up
Remove-Item "gradle.zip"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Set Gradle version
GRADLE_VERSION="8.10.1"
GRADLE_VERSION="8.11"

# Set installation directory
INSTALL_DIR="/opt/gradle"
Expand Down