Skip to content

Commit 86f316f

Browse files
authored
Merge pull request #1333 from AArnott/libtemplateUpdate
Merge latest Library.Template
2 parents a333d60 + 773ae38 commit 86f316f

File tree

9 files changed

+38
-9
lines changed

9 files changed

+38
-9
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"powershell": {
6-
"version": "7.4.2",
6+
"version": "7.4.3",
77
"commands": [
88
"pwsh"
99
]
@@ -21,4 +21,4 @@
2121
]
2222
}
2323
}
24-
}
24+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,6 @@ MigrationBackup/
352352

353353
# mac-created file to track user view preferences for a directory
354354
.DS_Store
355+
356+
# Analysis results
357+
*.sarif

Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<BaseIntermediateOutputPath>$(RepoRootPath)obj\$([MSBuild]::MakeRelative($(RepoRootPath), $(MSBuildProjectDirectory)))\</BaseIntermediateOutputPath>
77
<BaseOutputPath Condition=" '$(BaseOutputPath)' == '' ">$(RepoRootPath)bin\$(MSBuildProjectName)\</BaseOutputPath>
88
<PackageOutputPath>$(RepoRootPath)bin\Packages\$(Configuration)\NuGet\</PackageOutputPath>
9-
<LangVersion>12</LangVersion>
109
<Nullable>enable</Nullable>
1110
<ImplicitUsings>disable</ImplicitUsings>
1211
<AnalysisLevel>latest</AnalysisLevel>

Directory.Build.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
3+
<PropertyGroup>
4+
<LangVersion Condition="'$(Language)'=='C#'">12</LangVersion>
5+
<LangVersion Condition="'$(Language)'=='VB'">16.9</LangVersion>
6+
</PropertyGroup>
37
<ItemGroup>
48
<!-- Avoid compile error about missing namespace when combining ImplicitUsings with .NET Framework target frameworks. -->
59
<Using Remove="System.Net.Http" Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'" />

azure-pipelines/Archive-SourceCode.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
.PARAMETER SourceCodeArchivalUri
3636
The URI to POST the source code archival request to.
3737
This value will typically come automatically by a variable group associated with your pipeline.
38-
You can also look it up at https://dpsrequestforms.azurewebsites.net/#/help -> SCA Request Help -> SCA API Help -> Description
38+
You can also look it up at https://dpsopsrequestforms.azurewebsites.net/#/help -> SCA Request Help -> SCA API Help -> Description
3939
#>
4040
[CmdletBinding(SupportsShouldProcess = $true, PositionalBinding = $false)]
4141
param (
@@ -76,7 +76,9 @@ param (
7676
[Parameter()]
7777
[string]$ServerPath = '',
7878
[Parameter()]
79-
[Uri]$SourceCodeArchivalUri = $env:SOURCECODEARCHIVALURI
79+
[Uri]$SourceCodeArchivalUri = $env:SOURCECODEARCHIVALURI,
80+
[Parameter(Mandatory = $true)]
81+
[string]$AccessToken
8082
)
8183

8284
function Invoke-Git() {
@@ -199,9 +201,13 @@ if ($PSCmdlet.ShouldProcess('source archival request', 'post')) {
199201
exit 1
200202
}
201203

204+
$headers = @{
205+
'Authorization' = "Bearer $AccessToken"
206+
}
207+
202208
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
203209

204-
$Response = Invoke-WebRequest -Uri $SourceCodeArchivalUri -Method POST -Body $RequestJson -ContentType "application/json" -UseBasicParsing -SkipHttpErrorCheck
210+
$Response = Invoke-WebRequest -Uri $SourceCodeArchivalUri -Method POST -Headers $headers -Body $RequestJson -ContentType "application/json" -UseBasicParsing -SkipHttpErrorCheck
205211
Write-Host "Status Code : " -NoNewline
206212
if ($Response.StatusCode -eq 200) {
207213
Write-Host $Response.StatusCode -ForegroundColor Green

azure-pipelines/archive-sourcecode.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,16 @@ extends:
6363
- powershell: azure-pipelines/variables/_pipelines.ps1
6464
failOnStderr: true
6565
displayName: ⚙ Set pipeline variables based on source
66-
- powershell: >
66+
- task: AzureCLI@2
67+
displayName: 🔏 Authenticate with WIF service connection
68+
inputs:
69+
azureSubscription: VS Core Source Code Archival
70+
scriptType: pscore
71+
scriptLocation: inlineScript
72+
inlineScript: |
73+
$accessToken = az account get-access-token --query accessToken --resource api://177cf50a-4bf5-4481-8b7e-f32900dfc8e6 -o tsv
74+
Write-Host "##vso[task.setvariable variable=scaToken;issecret=true]$accessToken"
75+
- pwsh: >
6776
$TeamAlias = '$(TeamEmail)'.Substring(0, '$(TeamEmail)'.IndexOf('@'))
6877
6978
azure-pipelines/Archive-SourceCode.ps1
@@ -73,6 +82,7 @@ extends:
7382
-ProductName '$(SymbolsFeatureName)'
7483
-ProductLanguage English
7584
-Notes '${{ parameters.notes }}'
85+
-AccessToken '$(scaToken)'
7686
-Verbose
7787
-WhatIf:$${{ parameters.whatif }}
7888
displayName: 🗃️ Submit archival request

azure-pipelines/microbuild.after.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ steps:
1111
displayName: 🔍 Verify Signed Files
1212
inputs:
1313
TargetFolders: |
14-
$(Build.SourcesDirectory)/bin/Packages/$(BuildConfiguration)/NuGet
14+
$(Build.SourcesDirectory)/bin/Packages/$(BuildConfiguration)
1515
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
1616

1717
- ${{ if parameters.IsOptProf }}:

src/AssemblyInfo.vb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
' Copyright (c) Microsoft Corporation. All rights reserved.
2+
' Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
Imports System.Runtime.InteropServices
5+
6+
<Assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)>

src/Directory.Build.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<ItemGroup>
4-
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.cs" />
4+
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.cs" Condition=" '$(Language)'=='C#' " />
5+
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.vb" Condition=" '$(Language)'=='VB' " />
56
</ItemGroup>
67

78
<Import Project="$([MSBuild]::GetPathOfFileAbove($(MSBuildThisFile), $(MSBuildThisFileDirectory)..))" />

0 commit comments

Comments
 (0)