@@ -13,56 +13,62 @@ $ErrorActionPreference = 'Stop'
1313Set-StrictMode - Version 2.0
1414
1515. (Join-Path $PSScriptRoot ' ..' ' common' ' scripts' ' common.ps1' )
16+ . ([System.IO.Path ]::Combine($PSScriptRoot , ' shared' , ' Cargo.ps1' ))
1617
1718Write-Host @"
1819Analyzing code with
1920 RUSTFLAGS: '${env: RUSTFLAGS} '
2021 RUSTDOCFLAGS: '${env: RUSTDOCFLAGS} '
22+ RUST_LOG: '${env: RUST_LOG} '
2123"@
2224
2325if ($CheckWasm ) {
24- Invoke-LoggedCommand " rustup target add wasm32-unknown-unknown"
26+ Invoke-LoggedCommand " rustup target add wasm32-unknown-unknown" - GroupOutput
2527}
2628
2729if ($Deny ) {
28- Invoke-LoggedCommand " cargo install cargo-deny --locked"
30+ Invoke-LoggedCommand " cargo install cargo-deny --locked" - GroupOutput
2931}
3032
31- Invoke-LoggedCommand " cargo check --package azure_core --all-features --all-targets --keep-going"
33+ $cargoAuditVersionParams = Get-VersionParamsFromCgManifest cargo- audit
34+ Invoke-LoggedCommand " cargo install cargo-audit --locked $ ( $cargoAuditVersionParams -join ' ' ) " - GroupOutput
35+ Invoke-LoggedCommand " cargo audit" - GroupOutput
3236
33- Invoke-LoggedCommand " cargo fmt --all -- --check "
37+ Invoke-LoggedCommand " cargo check --package azure_core -- all-features --all-targets --keep-going " - GroupOutput
3438
35- Invoke-LoggedCommand " cargo clippy --workspace --all-features --all-targets --keep-going --no-deps"
39+ Invoke-LoggedCommand " cargo fmt --all -- --check" - GroupOutput
40+
41+ Invoke-LoggedCommand " cargo clippy --workspace --all-features --all-targets --keep-going --no-deps" - GroupOutput
3642
3743if ($CheckWasm ) {
3844 # Save the original RUSTFLAGS to restore later
3945 $OriginalRustFlags = $env: RUSTFLAGS
4046 # This is needed to ensure that the `getrandom` crate uses the `wasm_js` backend
4147 $env: RUSTFLAGS = ${env: RUSTFLAGS} + ' --cfg getrandom_backend="wasm_js"'
4248
43- Invoke-LoggedCommand " cargo clippy --target=wasm32-unknown-unknown --workspace --keep-going --no-deps"
49+ Invoke-LoggedCommand " cargo clippy --target=wasm32-unknown-unknown --workspace --keep-going --no-deps" - GroupOutput
4450
4551 # Restore the original RUSTFLAGS, since the getrandom config option can only be set for wasm32-unknown-unknown builds.
4652 $env: RUSTFLAGS = $OriginalRustFlags
4753}
4854
4955if ($Deny ) {
50- Invoke-LoggedCommand " cargo deny --all-features check"
56+ Invoke-LoggedCommand " cargo deny --all-features check" - GroupOutput
5157}
5258
53- Invoke-LoggedCommand " cargo doc --workspace --no-deps --all-features"
59+ Invoke-LoggedCommand " cargo doc --workspace --no-deps --all-features" - GroupOutput
5460
5561# Verify package dependencies
5662$verifyDependenciesScript = Join-Path $RepoRoot ' eng' ' scripts' ' verify-dependencies.rs' - Resolve
5763
5864if (! $SkipPackageAnalysis ) {
5965 if (! (Test-Path $PackageInfoDirectory )) {
6066 Write-Host " Analyzing workspace`n "
61- return Invoke-LoggedCommand " &$verifyDependenciesScript $RepoRoot /Cargo.toml"
67+ return Invoke-LoggedCommand " &$verifyDependenciesScript $RepoRoot /Cargo.toml" - GroupOutput
6268 }
6369
6470 if ($Toolchain -eq ' nightly' ) {
65- Invoke-LoggedCommand " cargo install --locked cargo-docs-rs"
71+ Invoke-LoggedCommand " cargo install --locked cargo-docs-rs" - GroupOutput
6672 }
6773
6874 $packagesToTest = Get-ChildItem $PackageInfoDirectory - Filter " *.json" - Recurse
@@ -71,10 +77,10 @@ if (!$SkipPackageAnalysis) {
7177
7278 foreach ($package in $packagesToTest ) {
7379 Write-Host " Analyzing package '$ ( $package.Name ) ' in directory '$ ( $package.DirectoryPath ) '`n "
74- Invoke-LoggedCommand " &$verifyDependenciesScript $ ( $package.DirectoryPath ) /Cargo.toml"
80+ Invoke-LoggedCommand " &$verifyDependenciesScript $ ( $package.DirectoryPath ) /Cargo.toml" - GroupOutput
7581
7682 if ($Toolchain -eq ' nightly' ) {
77- Invoke-LoggedCommand " cargo +nightly docs-rs --package $ ( $package.Name ) "
83+ Invoke-LoggedCommand " cargo +nightly docs-rs --package $ ( $package.Name ) " - GroupOutput
7884 }
7985 }
8086}
0 commit comments