Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make VS16.10 the minimum required VS for builds #54997

Merged
36 commits merged into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b4d0211
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 5, 2021
9a06c7f
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 12, 2021
f275211
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 15, 2021
38efc45
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 17, 2021
ca103c4
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 18, 2021
b5db981
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 19, 2021
ed5bc46
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 20, 2021
6ec36c6
Leave SDK on .NET 6 Preview 3
JoeRobich Jun 21, 2021
0b172c4
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 22, 2021
73e296d
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 23, 2021
7fa7f8c
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 24, 2021
9b7e608
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 25, 2021
59554fa
Leave SDK on NET 6 Preview 3
JoeRobich Jun 28, 2021
87644e9
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 29, 2021
9cc3e25
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jun 30, 2021
27f6eb7
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 1, 2021
6aed397
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 2, 2021
132ef55
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 6, 2021
b944126
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 8, 2021
7da7f29
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 13, 2021
c62de2b
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 14, 2021
8c72db0
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 15, 2021
5d37472
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 16, 2021
5303bbf
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 17, 2021
7978ada
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 20, 2021
143cf13
Make VS16.10 the minimum required VS for builds
JoeRobich Jul 20, 2021
f4a82e7
Bump MSBuild.StructuredLogger to 2.1.500
JoeRobich Jul 20, 2021
5e0cb4b
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 21, 2021
6f98a0c
Merge commit 'refs/pull/53896/head' of github.com:dotnet/roslyn into …
JoeRobich Jul 21, 2021
07eb3dd
Ignore Ibc merge errors in official builds
JoeRobich Jul 21, 2021
c03a724
Pass repoRoot with trailing slash in correctness tests
JoeRobich Jul 22, 2021
89baae8
Update getting started instructions to install .NET 6 Preview 4
JoeRobich Jul 22, 2021
10f1548
Merge branch 'main' into build-with-vs2019
JoeRobich Jul 23, 2021
2d8ba86
Update dependencies from https://github.com/dotnet/arcade build 20210…
dotnet-maestro[bot] Jul 24, 2021
4265db9
Merge commit '2d8ba867cee767883ece5ac6c67d05e11330e7cc' into build-wi…
JoeRobich Jul 26, 2021
701c2b9
Update contributing docs
JoeRobich Jul 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ stages:
timeoutInMinutes: 360
pool:
name: NetCoreInternal-Pool
queue: BuildPool.Server.Amd64.VS2017
queue: BuildPool.Server.Amd64.VS2019

steps:
- powershell: Write-Host "##vso[task.setvariable variable=SourceBranchName]$('$(Build.SourceBranch)'.Substring('refs/heads/'.Length))"
Expand Down Expand Up @@ -176,6 +176,7 @@ stages:
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:DotnetPublishUsingPipelines=true
/p:IgnoreIbcMergeErrors=true
condition: succeeded()

