mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
[macOS] Rework Xamarin documentation (#3113)
* reworked xamarin documentation * added condition for defaultSymlink variable * removed sorting of xamarin bundles Co-authored-by: Nikita Bykov <v-nibyko@microsoft.com>
This commit is contained in:
@@ -236,17 +236,9 @@ $markdown += New-MDHeader "Xamarin" -Level 3
|
||||
$markdown += New-MDHeader "Visual Studio for Mac" -Level 4
|
||||
$markdown += New-MDList -Lines @(Get-VSMacVersion) -Style Unordered
|
||||
|
||||
$markdown += New-MDHeader "Mono" -Level 4
|
||||
$markdown += New-MDList -Lines (Build-MonoList) -Style Unordered
|
||||
|
||||
$markdown += New-MDHeader "Xamarin.iOS" -Level 4
|
||||
$markdown += New-MDList -Lines (Build-XamarinIOSList) -Style Unordered
|
||||
|
||||
$markdown += New-MDHeader "Xamarin.Mac" -Level 4
|
||||
$markdown += New-MDList -Lines (Build-XamarinMacList) -Style Unordered
|
||||
|
||||
$markdown += New-MDHeader "Xamarin.Android" -Level 4
|
||||
$markdown += New-MDList -Lines (Build-XamarinAndroidList) -Style Unordered
|
||||
$markdown += New-MDHeader "Xamarin bundles" -Level 4
|
||||
$markdown += Build-XamarinTable | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
|
||||
$markdown += New-MDHeader "Unit Test Framework" -Level 4
|
||||
$markdown += New-MDList -Lines @(Get-NUnitVersion) -Style Unordered
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
$sortRulesByVersion = @{
|
||||
Expression = { [System.Version]::Parse($_) }
|
||||
Descending = $true
|
||||
}
|
||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||
|
||||
function Get-VSMacVersion {
|
||||
$plistPath = "/Applications/Visual Studio.app/Contents/Info.plist"
|
||||
@@ -13,66 +10,22 @@ function Get-NUnitVersion {
|
||||
return "NUnit ${version}"
|
||||
}
|
||||
|
||||
function Build-MonoList {
|
||||
$monoVersionsPath = "/Library/Frameworks/Mono.framework/Versions"
|
||||
$monoFolders = Get-ChildItemWithoutSymlinks $monoVersionsPath
|
||||
function Build-XamarinTable {
|
||||
$xamarinBundles = Get-ToolsetValue "xamarin.bundles"
|
||||
$defaultSymlink = Get-ToolsetValue "xamarin.bundle-default"
|
||||
if ($defaultSymlink -eq "latest") {
|
||||
$defaultSymlink = $xamarinBundles[0].symlink
|
||||
}
|
||||
|
||||
$monoVersionList = $monoFolders | ForEach-Object {
|
||||
$versionFilePath = Join-Path $_.FullName "Version"
|
||||
if (Test-Path $versionFilePath) {
|
||||
return Get-Content -Raw $versionFilePath
|
||||
return $xamarinBundles | ForEach-Object {
|
||||
$defaultPostfix = ($_.symlink -eq $defaultSymlink ) ? " (default)" : ""
|
||||
[PSCustomObject] @{
|
||||
"symlink" = $_.symlink + $defaultPostfix
|
||||
"Xamarin.Mono" = $_.mono
|
||||
"Xamarin.iOS" = $_.ios
|
||||
"Xamarin.Mac" = $_.mac
|
||||
"Xamarin.Android" = $_.android
|
||||
}
|
||||
|
||||
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