From ecc81aa902f15ddd37bd8a674bdfface6db40ddc Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Tue, 12 Jan 2021 13:29:05 +0500 Subject: [PATCH] Add missed Rust tools to the documentation for Win (#2401) * Add documentation for rust tools * Rename helpers * Remove duplicates --- .../SoftwareReport/SoftwareReport.Common.psm1 | 25 +++++++++++++++++++ .../SoftwareReport.Generator.ps1 | 9 +++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 84b89326..d92bdbc6 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -42,6 +42,31 @@ function Get-RustVersion { return $rustVersion } +function Get-RustupVersion { + $version = [regex]::matches($(rustup --version), "\d+\.\d+\.\d+").Value + return $version +} + +function Get-RustCargoVersion { + $version = [regex]::matches($(cargo --version), "\d+\.\d+\.\d+").Value + return $version +} + +function Get-RustdocVersion { + $version = [regex]::matches($(rustdoc --version), "\d+\.\d+\.\d+").Value + return $version +} + +function Get-RustfmtVersion { + $version = [regex]::matches($(rustfmt --version), "\d+\.\d+\.\d+").Value + return $version +} + +function Get-RustClippyVersion { + $version = [regex]::matches($(cargo clippy --version), "\d+\.\d+\.\d+").Value + return $version +} + function Get-BindgenVersion { return bindgen --version } diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 2d20da76..605b57c2 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -116,14 +116,19 @@ $markdown += New-MDList -Style Unordered -Lines @( $markdown += New-MDHeader "Rust Tools" -Level 3 $markdown += New-MDList -Style Unordered -Lines @( - "Rust $(Get-RustVersion)" + "Rust $(Get-RustVersion)", + "Rustup $(Get-RustupVersion)", + "Cargo $(Get-RustCargoVersion)", + "Rustdoc $(Get-RustdocVersion)" ) $markdown += New-MDHeader "Packages" -Level 4 $markdown += New-MDList -Style Unordered -Lines @( (Get-BindgenVersion), (Get-CbindgenVersion), (Get-CargoAuditVersion), - (Get-CargoOutdatedVersion) + (Get-CargoOutdatedVersion), + "Rustfmt $(Get-RustfmtVersion)", + "Clippy $(Get-RustClippyVersion)" ) $markdown += New-MDHeader "Browsers and webdrivers" -Level 3