- task: PowerShell@2
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ stages:
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:DotnetPublishUsingPipelines=false
/p:IgnoreIbcMergeErrors=true
/p:PreReleaseVersionLabel=pr-validation
condition: succeeded()

Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
- job: Correctness_Determinism
pool:
name: NetCorePublic-Pool
queue: BuildPool.Windows.10.Amd64.VS2017.Open
queue: BuildPool.Windows.10.Amd64.VS2019.Open
timeoutInMinutes: 90
steps:
- template: eng/pipelines/checkout-windows-task.yml
Expand All @@ -171,7 +171,7 @@ jobs:
- job: Correctness_Build
pool:
name: NetCorePublic-Pool
queue: BuildPool.Windows.10.Amd64.VS2017.Open
queue: BuildPool.Windows.10.Amd64.VS2019.Open
timeoutInMinutes: 90
steps:
- template: eng/pipelines/checkout-windows-task.yml
Expand Down
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21303.2">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21370.12">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>78da7776965b428ff31da8f1ff2cb073506212b7</Sha>
<Sha>89806f0b9e93ad2bbe32c654412835c0801a2032</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.0.0-3.21369.1">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>ea623578b108856d3416af28af61060ed3d695e8</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.21303.2">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.21370.12">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>78da7776965b428ff31da8f1ff2cb073506212b7</Sha>
<Sha>89806f0b9e93ad2bbe32c654412835c0801a2032</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<MicrosoftDiaSymReaderConverterXmlVersion>1.1.0-beta2-20115-01</MicrosoftDiaSymReaderConverterXmlVersion>
<MicrosoftDiaSymReaderNativeVersion>16.9.0-beta1.21055.5</MicrosoftDiaSymReaderNativeVersion>
<MicrosoftDiaSymReaderPortablePdbVersion>1.5.0</MicrosoftDiaSymReaderPortablePdbVersion>
<MicrosoftDotNetBuildTasksFeedVersion>6.0.0-beta.21260.1</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetBuildTasksFeedVersion>6.0.0-beta.21319.2</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftExtensionsLoggingVersion>5.0.0</MicrosoftExtensionsLoggingVersion>
<MicrosoftExtensionsLoggingConsoleVersion>5.0.0</MicrosoftExtensionsLoggingConsoleVersion>
<MicrosoftIdentityModelClientsActiveDirectoryVersion>3.13.8</MicrosoftIdentityModelClientsActiveDirectoryVersion>
Expand Down Expand Up @@ -189,7 +189,7 @@
<MicrosoftVisualStudioWorkspaceVSIntegrationVersion>16.3.43</MicrosoftVisualStudioWorkspaceVSIntegrationVersion>
<MicrosoftWin32PrimitivesVersion>4.3.0</MicrosoftWin32PrimitivesVersion>
<MicrosoftWin32RegistryVersion>5.0.0</MicrosoftWin32RegistryVersion>
<MSBuildStructuredLoggerVersion>2.1.133</MSBuildStructuredLoggerVersion>
<MSBuildStructuredLoggerVersion>2.1.500</MSBuildStructuredLoggerVersion>
<MDbgVersion>0.1.0</MDbgVersion>
<MonoOptionsVersion>6.6.0.161</MonoOptionsVersion>
<MoqVersion>4.10.1</MoqVersion>
Expand Down
6 changes: 6 additions & 0 deletions eng/common/SetupNugetSources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,10 @@ if ($dotnet5Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet5-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password
}

$dotnet6Source = $sources.SelectSingleNode("add[@key='dotnet6']")
if ($dotnet6Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet6-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet6-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet6-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet6-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password
}

$doc.Save($filename)
24 changes: 24 additions & 0 deletions eng/common/SetupNugetSources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,30 @@ if [ "$?" == "0" ]; then
PackageSources+=('dotnet5-internal-transport')
fi

# Ensure dotnet6-internal and dotnet6-internal-transport are in the packageSources if the public dotnet6 feeds are present
grep -i "<add key=\"dotnet6\"" $ConfigFile
if [ "$?" == "0" ]; then
grep -i "<add key=\"dotnet6-internal\"" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet6-internal to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet6-internal\" value=\"https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet6-internal/nuget/v2\" />"

sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet6-internal')

grep -i "<add key=\"dotnet6-internal-transport\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet6-internal-transport to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet6-internal-transport\" value=\"https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet6-internal-transport/nuget/v2\" />"

sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet6-internal-transport')
fi

# I want things split line by line
PrevIFS=$IFS
IFS=$'\n'
Expand Down
6 changes: 5 additions & 1 deletion eng/common/cross/build-rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ __AlpinePackages="alpine-base"
__AlpinePackages+=" build-base"
__AlpinePackages+=" linux-headers"
__AlpinePackagesEdgeCommunity=" lldb-dev"
__AlpinePackagesEdgeMain=" llvm10-libs"
__AlpinePackagesEdgeMain+=" python3"
__AlpinePackagesEdgeMain+=" libedit"

