mirror of
https://github.com/actions/runner-images.git
synced 2026-01-03 16:49:11 +08:00
move source code to public
This commit is contained in:
78
images/macos/software-report/SoftwareReport.Xamarin.psm1
Normal file
78
images/macos/software-report/SoftwareReport.Xamarin.psm1
Normal file
@@ -0,0 +1,78 @@
|
||||
$sortRulesByVersion = @{
|
||||
Expression = { [System.Version]::Parse($_) }
|
||||
Descending = $true
|
||||
}
|
||||
|
||||
function Get-VSMacVersion {
|
||||
$plistPath = "/Applications/Visual Studio.app/Contents/Info.plist"
|
||||
return Run-Command "/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' '$plistPath'"
|
||||
}
|
||||
|
||||
function Get-NUnitVersion {
|
||||
$version = Run-Command "nunit3-console --version" | Select-Object -First 1 | Take-Part -Part 3
|
||||
return "NUnit ${version}"
|
||||
}
|
||||
|
||||
function Build-MonoList {
|
||||
$monoVersionsPath = "/Library/Frameworks/Mono.framework/Versions"
|
||||
$monoFolders = Get-ChildItemWithoutSymlinks $monoVersionsPath
|
||||
|
||||
$monoVersionList = $monoFolders | ForEach-Object {
|
||||
$versionFilePath = Join-Path $_.FullName "Version"
|
||||
if (Test-Path $versionFilePath) {
|
||||
return Get-Content -Raw $versionFilePath
|
||||
}
|
||||
|
||||
return $_.Name
|
||||
} | ForEach-Object { $_.Trim() }
|
||||
|
||||
return $monoVersionList | Sort-Object -Property $sortRulesByVersion
|
||||
}
|
||||
|
||||
function Build-XamarinIOSList {
|
||||
$sdkVersionsPath = "/Library/Frameworks/Xamarin.iOS.framework/Versions"
|
||||
$sdkFolders = Get-ChildItemWithoutSymlinks $sdkVersionsPath
|
||||
|
||||
$sdkVersionList = $sdkFolders | ForEach-Object {
|
||||
$versionFilePath = Join-Path $_.FullName "Version"
|
||||
if (Test-Path $versionFilePath) {
|
||||
return Get-Content -Raw $versionFilePath
|
||||
}
|
||||
|
||||
return $_.Name
|
||||
} | ForEach-Object { $_.Trim() }
|
||||
|
||||
return $sdkVersionList | Sort-Object -Property $sortRulesByVersion
|
||||
}
|
||||
|
||||
function Build-XamarinMacList {
|
||||
$sdkVersionsPath = "/Library/Frameworks/Xamarin.Mac.framework/Versions"
|
||||
$sdkFolders = Get-ChildItemWithoutSymlinks $sdkVersionsPath
|
||||
|
||||
$sdkVersionList = $sdkFolders | ForEach-Object {
|
||||
$versionFilePath = Join-Path $_.FullName "Version"
|
||||
if (Test-Path $versionFilePath) {
|
||||
return Get-Content -Raw $versionFilePath
|
||||
}
|
||||
|
||||
return $_.Name
|
||||
} | ForEach-Object { $_.Trim() }
|
||||
|
||||
return $sdkVersionList | Sort-Object -Property $sortRulesByVersion
|
||||
}
|
||||
|
||||
function Build-XamarinAndroidList {
|
||||
$sdkVersionsPath = "/Library/Frameworks/Xamarin.Android.framework/Versions"
|
||||
$sdkFolders = Get-ChildItemWithoutSymlinks $sdkVersionsPath
|
||||
|
||||
$sdkVersionList = $sdkFolders | ForEach-Object {
|
||||
$versionFilePath = Join-Path $_.FullName "Version"
|
||||
if (Test-Path $versionFilePath) {
|
||||
return Get-Content -Raw $versionFilePath
|
||||
}
|
||||
|
||||
return $_.Name
|
||||
} | ForEach-Object { $_.Trim() }
|
||||
|
||||
return $sdkVersionList | Sort-Object -Property $sortRulesByVersion
|
||||
}
|
||||
Reference in New Issue
Block a user