mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 21:38:13 +00:00
[Windows] Replace '+' to '-' in java path (#3028)
* Replace + to - in Java path * Fix comment * fix vendor name in software report
This commit is contained in:
@@ -61,7 +61,8 @@ function Install-JavaFromAdoptOpenJDK {
|
|||||||
-and $_.binary.image_type -eq "jdk"
|
-and $_.binary.image_type -eq "jdk"
|
||||||
}
|
}
|
||||||
$downloadUrl = $asset.binary.package.link
|
$downloadUrl = $asset.binary.package.link
|
||||||
$fullJavaVersion = $asset.version.semver
|
# We have to replace '+' sign in the version to '-' due to the issue with incorrect path in Android builds https://github.com/actions/virtual-environments/issues/3014
|
||||||
|
$fullJavaVersion = $asset.version.semver -replace '\+', '-'
|
||||||
|
|
||||||
# Download and extract java binaries to temporary folder
|
# Download and extract java binaries to temporary folder
|
||||||
$archivePath = Start-DownloadWithRetry -Url $downloadUrl -Name $([IO.Path]::GetFileName($downloadUrl))
|
$archivePath = Start-DownloadWithRetry -Url $downloadUrl -Name $([IO.Path]::GetFileName($downloadUrl))
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ function Get-JavaVersions {
|
|||||||
return $javaVersions | Sort-Object $sortRules | ForEach-Object {
|
return $javaVersions | Sort-Object $sortRules | ForEach-Object {
|
||||||
$javaPath = $_.Value
|
$javaPath = $_.Value
|
||||||
# Take semver from the java path
|
# Take semver from the java path
|
||||||
$version = (Split-Path $javaPath) -replace "\w:\\.*\\"
|
# The path contains '-' sign in the version number instead of '+' due to the following issue, need to substitute it back https://github.com/actions/virtual-environments/issues/3014
|
||||||
|
$versionInPath = (Split-Path $javaPath) -replace "\w:\\.*\\"
|
||||||
|
$version = $versionInPath -replace '-', '+'
|
||||||
$defaultPostfix = ($javaPath -eq $defaultJavaPath) ? " (default)" : ""
|
$defaultPostfix = ($javaPath -eq $defaultJavaPath) ? " (default)" : ""
|
||||||
|
|
||||||
[PSCustomObject] @{
|
[PSCustomObject] @{
|
||||||
|
|||||||
Reference in New Issue
Block a user