Skip to content

Commit 6c2d564

Browse files
authored
Merge pull request #1328 from AArnott/libtemplateUpdate
Merge latest Library.Template
2 parents 2f713da + f728c0f commit 6c2d564

14 files changed

+76
-58
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
]
1010
},
1111
"dotnet-coverage": {
12-
"version": "17.11.0",
12+
"version": "17.11.3",
1313
"commands": [
1414
"dotnet-coverage"
1515
]
1616
},
1717
"nbgv": {
18-
"version": "3.6.133",
18+
"version": "3.6.139",
1919
"commands": [
2020
"nbgv"
2121
]

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions
2-
FROM mcr.microsoft.com/dotnet/sdk:8.0.201-jammy
2+
FROM mcr.microsoft.com/dotnet/sdk:8.0.300-jammy
33

44
# Installing mono makes `dotnet test` work without errors even for net472.
55
# But installing it takes a long time, so it's excluded by default.

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ indent_size = 2
2626
# Xml config files
2727
[*.{ruleset,config,nuspec,resx,vsixmanifest,vsct,runsettings}]
2828
indent_size = 2
29+
indent_style = space
2930

3031
# JSON files
3132
[*.json]

Directory.Build.props

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,4 @@
5353
<PackageReleaseNotes Condition="'$(PackageProjectUrl)'!=''">$(PackageProjectUrl)/releases/tag/v$(Version)</PackageReleaseNotes>
5454
</PropertyGroup>
5555
</Target>
56-
57-
<PropertyGroup Condition="'$(IsWpfTempProject)' == ''">
58-
<IsWpfTempProject>false</IsWpfTempProject>
59-
<IsWpfTempProject Condition="$(MSBuildProjectName.EndsWith('_wpftmp'))">true</IsWpfTempProject>
60-
</PropertyGroup>
61-
62-
<!--
63-
Inspired by https://github.com/dotnet/arcade/blob/cbfa29d4e859622ada3d226f90f103f659665d31/src/Microsoft.DotNet.Arcade.Sdk/tools/Workarounds.props#L14-L31
64-
65-
Disable Source Link and Xliff in WPF temp projects to avoid generating non-deterministic file names to obj dir.
66-
The project name is non-deterministic and is included in the Source Link json file name and xlf directory names.
67-
It's also not necessary to generate these assets.
68-
-->
69-
<PropertyGroup Condition="'$(IsWpfTempProject)' == 'true'">
70-
<EnableSourceLink>false</EnableSourceLink>
71-
<EmbedUntrackedSources>false</EmbedUntrackedSources>
72-
<DeterministicSourcePaths>false</DeterministicSourcePaths>
73-
<EnableXlfLocalization>false</EnableXlfLocalization>
74-
</PropertyGroup>
7556
</Project>

Directory.Build.targets

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
3-
<PropertyGroup>
4-
<!-- Workaround https://github.com/dotnet/wpf/issues/1718 -->
5-
<EmbedUntrackedSources Condition=" '$(UseWPF)' == 'true' ">false</EmbedUntrackedSources>
6-
</PropertyGroup>
7-
83
<ItemGroup>
94
<!-- Avoid compile error about missing namespace when combining ImplicitUsings with .NET Framework target frameworks. -->
105
<Using Remove="System.Net.Http" Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'" />

Directory.Packages.props

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.CodeFix.Testing.XUnit" Version="$(CodefixTestingVersion)" />
2626
<PackageVersion Include="Microsoft.Diagnostics.Runtime.Utilities" Version="$(MicrosoftDiagnosticsRuntimeVersion)" />
2727
<PackageVersion Include="Microsoft.Diagnostics.Runtime" Version="$(MicrosoftDiagnosticsRuntimeVersion)" />
28-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
28+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
2929
<PackageVersion Include="Microsoft.VisualStudio.Internal.MicroBuild.NonShipping" Version="$(MicroBuildVersion)" />
3030
<PackageVersion Include="Microsoft.VisualStudio.Interop" Version="17.4.33103.184" />
3131
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="17.4.33103.184" />
@@ -41,20 +41,17 @@
4141
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
4242
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
4343
<PackageVersion Include="Xunit.Combinatorial" Version="1.6.24" />
44-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
44+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
4545
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
4646
<PackageVersion Include="Xunit.StaFact" Version="1.1.11" />
47-
<PackageVersion Include="xunit" Version="2.8.0" />
47+
<PackageVersion Include="xunit" Version="2.8.1" />
4848
</ItemGroup>
4949
<ItemGroup>
5050
<GlobalPackageReference Include="CSharpIsNullAnalyzer" Version="0.1.495" />
5151
<GlobalPackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" />
5252
<GlobalPackageReference Include="IsExternalInit" Version="1.0.3" />
5353
<GlobalPackageReference Include="Microsoft.VisualStudio.Internal.MicroBuild.VisualStudio" Version="$(MicroBuildVersion)" />
54-
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" />
54+
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.139" />
5555
<GlobalPackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556" />
5656
</ItemGroup>
57-
<ItemGroup>
58-
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
59-
</ItemGroup>
6057
</Project>

azure-pipelines/Archive-SourceCode.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,25 @@ if ($PSCmdlet.ShouldProcess('source archival request', 'post')) {
203203

204204
$Response = Invoke-WebRequest -Uri $SourceCodeArchivalUri -Method POST -Body $RequestJson -ContentType "application/json" -UseBasicParsing -SkipHttpErrorCheck
205205
Write-Host "Status Code : " -NoNewline
206-
$responseContent = ConvertFrom-Json ($Response.Content)
207206
if ($Response.StatusCode -eq 200) {
208207
Write-Host $Response.StatusCode -ForegroundColor Green
209208
Write-Host "Ticket ID : " -NoNewline
209+
$responseContent = ConvertFrom-Json ($Response.Content)
210210
Write-Host $responseContent
211211
}
212212
else {
213-
$responseContent = ConvertFrom-Json $Response.Content
214213
Write-Host $Response.StatusCode -ForegroundColor Red
215-
Write-Host "Message : $($responseContent.message)"
214+
try {
215+
$responseContent = ConvertFrom-Json $Response.Content
216+
Write-Host "Message : $($responseContent.message)"
217+
}
218+
catch {
219+
Write-Host "JSON Parse Error: $($_.Exception.Message)"
220+
Write-Host "Raw response content:"
221+
Write-Host $Response.Content
222+
}
223+
224+
exit 2
216225
}
217226
} elseif ($SourceCodeArchivalUri) {
218227
Write-Host "Would have posted to $SourceCodeArchivalUri"

azure-pipelines/WIFtoPATauth.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
parameters:
2+
- name: deadPATServiceConnectionId # The GUID of the PAT-based service connection whose access token must be replaced.
3+
type: string
4+
- name: wifServiceConnectionName # The name of the WIF service connection to use to get the access token.
5+
type: string
6+
- name: resource # The scope for which the access token is requested.
7+
type: string
8+
default: 499b84ac-1321-427f-aa17-267ca6975798 # Azure Artifact feeds (any of them)
9+
10+
steps:
11+
- task: AzureCLI@2
12+
displayName: 🔏 Authenticate with WIF service connection
13+
inputs:
14+
azureSubscription: ${{ parameters.wifServiceConnectionName }}
15+
scriptType: pscore
16+
scriptLocation: inlineScript
17+
inlineScript: |
18+
$accessToken = az account get-access-token --query accessToken --resource '${{ parameters.resource }}' -o tsv
19+
# Set the access token as a secret, so it doesn't get leaked in the logs
20+
Write-Host "##vso[task.setsecret]$accessToken"
21+
# Override the apitoken of the nuget service connection, for the duration of this stage
22+
Write-Host "##vso[task.setendpoint id=${{ parameters.deadPATServiceConnectionId }};field=authParameter;key=apitoken]$accessToken"

azure-pipelines/install-dependencies.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,25 @@ parameters:
22
- name: initArgs
33
type: string
44
default: ''
5+
- name: needsAzurePublicFeeds
6+
type: boolean
7+
default: true # If nuget.config pulls from the azure-public account, we need to authenticate when building on the devdiv account.
58
- name: setVariables
69
type: boolean
710
default: true
811

912
steps:
13+
- ${{ if and(parameters.needsAzurePublicFeeds, eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9')) }}:
14+
- template: WIFtoPATauth.yml
15+
parameters:
16+
wifServiceConnectionName: azure-public/vside package pull
17+
deadPATServiceConnectionId: 0ae39abc-4d06-4436-a7b5-865833df49db # azure-public/msft_consumption
1018

1119
- task: NuGetAuthenticate@1
1220
displayName: 🔏 Authenticate NuGet feeds
1321
inputs:
14-
${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
15-
nuGetServiceConnections: azure-public/msft_consumption # Only necessary for GitHub-hosted repos
16-
forceReinstallCredentialProvider: true
22+
${{ if and(parameters.needsAzurePublicFeeds, eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9')) }}:
23+
nuGetServiceConnections: azure-public/msft_consumption
1724

1825
- powershell: |
1926
$AccessToken = '$(System.AccessToken)' # Avoid specifying the access token directly on the init.ps1 command line to avoid it showing up in errors

azure-pipelines/official.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ parameters:
2424
# As an entrypoint pipeline yml file, all parameters here show up in the Queue Run dialog.
2525
# If any paramaters should NOT be queue-time options, they should be removed from here
2626
# and references to them in this file replaced with hard-coded values.
27-
- name: RealSign
28-
displayName: Real sign?
27+
- name: ForceOfficialBuild
28+
displayName: Official build (sign, compliance, etc.)
2929
type: boolean
30-
default: false
30+
default: false # this should remain false so PR builds using this pipeline are unofficial
3131
- name: ShouldSkipOptimize
3232
displayName: Skip OptProf optimization
3333
type: boolean
@@ -40,14 +40,10 @@ parameters:
4040
displayName: Run tests
4141
type: boolean
4242
default: true
43-
- name: EnableCompliance
44-
displayName: Run Compliance Tools
45-
type: boolean
46-
default: true
4743
- name: EnableAPIScan
48-
displayName: Include APIScan with Compliance tools
44+
displayName: Include APIScan with compliance tools
4945
type: boolean
50-
default: true
46+
default: true # enable in individual repos only AFTER updating TSAOptions.json with your own values
5147

5248
resources:
5349
repositories:
@@ -60,18 +56,22 @@ variables:
6056
- template: GlobalVariables.yml
6157

6258
extends:
63-
${{ if parameters.EnableCompliance }}:
59+
${{ if or(parameters.ForceOfficialBuild, eq(variables['Build.Reason'],'Schedule')) }}:
6460
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
6561
parameters:
6662
sdl:
6763
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
64+
codeSignValidation:
65+
enabled: true
66+
break: true
67+
additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\**
6868
policheck:
6969
enabled: true
7070
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
7171
suppression:
7272
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
7373
sbom:
74-
enabled: ${{ or(parameters.RealSign, eq(variables['Build.Reason'],'Schedule')) }} # Disable the generation for SBOMs for artifacts in unsigned builds since it's slow
74+
enabled: true
7575
stages:
7676
- stage: Build
7777
variables:
@@ -80,9 +80,9 @@ extends:
8080
- template: /azure-pipelines/build.yml@self
8181
parameters:
8282
Is1ESPT: true
83-
RealSign: ${{ or(parameters.RealSign, eq(variables['Build.Reason'],'Schedule')) }}
83+
RealSign: true
8484
ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
85-
EnableAPIScan: ${{ and(parameters.EnableCompliance, parameters.EnableAPIScan, ne(variables['Build.Reason'], 'pullRequest')) }}
85+
EnableAPIScan: ${{ and(parameters.EnableAPIScan, ne(variables['Build.Reason'], 'pullRequest')) }}
8686
windowsPool: VSEngSS-MicroBuild2022-1ES
8787
linuxPool:
8888
name: AzurePipelines-EO
@@ -97,7 +97,7 @@ extends:
9797
RunTests: ${{ parameters.RunTests }}
9898
- template: /azure-pipelines/prepare-insertion-stages.yml@self
9999
parameters:
100-
RealSign: ${{ or(parameters.RealSign, eq(variables['Build.Reason'],'Schedule')) }}
100+
RealSign: true
101101
${{ else }}:
102102
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
103103
parameters:
@@ -113,9 +113,9 @@ extends:
113113
- template: /azure-pipelines/build.yml@self
114114
parameters:
115115
Is1ESPT: true
116-
RealSign: ${{ or(parameters.RealSign, eq(variables['Build.Reason'],'Schedule')) }}
116+
RealSign: false
117117
ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
118-
EnableAPIScan: ${{ and(parameters.EnableCompliance, parameters.EnableAPIScan, ne(variables['Build.Reason'], 'pullRequest')) }}
118+
EnableAPIScan: false
119119
windowsPool: VSEngSS-MicroBuild2022-1ES
120120
linuxPool:
121121
name: AzurePipelines-EO
@@ -130,4 +130,4 @@ extends:
130130
RunTests: ${{ parameters.RunTests }}
131131
- template: /azure-pipelines/prepare-insertion-stages.yml@self
132132
parameters:
133-
RealSign: ${{ or(parameters.RealSign, eq(variables['Build.Reason'],'Schedule')) }}
133+
RealSign: false

0 commit comments

Comments
 (0)