Last active
February 9, 2024 12:04
-
-
Save MiloszKrajewski/e11643ab398f45fdb83f69ad552306a5 to your computer and use it in GitHub Desktop.
Bootstrap script for ANTLR 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dp0 = $PSScriptRoot | |
$version = '4.13.1' | |
$jar = "antlr-$version-complete.jar" | |
$url = "https://www.antlr.org/download/$jar" | |
if (-not (Test-Path "$dp0/$jar")) { | |
Invoke-WebRequest -Uri $url -OutFile "$dp0/$jar" | |
} | |
$JAVA_PATH = $env:JAVA_HOME_11 ?? $env:JAVA_HOME | |
$JAVA_EXEC = ($null -eq $JAVA_PATH) ? "java" : "$JAVA_PATH\bin\java.exe" | |
Write-Host -ForegroundColor Green ">>> $JAVA_EXEC -jar $dp0/$jar $args" | |
& "$JAVA_EXEC" "-version" | |
& "$JAVA_EXEC" "-jar" "$dp0/$jar" $args |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment