Skip to content

Commit ec01c11

Browse files
authored
Merge pull request #1389 from dotnet/auto/libtemplateUpdate
Merge latest Library.Template
2 parents 2e3c110 + 13f5289 commit ec01c11

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<PackageVersion Include="Xunit.Combinatorial" Version="2.0.24" />
4141
</ItemGroup>
4242
<ItemGroup Label="Library.Template">
43-
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.7.0" />
43+
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.8.0" />
4444
<PackageVersion Include="Microsoft.Testing.Extensions.CrashDump" Version="$(MicrosoftTestingPlatformVersion)" />
4545
<PackageVersion Include="Microsoft.Testing.Extensions.HangDump" Version="$(MicrosoftTestingPlatformVersion)" />
4646
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="$(MicrosoftTestingPlatformVersion)" />

tools/Set-EnvVars.ps1

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ if ($env:GITHUB_ACTIONS) {
4343
Write-Host "GitHub Actions detected. Logging commands will be used to propagate environment variables and prepend path."
4444
}
4545

46+
function Add-GitHubActionsFileCommand {
47+
param(
48+
[Parameter(Mandatory = $true)]
49+
[string]$Path,
50+
[Parameter(Mandatory = $true)]
51+
[string]$Value
52+
)
53+
54+
$utf8NoBom = [System.Text.UTF8Encoding]::new($false)
55+
[System.IO.File]::AppendAllText($Path, "$Value`n", $utf8NoBom)
56+
}
57+
4658
$CmdEnvScript = ''
4759
$Variables.GetEnumerator() |% {
4860
Set-Item -LiteralPath env:$($_.Key) -Value $_.Value
@@ -52,7 +64,7 @@ $Variables.GetEnumerator() |% {
5264
Write-Host "##vso[task.setvariable variable=$($_.Key);]$($_.Value)"
5365
}
5466
if ($env:GITHUB_ACTIONS) {
55-
Add-Content -LiteralPath $env:GITHUB_ENV -Value "$($_.Key)=$($_.Value)"
67+
Add-GitHubActionsFileCommand -Path $env:GITHUB_ENV -Value "$($_.Key)=$($_.Value)"
5668
}
5769

5870
if ($cmdInstructions) {
@@ -79,7 +91,7 @@ if ($PrependPath) {
7991
Write-Host "##vso[task.prependpath]$_"
8092
}
8193
if ($env:GITHUB_ACTIONS) {
82-
Add-Content -LiteralPath $env:GITHUB_PATH -Value $_
94+
Add-GitHubActionsFileCommand -Path $env:GITHUB_PATH -Value $_
8395
}
8496

8597
$CmdEnvScript += "SET PATH=$_$pathDelimiter%PATH%"

tools/variables/_define.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
param (
1212
)
1313

14+
function Add-GitHubActionsFileCommand {
15+
param(
16+
[Parameter(Mandatory = $true)]
17+
[string]$Path,
18+
[Parameter(Mandatory = $true)]
19+
[string]$Value
20+
)
21+
22+
$utf8NoBom = [System.Text.UTF8Encoding]::new($false)
23+
[System.IO.File]::AppendAllText($Path, "$Value`n", $utf8NoBom)
24+
}
25+
1426
(& "$PSScriptRoot\_all.ps1").GetEnumerator() |% {
1527
# Always use ALL CAPS for env var names since Azure Pipelines converts variable names to all caps and on non-Windows OS, env vars are case sensitive.
1628
$keyCaps = $_.Key.ToUpper()
@@ -24,7 +36,7 @@ param (
2436
# and the second that works across jobs and stages but must be fully qualified when referenced.
2537
Write-Host "##vso[task.setvariable variable=$keyCaps;isOutput=true]$($_.Value)"
2638
} elseif ($env:GITHUB_ACTIONS) {
27-
Add-Content -LiteralPath $env:GITHUB_ENV -Value "$keyCaps=$($_.Value)"
39+
Add-GitHubActionsFileCommand -Path $env:GITHUB_ENV -Value "$keyCaps=$($_.Value)"
2840
}
2941
Set-Item -LiteralPath "env:$keyCaps" -Value $_.Value
3042
}

0 commit comments

Comments
 (0)