Expand Down Expand Up @@ -115,6 +114,8 @@ while :; do
__UbuntuArch=s390x
__UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/"
__UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libunwind8-dev//')
__UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp-dev//')
__UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp5//')
unset __LLDB_Package
;;
x86)
Expand Down Expand Up @@ -191,6 +192,8 @@ while :; do
__CodeName=alpine
__UbuntuRepo=
__AlpineVersion=3.9
__AlpinePackagesEdgeMain+=" llvm11-libs"
__AlpinePackagesEdgeMain+=" clang-libs"
;;
alpine3.13)
__CodeName=alpine
Expand All @@ -201,6 +204,7 @@ while :; do
__AlpinePackagesEdgeCommunity=
__AlpinePackages+=$__AlpinePackagesEdgeMain
__AlpinePackagesEdgeMain=
__AlpinePackages+=" llvm10-libs"
;;
freebsd11)
__FreeBSDBase="11.3-RELEASE"
Expand Down
2 changes: 1 addition & 1 deletion eng/common/dotnet-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ case $cpuname in
;;
esac

dotnetRoot="$repo_root/.dotnet"
dotnetRoot="${repo_root}.dotnet"
if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then
dotnetRoot="$dotnetRoot/$architecture"
fi
Expand Down
13 changes: 10 additions & 3 deletions eng/common/generate-locproject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@ Push-Location "$SourcesDirectory" # push location for Resolve-Path -Relative to

# Template files
$jsonFiles = @()
$jsonFiles += Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\en\..+\.json" } # .NET templating pattern
$jsonFiles += Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern
$jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern
$jsonTemplateFiles | ForEach-Object {
$null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json

$destinationFile = "$($_.Directory.FullName)\$($Matches.1).json"
$jsonFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru
}

$jsonWinformsTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern

$xlfFiles = @()

Expand All @@ -44,7 +51,7 @@ $langXlfFiles | ForEach-Object {
$xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru
}

$locFiles = $jsonFiles + $xlfFiles
$locFiles = $jsonFiles + $jsonWinformsTemplateFiles + $xlfFiles

