Skip to content

Commit 52278b9

Browse files
authored
Merge pull request #1054 from AArnott/libtemplateUpdate
Merge latest Library.Template
2 parents b98ecd9 + 6c5aaed commit 52278b9

13 files changed

+67
-56
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
@@ -57,23 +57,4 @@
5757
<PackageReleaseNotes Condition="'$(PackageProjectUrl)'!=''">$(PackageProjectUrl)/releases/tag/v$(Version)</PackageReleaseNotes>
5858
</PropertyGroup>
5959
</Target>
60-
61-
<PropertyGroup Condition="'$(IsWpfTempProject)' == ''">
62-
<IsWpfTempProject>false</IsWpfTempProject>
63-
<IsWpfTempProject Condition="$(MSBuildProjectName.EndsWith('_wpftmp'))">true</IsWpfTempProject>
64-
</PropertyGroup>
65-
66-
<!--
67-
Inspired by https://github.com/dotnet/arcade/blob/cbfa29d4e859622ada3d226f90f103f659665d31/src/Microsoft.DotNet.Arcade.Sdk/tools/Workarounds.props#L14-L31
68-
69-
Disable Source Link and Xliff in WPF temp projects to avoid generating non-deterministic file names to obj dir.
70-
The project name is non-deterministic and is included in the Source Link json file name and xlf directory names.
71-
It's also not necessary to generate these assets.
72-
-->
73-
<PropertyGroup Condition="'$(IsWpfTempProject)' == 'true'">
74-
<EnableSourceLink>false</EnableSourceLink>
75-
<EmbedUntrackedSources>false</EmbedUntrackedSources>
76-
<DeterministicSourcePaths>false</DeterministicSourcePaths>
77-
<EnableXlfLocalization>false</EnableXlfLocalization>
78-
</PropertyGroup>
7960
</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
@@ -17,7 +17,7 @@
1717
<PackageVersion Include="Microsoft.AspNetCore" Version="2.2.0" />
1818
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
1919
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
20-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
20+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
2121
<PackageVersion Include="Microsoft.VisualStudio.Internal.MicroBuild.NonShipping" Version="$(MicroBuildVersion)" />
2222
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="$(VisualStudioThreadingVersion)" />
2323
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="$(VisualStudioThreadingVersion)" />
@@ -34,22 +34,19 @@
3434
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
3535
<PackageVersion Include="xunit.combinatorial" Version="1.6.24" />
3636
<PackageVersion Include="xunit.runner.console" Version="2.5.3" />
37-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
37+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
3838
<PackageVersion Include="xunit.skippablefact" Version="1.4.13" />
3939
<PackageVersion Include="xunit.stafact" Version="1.1.11" />
40-
<PackageVersion Include="xunit" Version="2.8.0" />
40+
<PackageVersion Include="xunit" Version="2.8.1" />
4141
</ItemGroup>
4242
<ItemGroup>
4343
<GlobalPackageReference Include="CSharpIsNullAnalyzer" Version="0.1.495" />
4444
<GlobalPackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" />
4545
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
4646
<GlobalPackageReference Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="3.11.0-beta1.24122.1" />
4747
<GlobalPackageReference Include="Microsoft.VisualStudio.Internal.MicroBuild.VisualStudio" Version="$(MicroBuildVersion)" />
48-
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" />
48+
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.139" />
4949
<GlobalPackageReference Include="Nullable" Version="1.3.1" />
5050
<GlobalPackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556" />
5151
</ItemGroup>
52-
<ItemGroup>
53-
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
54-
</ItemGroup>
5552
</Project>

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: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
parameters:
2-
initArgs:
2+
- name: initArgs
3+
type: string
4+
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.
38

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

