mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 12:48:18 +00:00
* Create ubuntu-report.yml * Update ubuntu-report.yml * Update ubuntu-report.yml * Update Common.Helpers.psm1 * Update ubuntu-report.yml * Update ubuntu-report.yml * Update SoftwareReport.Generator.ps1 * Update ubuntu-report.yml * Update ubuntu-report.yml * env vars * Implement language and runtime * Add package management section * fix typo * fix typo * add projectManagement and tools * fix some tools * add CLI tools, Java, PHP Tools, Haskell Tools, Rust Tools, Browsers, .NET Core * fix typo * more changes * fix typo * fix typo * fix typo * change templates * fix toolset * Update Ubuntu2004 and 2204 templates * fix cargo * fix tiny nitpicks * Fix AddToolVersionsList * Remove unused methods * Fix contructor
23 lines
1.1 KiB
PowerShell
23 lines
1.1 KiB
PowerShell
function Get-JavaVersionsTable {
|
|
$javaToolcacheVersions = Get-ChildItem $env:AGENT_TOOLSDIRECTORY/Java*/* -Directory | Sort-Object { [int]$_.Name.Split(".")[0] }
|
|
|
|
$existingVersions = $javaToolcacheVersions | ForEach-Object {
|
|
$majorVersion = $_.Name.split(".")[0]
|
|
$fullVersion = $_.Name.Replace("-", "+")
|
|
$defaultJavaPath = $env:JAVA_HOME
|
|
$javaPath = Get-Item env:JAVA_HOME_${majorVersion}_X64
|
|
|
|
$defaultPostfix = ($javaPath.Value -eq $defaultJavaPath) ? " (default)" : ""
|
|
$vendorName = ($_.FullName -like '*Java_Adopt_jdk*') ? "Adopt OpenJDK" : "Eclipse Temurin"
|
|
|
|
[PSCustomObject] @{
|
|
"Version" = $fullVersion + $defaultPostfix
|
|
"Vendor" = $vendorName
|
|
"Environment Variable" = $javaPath.Name
|
|
}
|
|
}
|
|
# Return all the vendors which are not Adopt, also look for version 12 of Adopt (Eclipse Temurin does not have this version)
|
|
$versionsToReturn = $existingVersions | Where-Object {$_.Vendor -notlike "Adopt*" -or $_.Version.Split(".")[0] -eq 12}
|
|
return $versionsToReturn
|
|
}
|