$locJson = @{
Projects = @(
Expand Down
6 changes: 3 additions & 3 deletions eng/common/internal-feed-operations.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ function SetupCredProvider {
# Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable
# feeds successfully

$nugetConfigPath = "$RepoRoot\NuGet.config"
$nugetConfigPath = Join-Path $RepoRoot "NuGet.config"

if (-Not (Test-Path -Path $nugetConfigPath)) {
Write-PipelineTelemetryError -Category 'Build' -Message 'NuGet.config file not found in repo root!'
ExitWithExitCode 1
ExitWithExitCode 1
}

$endpoints = New-Object System.Collections.ArrayList
Expand Down Expand Up @@ -85,7 +85,7 @@ function SetupCredProvider {

#Workaround for https://github.com/microsoft/msbuild/issues/4430
function InstallDotNetSdkAndRestoreArcade {
$dotnetTempDir = "$RepoRoot\dotnet"
$dotnetTempDir = Join-Path $RepoRoot "dotnet"
$dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*)
$dotnet = "$dotnetTempDir\dotnet.exe"
$restoreProjPath = "$PSScriptRoot\restore.proj"
Expand Down
2 changes: 1 addition & 1 deletion eng/common/internal-feed-operations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function SetupCredProvider {
# Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable
# feeds successfully

local nugetConfigPath="$repo_root/NuGet.config"
local nugetConfigPath="{$repo_root}NuGet.config"

if [ ! "$nugetConfigPath" ]; then
Write-PipelineTelemetryError -category 'Build' "NuGet.config file not found in repo's root!"
Expand Down
4 changes: 2 additions & 2 deletions eng/common/sdk-task.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Print-Usage() {
function Build([string]$target) {
$logSuffix = if ($target -eq 'Execute') { '' } else { ".$target" }
$log = Join-Path $LogDir "$task$logSuffix.binlog"
$outputPath = Join-Path $ToolsetDir "$task\\"
$outputPath = Join-Path $ToolsetDir "$task\"

MSBuild $taskProject `
/bl:$log `
Expand Down Expand Up @@ -64,7 +64,7 @@ try {
$GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty
}
if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) {
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "16.8.0-preview3" -MemberType NoteProperty
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "16.10.0-preview2" -MemberType NoteProperty
}
if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") {
$xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true
Expand Down
109 changes: 109 additions & 0 deletions eng/common/sdl/configure-sdl-tool.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
Param(
[string] $GuardianCliLocation,
[string] $WorkingDirectory,
[string] $TargetDirectory,
[string] $GdnFolder,
# The list of Guardian tools to configure. For each object in the array:
# - If the item is a [hashtable], it must contain these entries:
# - Name = The tool name as Guardian knows it.
# - Scenario = (Optional) Scenario-specific name for this configuration entry. It must be unique
# among all tool entries with the same Name.
# - Args = (Optional) Array of Guardian tool configuration args, like '@("Target > C:\temp")'
# - If the item is a [string] $v, it is treated as '@{ Name="$v" }'
[object[]] $ToolsList,
[string] $GuardianLoggerLevel='Standard',
# Optional: Additional params to add to any tool using CredScan.
[string[]] $CrScanAdditionalRunConfigParams,
# Optional: Additional params to add to any tool using PoliCheck.
[string[]] $PoliCheckAdditionalRunConfigParams
)

$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 2.0
$disableConfigureToolsetImport = $true
$global:LASTEXITCODE = 0

try {
# `tools.ps1` checks $ci to perform some actions. Since the SDL
# scripts don't necessarily execute in the same agent that run the
# build.ps1/sh script this variable isn't automatically set.
$ci = $true
. $PSScriptRoot\..\tools.ps1

# Normalize tools list: all in [hashtable] form with defined values for each key.
$ToolsList = $ToolsList |
ForEach-Object {
if ($_ -is [string]) {
$_ = @{ Name = $_ }
}

if (-not ($_['Scenario'])) { $_.Scenario = "" }
if (-not ($_['Args'])) { $_.Args = @() }
$_
}

Write-Host "List of tools to configure:"
$ToolsList | ForEach-Object { $_ | Out-String | Write-Host }

# We store config files in the r directory of .gdn
$gdnConfigPath = Join-Path $GdnFolder 'r'
$ValidPath = Test-Path $GuardianCliLocation

if ($ValidPath -eq $False)
{
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location."
ExitWithExitCode 1
}

foreach ($tool in $ToolsList) {
# Put together the name and scenario to make a unique key.
$toolConfigName = $tool.Name
if ($tool.Scenario) {
$toolConfigName += "_" + $tool.Scenario
}

Write-Host "=== Configuring $toolConfigName..."

$gdnConfigFile = Join-Path $gdnConfigPath "$toolConfigName-configure.gdnconfig"

# For some tools, add default and automatic args.
if ($tool.Name -eq 'credscan') {
if ($targetDirectory) {
$tool.Args += "TargetDirectory < $TargetDirectory"
}
$tool.Args += "OutputType < pre"
$tool.Args += $CrScanAdditionalRunConfigParams
} elseif ($tool.Name -eq 'policheck') {
if ($targetDirectory) {
$tool.Args += "Target < $TargetDirectory"
}
$tool.Args += $PoliCheckAdditionalRunConfigParams
}

# Create variable pointing to the args array directly so we can use splat syntax later.
$toolArgs = $tool.Args

# Configure the tool. If args array is provided or the current tool has some default arguments
# defined, add "--args" and splat each element on the end. Arg format is "{Arg id} < {Value}",
# one per parameter. Doc page for "guardian configure":
# https://dev.azure.com/securitytools/SecurityIntegration/_wiki/wikis/Guardian/1395/configure
Exec-BlockVerbosely {
& $GuardianCliLocation configure `
--working-directory $WorkingDirectory `
--tool $tool.Name `
--output-path $gdnConfigFile `
--logger-level $GuardianLoggerLevel `
--noninteractive `
--force `
$(if ($toolArgs) { "--args" }) @toolArgs
Exit-IfNZEC "Sdl"
}

Write-Host "Created '$toolConfigName' configuration file: $gdnConfigFile"
}
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_
ExitWithExitCode 1
}
Loading