616
- task: NuGetAuthenticate@1
717
displayName: 🔏 Authenticate NuGet feeds
818
inputs:
9-
${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
10-
nuGetServiceConnections: azure-public/msft_consumption # Only necessary for GitHub-hosted repos
11-
forceReinstallCredentialProvider: true
19+
${{ if and(parameters.needsAzurePublicFeeds, eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9')) }}:
20+
nuGetServiceConnections: azure-public/msft_consumption
1221

1322
- powershell: |
1423
$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
@@ -23,10 +23,10 @@ parameters:
2323
# As an entrypoint pipeline yml file, all parameters here show up in the Queue Run dialog.
2424
# If any paramaters should NOT be queue-time options, they should be removed from here
2525
# and references to them in this file replaced with hard-coded values.
26-
- name: RealSign
27-
displayName: Real sign?
26+
- name: ForceOfficialBuild
27+
displayName: Official build (sign, compliance, etc.)
2828
type: boolean
29-
default: false
29+
default: false # this should remain false so PR builds using this pipeline are unofficial
3030
- name: ShouldSkipOptimize
3131
displayName: Skip OptProf optimization
3232
type: boolean
@@ -39,14 +39,10 @@ parameters:
3939
displayName: Run tests
4040
type: boolean
4141
default: true
42-
- name: EnableCompliance
43-
displayName: Run Compliance Tools
44-
type: boolean
45-
default: true
4642
- name: EnableAPIScan
47-
displayName: Include APIScan with Compliance tools
43+
displayName: Include APIScan with compliance tools
4844
type: boolean
49-
default: true
45+
default: true # enable in individual repos only AFTER updating TSAOptions.json with your own values
5046

5147
resources:
5248
repositories:
@@ -59,18 +55,22 @@ variables:
5955
- template: GlobalVariables.yml
6056

6157
extends:
62-
${{ if parameters.EnableCompliance }}:
58+
${{ if or(parameters.ForceOfficialBuild, eq(variables['Build.Reason'],'Schedule')) }}:
6359
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
6460
parameters:
6561
sdl:
6662
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
63+
codeSignValidation:
64+
enabled: true
65+
break: true
66+
additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\**
6767
policheck:
6868
enabled: true
6969
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
7070
suppression:
7171
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
7272
sbom:
73-
enabled: ${{ or(parameters.RealSign, eq(variables['Build.Reason'],'Schedule')) }} # Disable the generation for SBOMs for artifacts in unsigned builds since it's slow
73+
enabled: true
7474
credscan:
7575
suppressionsFile: $(Build.SourcesDirectory)/azure-pipelines/CredScanSuppressions.json
7676
debugMode: true # required for whole directory suppressions
@@ -82,9 +82,9 @@ extends:
8282
- template: /azure-pipelines/build.yml@self
8383
parameters:
8484
Is1ESPT: true
85-
RealSign: ${{ or(parameters.RealSign, eq(variables['Build.Reason'],'Schedule')) }}
85+
RealSign: true
8686
ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
87-
EnableAPIScan: ${{ and(parameters.EnableCompliance, parameters.EnableAPIScan, ne(variables['Build.Reason'], 'pullRequest')) }}
87+
EnableAPIScan: ${{ and(parameters.EnableAPIScan, ne(variables['Build.Reason'], 'pullRequest')) }}
8888
windowsPool: VSEngSS-MicroBuild2022-1ES
8989
linuxPool:
9090
name: AzurePipelines-EO
@@ -99,7 +99,7 @@ extends:
9999
RunTests: ${{ parameters.RunTests }}
100100
- template: /azure-pipelines/prepare-insertion-stages.yml@self
101101
parameters:
102-
RealSign: ${{ or(parameters.RealSign, eq(variables['Build.Reason'],'Schedule')) }}
102+
RealSign: true
103103
${{ else }}:
104104
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
105105
parameters:
@@ -117,9 +117,9 @@ extends:
117117
- template: /azure-pipelines/build.yml@self
118118
parameters:
119119
Is1ESPT: true
120-
RealSign: ${{ or(parameters.RealSign, eq(variables['Build.Reason'],'Schedule')) }}
120+
RealSign: false
121121
ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
122-
EnableAPIScan: ${{ and(parameters.EnableCompliance, parameters.EnableAPIScan, ne(variables['Build.Reason'], 'pullRequest')) }}
122+
EnableAPIScan: false
123123
windowsPool: VSEngSS-MicroBuild2022-1ES
124124
linuxPool:
125125
name: AzurePipelines-EO
@@ -134,4 +134,4 @@ extends:
134134
RunTests: ${{ parameters.RunTests }}
135135
- template: /azure-pipelines/prepare-insertion-stages.yml@self
136136
parameters:
137-
RealSign: ${{ or(parameters.RealSign, eq(variables['Build.Reason'],'Schedule')) }}
137+
RealSign: false

azure-pipelines/prepare-insertion-stages.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@ stages:
6262
- download: current
6363
artifact: deployables-Windows
6464
displayName: 🔻 Download deployables-Windows artifact
65+
- template: WIFtoPATauth.yml
66+
parameters:
67+
wifServiceConnectionName: azure-public/vside package push
68+
deadPATServiceConnectionId: 42175e93-c771-4a4f-a132-3cca78f44b3b # azure-public/vssdk

0 commit comments

Comments
 (0)