From dd12c1ae214001bb4df3c10dbbfe220dde52ea32 Mon Sep 17 00:00:00 2001 From: Nikita Bykov <49442273+nikita-bykov@users.noreply.github.com> Date: Mon, 28 Dec 2020 11:15:54 +0300 Subject: [PATCH] Rework MacOS documentation (#2336) * rework macOS documentation * resolved comments * fixed function name * Updated SoftwareReport.Common.psm1 and SoftwareReport.Generator.ps1 * fixed name Co-authored-by: Nikita Bykov --- .../SoftwareReport.Common.psm1 | 327 +++++++++++++++++- .../SoftwareReport.Generator.ps1 | 221 ++++-------- .../software-report/SoftwareReport.Xcode.psm1 | 5 + 3 files changed, 399 insertions(+), 154 deletions(-) diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index ab452cd57..abd8947bb 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -17,7 +17,7 @@ function Get-GoVersion { $goOutput = $goOutput.Substring(2) } - return $goOutput + return "Go $goOutput" } function Get-RVersion { @@ -26,7 +26,7 @@ function Get-RVersion { } function Get-RustVersion { $rustVersion = Run-Command "rustc --version" | Take-Part -Part 1 - return "${rustVersion}" + return "Rust $rustVersion" } function Get-Bindgen { @@ -89,7 +89,7 @@ function Get-NVMVersion { $nvmPath = Join-Path $env:HOME ".nvm" "nvm.sh" $nvmInitCommand = ". ${nvmPath} > /dev/null 2>&1 || true" $nodejsVersion = Run-Command "${nvmInitCommand} && nvm --version" - return $nodejsVersion + return "NVM $nodejsVersion" } function Get-PipVersion { @@ -103,7 +103,7 @@ function Get-PipVersion { $versionPart1 = $commandOutput | Take-Part -Part 1 $versionPart2 = $commandOutput | Take-Part -Part 4 $versionPart3 = $commandOutput | Take-Part -Part 5 - return "${versionPart1} ${versionPart2} ${versionPart3}" + return "Pip ${versionPart1} ${versionPart2} ${versionPart3}" } function Get-PipxVersion { @@ -116,7 +116,8 @@ function Get-NVMNodeVersionList { $nvmInitCommand = ". ${nvmPath} > /dev/null 2>&1 || true" $nodejsVersionsRaw = Run-Command "${nvmInitCommand} && nvm ls" $nodeVersions = $nodejsVersionsRaw | ForEach-Object { $_.TrimStart(" ").TrimEnd(" *") } | Where-Object { $_.StartsWith("v") } - return [string]::Join(" ", $nodeVersions) + $result = [string]::Join(" ", $nodeVersions) + return "NVM - Cached node versions: $result" } function Build-OSInfoSection { @@ -129,4 +130,320 @@ function Build-OSInfoSection { $output += New-MDHeader "macOS $version info" -Level 1 $output += New-MDList -Style Unordered -Lines $parsedSystemInfo -NoNewLine return $output +} + +function Get-PHPVersion { + $PHPVersion = Run-Command "php --version" | Select-Object -First 1 | Take-Part -Part 0,1 + return $PHPVersion +} + +function Get-NodeVersion { + $nodeVersion = Run-Command "node --version" + return "Node.js $nodeVersion" +} + +function Get-PythonVersion { + $pythonVersion = Run-Command "python --version" + return $pythonVersion +} + +function Get-Python3Version { + $python3Version = Run-Command "python3 --version" + return $python3Version +} + +function Get-RubyVersion { + $rubyVersion = Run-Command "ruby --version" | Take-Part -Part 1 + return "Ruby $rubyVersion" +} + +function Get-PHPVersion { + $PHPVersion = Run-Command "php --version" | Select-Object -First 1 | Take-Part -Part 0,1 + return $PHPVersion +} + +function Get-JuliaVersion { + $juliaVersion = Run-Command "julia --version" | Take-Part -Part 0,2 + return $juliaVersion +} + +function Get-BundlerVersion { + $bundlerVersion = Run-Command "bundle --version" + return $bundlerVersion +} + +function Get-CarthageVersion { + $carthageVersion = Run-Command "carthage version" -SuppressStderr + return "Carthage $carthageVersion" +} + +function Get-CocoaPodsVersion { + $cocoaPodsVersion = Run-Command "pod --version" + return "CocoaPods $cocoaPodsVersion" +} + +function Get-HomebrewVersion { + $homebrewVersion = Run-Command "brew --version" | Select-Object -First 1 + return $homebrewVersion +} + +function Get-NPMVersion { + $NPMVersion = Run-Command "npm --version" + return "NPM $NPMVersion" +} + +function Get-YarnVersion { + $yarmVersion = Run-Command "yarn --version" + return "Yarn $yarmVersion" +} + +function Get-NuGetVersion { + $nugetVersion = Run-Command "nuget help" | Select-Object -First 1 | Take-Part -Part 2 + return "NuGet $nugetVersion" +} + +function Get-CondaVersion { + $condaVersion = Invoke-Expression "conda --version" + return "Mini$condaVersion" +} + +function Get-RubyGemsVersion { + $rubyGemsVersion = Run-Command "gem --version" + return "RubyGems $rubyGemsVersion" +} + +function Get-ComposerVersion { + $composerVersion = Run-Command "composer --version" | Take-Part -Part 2 + return "Composer $composerVersion" +} + +function Get-MavenVersion { + $mavenVersion = Run-Command "mvn -version" | Select-Object -First 1 | Take-Part -Part 2 + return "Apache Maven $mavenVersion" +} + +#gradle output differs on the first launch – a welcome message, that we don't need is rendered. The solution is to take the last "Gradle" occurrence from the output +function Get-GradleVersion { + $gradleVersion = (Run-Command "gradle --version" | Select-String "Gradle")[-1] + return $gradleVersion +} + +function Get-ApacheAntVersion { + $apacheAntVersion = Run-Command "ant -version" | Take-Part -Part 0,1,3 + return $apacheAntVersion +} + +function Get-CurlVersion { + $curlVersion = Run-Command "curl --version" | Select-Object -First 1 | Take-Part -Part 1 + return "Curl $curlVersion" +} + +function Get-GitVersion { + $gitVersion = Run-Command "git --version" | Take-Part -Part 2 + return "Git: $gitVersion" +} + +function Get-GitLFSVersion { + $gitLFSVersion = Run-Command "git-lfs version" | Take-Part -Part 0 | Take-Part -Part 1 -Delimiter "/" + return "Git LFS: $gitLFSVersion" +} + +function Get-GitHubCLIVersion { + $ghVersion = Run-Command "gh --version" | Select-String "gh version" | Select-Object -First 1 | Take-Part -Part 2 + return "GitHub CLI: $ghVersion" +} + +function Get-HubVersion { + $hubVersion = Run-Command "brew list --versions hub" | Take-Part -Part 1 + return "Hub CLI: $hubVersion" +} + +function Get-WgetVersion { + $wgetVersion = Run-Command "wget --version" | Select-String "GNU Wget" | Take-Part -Part 2 + return "GNU Wget $wgetVersion" +} + +function Get-SVNVersion { + $svnVersion = Run-Command "svn --version --quiet" + return "Subversion (SVN) $svnVersion" +} + +function Get-PackerVersion { + $packerVersion = Run-Command "packer --version" + return "Packer $packerVersion" +} + +function Get-OpenSSLVersion { + $opensslVersion = Get-Item /usr/local/opt/openssl | ForEach-Object {"{0} ``({1} -> {2})``" -f (Run-Command "openssl version"), $_.FullName, $_.Target} + return $opensslVersion +} + +function Get-JqVersion { + $jqVersion = Run-Command "jq --version" | Take-Part -Part 1 -Delimiter "-" + return "jq $jqVersion" +} + +function Get-GPGVersion { + $gpgVersion = Run-Command "gpg --version" | Select-String 'gpg (GnuPG)' -SimpleMatch + return $gpgVersion +} + +function Get-PostgresClientVersion { + $postgresClientVersion = Run-Command "psql --version" + return $postgresClientVersion +} + +function Get-PostgresServerVersion { + $postgresServerVersion = Run-Command "pg_config --version" + return $postgresServerVersion +} + +function Get-Aria2Version { + $aria2Version = Run-Command "aria2c --version" | Select-Object -First 1 | Take-Part -Part 2 + return "aria2 $aria2Version" +} + +function Get-AzcopyVersion { + $azcopyVersion = Run-Command "azcopy --version" | Take-Part -Part 2 + return "azcopy $azcopyVersion" +} + +function Get-ZstdVersion { + $zstdVersion = Run-Command "zstd --version" | Take-Part -Part 1 -Delimiter "v" | Take-Part -Part 0 -Delimiter "," + return "zstd $zstdVersion" +} + +function Get-BazelVersion { + $bazelVersion = Run-Command "bazel --version" | Take-Part -Part 0 -Delimiter "-" + return $bazelVersion +} + +function Get-BazeliskVersion { + $bazeliskVersion = Run-Command "brew list bazelisk --versions" + return $bazeliskVersion +} + +function Get-HelmVersion { + $helmVersion = Run-Command "helm version --short" + return "helm $helmVersion" +} + +function Get-MongoVersion { + $mongo = Run-Command "mongo --version" | Select-String "MongoDB shell version" | Take-Part -Part 3 + return "mongo $mongo" +} + +function Get-MongodVersion { + $mongod = Run-Command "mongod --version" | Select-String "db version " | Take-Part -Part 2 + return "mongod $mongod" +} + +function Get-7zipVersion { + $7zip = Run-Command "7z i" | Select-String "7-Zip" | Take-Part -Part 0,2 + return $7zip +} + +function Get-GnuTarVersion { + $gnuTar = Run-Command "gtar --version" | Select-String "tar" | Take-Part -Part 3 + return "GNU Tar $gnuTar - available by 'gtar' alias" +} + +function Get-BsdtarVersion { + $bsdtar = Run-Command "tar --version" | Take-Part -Part 1 + return "bsdtar $bsdtar - available by 'tar' alias" +} + +function Get-NewmanVersion { + $newmanVersion = Run-Command "newman --version" + return "Newman $newmanVersion" +} + +function Get-VirtualBoxVersion { + $virtualBox = Run-Command "vboxmanage -v" + return "virtualbox $virtualBox" +} + +function Get-VagrantVersion { + $vagrant = Run-Command "vagrant -v" + return $vagrant +} + +function Get-ParallelVersion { + $parallelVersion = Run-Command "parallel --version" | Select-String "GNU parallel" | Select-Object -First 1 + return $parallelVersion +} + +function Get-FastlaneVersion { + $fastlaneVersion = Run-Command "fastlane --version" | Select-String "^fastlane [0-9]" | Take-Part -Part 1 + return "Fastlane $fastlaneVersion" +} + +function Get-CmakeVersion { + $cmakeVersion = Run-Command "cmake --version" | Select-Object -First 1 | Take-Part -Part 2 + return "Cmake $cmakeVersion" +} + +function Get-AppCenterCLIVersion { + $appcenterCLIVersion = Run-Command "appcenter --version" | Take-Part -Part 2 + return "App Center CLI $appcenterCLIVersion" +} + +function Get-AzureCLIVersion { + $azureCLIVersion = Run-Command "az -v" | Select-String "^azure-cli" | Take-Part -Part 1 + return "Azure CLI $azureCLIVersion" +} + +function Get-AWSCLIVersion { + $awsVersion = Run-Command "aws --version" | Take-Part -Part 0 | Take-Part -Delimiter "/" -Part 1 + return "AWS CLI $awsVersion" +} + +function Get-AWSSAMCLIVersion { + $awsSamVersion = Run-Command "sam --version" | Take-Part -Part 3 + return "AWS SAM CLI $awsSamVersion" +} + +function Get-AWSSessionManagerCLIVersion { + $awsSessionManagerVersion = Run-Command "session-manager-plugin --version" + return "AWS Session Manager CLI $awsSessionManagerVersion" +} + +function Get-AliyunCLIVersion { + $aliyunVersion = Run-Command "aliyun --version" | Select-String "Alibaba Cloud Command Line Interface Version " | Take-Part -Part 6 + return "Aliyun CLI $aliyunVersion" +} + +function Get-GHCupVersion { + $ghcUpVersion = Run-Command "ghcup --version" | Take-Part -Part 5 + return "GHCup $ghcUpVersion" +} + +function Get-GHCVersion { + $ghcVersion = Run-Command "ghc --version" | Take-Part -Part 7 + return "GHC $ghcVersion" +} + +function Get-CabalVersion { + $cabalVersion = Run-Command "cabal --version" | Take-Part -Part 3 + return "Cabal $cabalVersion" +} + +function Get-StackVersion { + $stackVersion = Run-Command "stack --version" | Take-Part -Part 1 | ForEach-Object {$_.replace(",","")} + return "Stack $stackVersion" +} + +function Get-YamllintVersion { + $yamllintVersion = Run-Command "yamllint --version" + return $yamllintVersion +} + +function Get-SwiftLintVersion { + $swiftlintVersion = Run-Command "swiftlint version" + return "SwiftLint $swiftlintVersion" +} + +function Get-PowershellVersion { + $powershellVersion = Run-Command "powershell --version" + return $powershellVersion } \ No newline at end of file diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index a91cdde2f..446973cd8 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -21,17 +21,6 @@ Import-Module "$PSScriptRoot/../helpers/Xcode.Helpers.psm1" # Operating System info $os = Get-OSVersion -# Language and Runtime -$nodejsVersion = Run-Command "node --version" -$nvmVersion = Get-NVMVersion -$nvmCachedVersions = Get-NVMNodeVersionList -$pythonVersion = Run-Command "python --version" -$python3Version = Run-Command "python3 --version" -$rubyVersion = Run-Command "ruby --version" | Take-Part -Part 1 -$goVersion = Get-GoVersion -$phpVersion = Run-Command "php --version" | Select-Object -First 1 | Take-Part -Part 0,1 -$juliaVersion = Run-Command "julia --version" | Take-Part -Part 0,2 - $markdown = "" # OS info @@ -53,187 +42,123 @@ if ($os.IsLessThanBigSur) { $markdown += New-MDList -Style Unordered -Lines @(Get-RVersion) -NoNewLine } +# Language and Runtime $markdown += New-MDList -Style Unordered -Lines @( (Get-BashVersion), - "Node.js ${nodejsVersion}" - "NVM ${nvmVersion}" - "NVM - Cached node versions: ${nvmCachedVersions}" - $pythonVersion, - $python3Version, - "Ruby ${rubyVersion}", + (Get-NodeVersion), + (Get-NVMVersion), + (Get-NVMNodeVersionList), + (Get-PythonVersion), + (Get-Python3Version), + (Get-RubyVersion), (Get-DotnetVersionList), - "Go ${goVersion}", - "$phpVersion", - "$juliaVersion" + (Get-GoVersion), + (Get-PHPVersion), + (Get-JuliaVersion) ) # Package Management -$bundlerVersion = Run-Command "bundle --version" -$carthageVersion = Run-Command "carthage version" -SuppressStderr -$cocoaPodsVersion = Run-Command "pod --version" -$homebrewVersion = Run-Command "brew --version" | Select-Object -First 1 -$npmVersion = Run-Command "npm --version" -$yarnVersion = Run-Command "yarn --version" -$nugetVersion = Run-Command "nuget help" | Select-Object -First 1 | Take-Part -Part 2 -$pipVersion = Get-PipVersion -Version 2 -$pip3Version = Get-PipVersion -Version 3 -$pipxVersion = Get-PipxVersion -$condaVersion = Invoke-Expression "conda --version" -$rubyGemsVersion = Run-Command "gem --version" -$composerVersion = Run-Command "composer --version" | Take-Part -Part 2 - $markdown += New-MDHeader "Package Management" -Level 3 if ($os.IsHigherThanMojave) { - $vcpkgVersion = Get-VcpkgVersion - $markdown += New-MDList -Lines $vcpkgVersion -Style Unordered -NoNewLine + $markdown += New-MDList -Lines (Get-VcpkgVersion) -Style Unordered -NoNewLine } $markdown += New-MDList -Style Unordered -Lines @( - "Pip ${pipVersion}", - "Pip ${pip3Version}", - $pipxVersion, - $bundlerVersion, - "Carthage ${carthageVersion}", - "CocoaPods ${cocoaPodsVersion}", - $homebrewVersion, - "NPM ${npmVersion}", - "Yarn ${yarnVersion}", - "NuGet ${nugetVersion}", - "Mini${condaVersion}", - "RubyGems ${rubyGemsVersion}", - "Composer ${composerVersion}" + (Get-PipVersion -Version 2), + (Get-PipVersion -Version 3), + (Get-PipxVersion), + (Get-BundlerVersion), + (Get-CarthageVersion), + (Get-CocoaPodsVersion), + (Get-HomebrewVersion), + (Get-NPMVersion), + (Get-YarnVersion), + (Get-NuGetVersion), + (Get-CondaVersion), + (Get-RubyGemsVersion), + (Get-ComposerVersion) ) # Project Management -$mavenVersion = Run-Command "mvn -version" | Select-Object -First 1 | Take-Part -Part 2 -#gradle output differs on the first launch – a welcome message, that we don't need is rendered. The solution is to take the last "Gradle" occurrence from the output -$gradleVersion = (Run-Command "gradle --version" | Select-String "Gradle")[-1] -$apacheAnt = Run-Command "ant -version" | Take-Part -Part 0,1,3 - $markdown += New-MDHeader "Project Management" -Level 3 $markdown += New-MDList -Style Unordered -Lines @( - "Apache Maven ${mavenVersion}", - $gradleVersion, - $apacheAnt + (Get-MavenVersion), + (Get-GradleVersion), + (Get-ApacheAntVersion) ) # Utilities -$curlVersion = Run-Command "curl --version" | Select-Object -First 1 | Take-Part -Part 1 -$gitVersion = Run-Command "git --version" | Take-Part -Part 2 -$ghVersion = Run-Command "gh --version" | Select-String "gh version" | Select-Object -First 1 | Take-Part -Part 2 -$gitLFSVersion = Run-Command "git-lfs version" | Take-Part -Part 0 | Take-Part -Part 1 -Delimiter "/" -$hubVersion = Run-Command "brew list --versions hub" | Take-Part -Part 1 -$wgetVersion = Run-Command "wget --version" | Select-String "GNU Wget" | Take-Part -Part 2 -$svnVersion = Run-Command "svn --version --quiet" -$jqVersion = Run-Command "jq --version" | Take-Part -Part 1 -Delimiter "-" -$opensslVersion = Get-Item /usr/local/opt/openssl | ForEach-Object {"{0} ``({1} -> {2})``" -f (Run-Command "openssl version"), $_.FullName, $_.Target} -$gpgVersion = Run-Command "gpg --version" | Select-String 'gpg (GnuPG)' -SimpleMatch -$postgresClientVersion = Run-Command "psql --version" -$postgresServerVersion = Run-Command "pg_config --version" -$aria2Version = Run-Command "aria2c --version" | Select-Object -First 1 | Take-Part -Part 2 -$azcopyVersion = Run-Command "azcopy --version" | Take-Part -Part 2 -$zstdVersion = Run-Command "zstd --version" | Take-Part -Part 1 -Delimiter "v" | Take-Part -Part 0 -Delimiter "," -$bazelVersion = Run-Command "bazel --version" | Take-Part -Part 0 -Delimiter "-" -$bazeliskVersion = Run-Command "brew list bazelisk --versions" -$packerVersion = Run-Command "packer --version" -$helmVersion = Run-Command "helm version --short" -$mongo = Run-Command "mongo --version" | Select-String "MongoDB shell version" | Take-Part -Part 3 -$mongod = Run-Command "mongod --version" | Select-String "db version " | Take-Part -Part 2 -$p7zip = Run-Command "7z i" | Select-String "7-Zip" | Take-Part -Part 0,2 -$gnuTar = Run-Command "gtar --version" | Select-String "tar" | Take-Part -Part 3 -$bsdtar = Run-Command "tar --version" | Take-Part -Part 1 - $markdown += New-MDHeader "Utilities" -Level 3 $markdown += New-MDList -Style Unordered -NoNewLine -Lines @( - "Curl ${curlVersion}", - "Git: ${gitVersion}", - "Git LFS: ${gitLFSVersion}", - "GitHub CLI: ${ghVersion}", - "Hub CLI: ${hubVersion}", - "GNU Wget ${wgetVersion}", - "Subversion (SVN) ${svnVersion}", - "Packer $packerVersion", - $opensslVersion, - "jq ${jqVersion}", - $gpgVersion, - $postgresClientVersion, - $postgresServerVersion, - "aria2 $aria2Version", - "azcopy $azcopyVersion", - "zstd $zstdVersion", - $bazelVersion, - $bazeliskVersion, - "helm $helmVersion", - "mongo $mongo", - "mongod $mongod", - $p7zip, - "bsdtar $bsdtar - available by 'tar' alias", - "GNU Tar $gnuTar - available by 'gtar' alias" + (Get-CurlVersion), + (Get-GitVersion), + (Get-GitLFSVersion), + (Get-GitHubCLIVersion), + (Get-HubVersion), + (Get-WgetVersion), + (Get-SVNVersion), + (Get-PackerVersion), + (Get-OpenSSLVersion), + (Get-JqVersion), + (Get-GPGVersion), + (Get-PostgresClientVersion), + (Get-PostgresServerVersion), + (Get-Aria2Version), + (Get-AzcopyVersion), + (Get-ZstdVersion), + (Get-BazelVersion), + (Get-BazeliskVersion), + (Get-HelmVersion), + (Get-MongoVersion), + (Get-MongodVersion), + (Get-7zipVersion), + (Get-BsdtarVersion), + (Get-GnuTarVersion) ) if ($os.IsHigherThanMojave) { - $newmanVersion = Run-Command "newman --version" - $markdown += New-MDList -Lines "Newman $newmanVersion" -Style Unordered -NoNewLine + $markdown += New-MDList -Lines (Get-NewmanVersion) -Style Unordered -NoNewLine } if ($os.IsLessThanBigSur) { - $vagrant = Run-Command "vagrant -v" - $vbox = Run-Command "vboxmanage -v" - $parallelVersion = Run-Command "parallel --version" | Select-String "GNU parallel" | Select-Object -First 1 $markdown += New-MDList -Style Unordered -Lines @( - "virtualbox $vbox", - $vagrant, - $parallelVersion + (Get-VirtualBoxVersion), + (Get-VagrantVersion), + (Get-ParallelVersion) ) } $markdown += New-MDNewLine # Tools -$fastlaneVersion = Run-Command "fastlane --version" | Select-String "^fastlane [0-9]" | Take-Part -Part 1 -$cmakeVersion = Run-Command "cmake --version" | Select-Object -First 1 | Take-Part -Part 2 -$appcenterCLIVersion = Run-Command "appcenter --version" | Take-Part -Part 2 -$azureCLIVersion = Run-Command "az -v" | Select-String "^azure-cli" | Take-Part -Part 1 -$awsVersion = Run-Command "aws --version" | Take-Part -Part 0 | Take-Part -Delimiter "/" -Part 1 -$aliyunVersion = Run-Command "aliyun --version" | Select-String "Alibaba Cloud Command Line Interface Version " | Take-Part -Part 6 -$awsSamVersion = Run-Command "sam --version" | Take-Part -Part 3 -$awsSessionManagerVersion = Run-Command "session-manager-plugin --version" -$ghcUpVersion = Run-Command "ghcup --version" | Take-Part -Part 5 -$ghcVersion = Run-Command "ghc --version" | Take-Part -Part 7 -$cabalVersion = Run-Command "cabal --version" | Take-Part -Part 3 -$stackVersion = Run-Command "stack --version" | Take-Part -Part 1 | ForEach-Object {$_.replace(",","")} -$xcodeVersion = Run-Command "pkgutil --pkg-info com.apple.pkg.CLTools_Executables" | Select -Index 1 | Take-Part -Part 1 - $markdown += New-MDHeader "Tools" -Level 3 $markdown += New-MDList -Style Unordered -NoNewLine -Lines @( - "Fastlane ${fastlaneVersion}", - "Cmake ${cmakeVersion}", - "App Center CLI ${appcenterCLIVersion}", - "Azure CLI ${azureCLIVersion}", - "AWS CLI ${awsVersion}", - "AWS SAM CLI ${awsSamVersion}", - "AWS Session Manager CLI ${awsSessionManagerVersion}", - "Aliyun CLI ${aliyunVersion}", - "Xcode Command Line Tools ${xcodeVersion}" + (Get-FastlaneVersion), + (Get-CmakeVersion), + (Get-AppCenterCLIVersion), + (Get-AzureCLIVersion), + (Get-AWSCLIVersion), + (Get-AWSSAMCLIVersion), + (Get-AWSSessionManagerCLIVersion), + (Get-AliyunCLIVersion), + (Get-XcodeCommandLineToolsVersion) ) if( -not $os.IsHighSierra) { $markdown += New-MDList -Style Unordered -Lines @( - "GHCup ${ghcUpVersion}", - "GHC ${ghcVersion}", - "Cabal ${cabalVersion}", - "Stack ${stackVersion}" + (Get-GHCupVersion), + (Get-GHCVersion), + (Get-CabalVersion), + (Get-StackVersion) ) } # Linters $markdown += New-MDHeader "Linters" -Level 3 -$yamllintVersion = Run-Command "yamllint --version" $markdown += New-MDList -Style Unordered -NoNewLine -Lines @( - $yamllintVersion + (Get-YamllintVersion) ) if ( -not $os.IsHighSierra) { - $swiftlintVersion = Run-Command "swiftlint version" $markdown += New-MDList -Style Unordered -Lines @( - "SwiftLint ${swiftlintVersion}" + (Get-SwiftLintVersion) ) } @@ -247,10 +172,9 @@ $markdown += Get-JavaVersions | New-MDTable $markdown += Build-ToolcacheSection if ( -not $os.IsHighSierra) { - $rustVersion = Get-RustVersion $markdown += New-MDHeader "Rust Tools" -Level 3 $markdown += New-MDList -Style Unordered -Lines @( - "Rust $rustVersion", + (Get-RustVersion), (Get-RustupVersion) ) $markdown += New-MDHeader "Packages" -Level 4 @@ -263,8 +187,7 @@ if ( -not $os.IsHighSierra) { } $markdown += New-MDHeader "PowerShell Tools" -Level 3 -$powershellVersion = Run-Command "powershell --version" -$markdown += New-MDList -Lines $powershellVersion -Style Unordered +$markdown += New-MDList -Lines (Get-PowershellVersion) -Style Unordered $markdown += New-MDHeader "PowerShell Modules" -Level 4 $markdown += Get-PowerShellModules | New-MDTable diff --git a/images/macos/software-report/SoftwareReport.Xcode.psm1 b/images/macos/software-report/SoftwareReport.Xcode.psm1 index b363968fb..070d5ac95 100644 --- a/images/macos/software-report/SoftwareReport.Xcode.psm1 +++ b/images/macos/software-report/SoftwareReport.Xcode.psm1 @@ -76,6 +76,11 @@ function Get-XcodePlatformOrder { } } +function Get-XcodeCommandLineToolsVersion { + $xcodeCommandLineToolsVersion = Run-Command "pkgutil --pkg-info com.apple.pkg.CLTools_Executables" | Select -Index 1 | Take-Part -Part 1 + return "Xcode Command Line Tools $xcodeCommandLineToolsVersion" +} + function Build-XcodeTable { param ( [Parameter(Mandatory)]