Document environment variables of Win images (#2494)

* Document environment variables of Win images

* Change adnroid variables

* Apply reviews

* Remove some variables, fix headers

* Show link targets

* rename helper

* remove symlinks

* More links
This commit is contained in:
Sergey Dolin
2021-02-08 11:45:45 +05:00
committed by GitHub
parent 6beed71b4f
commit b169ce9de9
6 changed files with 86 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Helpers.psm1") -DisableNameChecking
function Split-TableRowByColumns {
param(
[string] $Row
@@ -156,3 +158,14 @@ function Get-AndroidGoogleAPIsVersions {
return ($versions -Join "<br>")
}
function Build-AndroidEnvironmentTable {
$androidVersions = Get-Item env:ANDROID_*
$shoulddResolveLink = 'ANDROID_NDK_PATH', 'ANDROID_NDK_HOME', 'ANDROID_NDK_ROOT', 'ANDROID_NDK_LATEST_HOME'
return $androidVersions | Sort-Object -Property Name | ForEach-Object {
[PSCustomObject] @{
"Name" = $_.Name
"Value" = if ($shoulddResolveLink.Contains($_.Name )) { Get-PathWithLink($_.Value) } else {$_.Value}
}
}
}

View File

@@ -52,4 +52,26 @@ function Get-SeleniumWebDriverVersion {
$versionFileName = "versioninfo.txt";
$webDriverVersion = Get-Content -Path "$driverPath\$versionFileName"
return "$driverName $webDriverVersion"
}
}
function Build-BrowserWebdriversEnvironmentTable {
return @(
@{
"Name" = "CHROMEWEBDRIVER"
"Value" = $env:CHROMEWEBDRIVER
},
@{
"Name" = "EDGEWEBDRIVER"
"Value" = $env:EDGEWEBDRIVER
},
@{
"Name" = "GECKOWEBDRIVER"
"Value" = $env:GECKOWEBDRIVER
}
) | ForEach-Object {
[PSCustomObject] @{
"Name" = $_.Name
"Value" = $_.Value
}
}
}

View File

@@ -114,4 +114,4 @@ function Build-CachedToolsMarkdown
$markdown += Get-PyPyMarkdown
return $markdown
}
}

View File

@@ -337,3 +337,22 @@ function Get-PipxVersion {
$pipxVersion = pipx --version
return "Pipx $pipxVersion"
}
function Build-PackageManagementEnvironmentTable {
return @(
@{
"Name" = "CONDA"
"Value" = $env:CONDA
},
@{
"Name" = "VCPKG_INSTALLATION_ROOT"
"Value" = $env:VCPKG_INSTALLATION_ROOT
}
) | ForEach-Object {
[PSCustomObject] @{
"Name" = $_.Name
"Value" = $_.Value
}
}
}

View File

@@ -58,6 +58,9 @@ $markdown += New-MDList -Style Unordered -Lines (@(
(Get-YarnVersion)
) | Sort-Object
)
$markdown += New-MDHeader "Environment variables" -Level 4
$markdown += Build-PackageManagementEnvironmentTable | New-MDTable
$markdown += New-MDNewLine
$markdown += New-MDHeader "Project Management" -Level 3
$markdown += New-MDList -Style Unordered -Lines (@(
@@ -150,6 +153,10 @@ $markdown += New-MDList -Style Unordered -Lines @(
(Get-SeleniumWebDriverVersion -Driver "iexplorer")
)
$markdown += New-MDHeader "Environment variables" -Level 4
$markdown += Build-BrowserWebdriversEnvironmentTable | New-MDTable
$markdown += New-MDNewLine
$markdown += New-MDHeader "Java" -Level 3
$markdown += Get-JavaVersions | New-MDTable
$markdown += New-MDNewLine
@@ -259,6 +266,9 @@ $markdown += New-MDNewLine
$markdown += New-MDHeader "Android" -Level 3
$markdown += Build-AndroidTable | New-MDTable
$markdown += New-MDNewLine
$markdown += New-MDHeader "Environment variables" -Level 4
$markdown += Build-AndroidEnvironmentTable | New-MDTable
$markdown += New-MDNewLine
# Docker images section
$markdown += New-MDHeader "Cached Docker images" -Level 3

View File

@@ -102,4 +102,23 @@ function New-MDNewLine {
)
$newLineSymbol = [System.Environment]::NewLine
return $newLineSymbol * $Count
}
}
function Get-LinkTarget {
param (
[string] $inputPath
)
$link = Get-Item $inputPath | Select-Object -ExpandProperty Target
if ($link) {
return " -> $link"
}
return ""
}
function Get-PathWithLink {
param (
[string] $inputPath
)
$link = Get-LinkTarget($inputPath)
return "${inputPath}${link}"
}