Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate

This commit is contained in:
Andrew Arnott 2024-07-03 12:41:24 -06:00
Родитель 0361871a9d 71b9db8237
Коммит c2dd7ea636
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F33A420C60ED9C6F
9 изменённых файлов: 38 добавлений и 9 удалений

Просмотреть файл

@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"powershell": {
"version": "7.4.2",
"version": "7.4.3",
"commands": [
"pwsh"
]
@ -21,4 +21,4 @@
]
}
}
}
}

3
.gitignore поставляемый
Просмотреть файл

@ -352,3 +352,6 @@ MigrationBackup/
# mac-created file to track user view preferences for a directory
.DS_Store
# Analysis results
*.sarif

Просмотреть файл

@ -6,7 +6,6 @@
<BaseIntermediateOutputPath>$(RepoRootPath)obj\$([MSBuild]::MakeRelative($(RepoRootPath), $(MSBuildProjectDirectory)))\</BaseIntermediateOutputPath>
<BaseOutputPath Condition=" '$(BaseOutputPath)' == '' ">$(RepoRootPath)bin\$(MSBuildProjectName)\</BaseOutputPath>
<PackageOutputPath>$(RepoRootPath)bin\Packages\$(Configuration)\NuGet\</PackageOutputPath>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AnalysisLevel>latest</AnalysisLevel>

Просмотреть файл

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<LangVersion Condition="'$(Language)'=='C#'">12</LangVersion>
<LangVersion Condition="'$(Language)'=='VB'">16.9</LangVersion>
</PropertyGroup>
<ItemGroup>
<!-- Avoid compile error about missing namespace when combining ImplicitUsings with .NET Framework target frameworks. -->
<Using Remove="System.Net.Http" Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'" />

Просмотреть файл

@ -35,7 +35,7 @@
.PARAMETER SourceCodeArchivalUri
The URI to POST the source code archival request to.
This value will typically come automatically by a variable group associated with your pipeline.
You can also look it up at https://dpsrequestforms.azurewebsites.net/#/help -> SCA Request Help -> SCA API Help -> Description
You can also look it up at https://dpsopsrequestforms.azurewebsites.net/#/help -> SCA Request Help -> SCA API Help -> Description
#>
[CmdletBinding(SupportsShouldProcess = $true, PositionalBinding = $false)]
param (
@ -76,7 +76,9 @@ param (
[Parameter()]
[string]$ServerPath = '',
[Parameter()]
[Uri]$SourceCodeArchivalUri = $env:SOURCECODEARCHIVALURI
[Uri]$SourceCodeArchivalUri = $env:SOURCECODEARCHIVALURI,
[Parameter(Mandatory = $true)]
[string]$AccessToken
)
function Invoke-Git() {
@ -199,9 +201,13 @@ if ($PSCmdlet.ShouldProcess('source archival request', 'post')) {
exit 1
}
$headers = @{
'Authorization' = "Bearer $AccessToken"
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$Response = Invoke-WebRequest -Uri $SourceCodeArchivalUri -Method POST -Body $RequestJson -ContentType "application/json" -UseBasicParsing -SkipHttpErrorCheck
$Response = Invoke-WebRequest -Uri $SourceCodeArchivalUri -Method POST -Headers $headers -Body $RequestJson -ContentType "application/json" -UseBasicParsing -SkipHttpErrorCheck
Write-Host "Status Code : " -NoNewline
if ($Response.StatusCode -eq 200) {
Write-Host $Response.StatusCode -ForegroundColor Green

Просмотреть файл

@ -63,7 +63,16 @@ extends:
- powershell: azure-pipelines/variables/_pipelines.ps1
failOnStderr: true
displayName: ⚙ Set pipeline variables based on source
- powershell: >
- task: AzureCLI@2
displayName: 🔏 Authenticate with WIF service connection
inputs:
azureSubscription: VS Core Source Code Archival
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
$accessToken = az account get-access-token --query accessToken --resource api://177cf50a-4bf5-4481-8b7e-f32900dfc8e6 -o tsv
Write-Host "##vso[task.setvariable variable=scaToken;issecret=true]$accessToken"
- pwsh: >
$TeamAlias = '$(TeamEmail)'.Substring(0, '$(TeamEmail)'.IndexOf('@'))
azure-pipelines/Archive-SourceCode.ps1
@ -73,6 +82,7 @@ extends:
-ProductName '$(SymbolsFeatureName)'
-ProductLanguage English
-Notes '${{ parameters.notes }}'
-AccessToken '$(scaToken)'
-Verbose
-WhatIf:$${{ parameters.whatif }}
displayName: 🗃️ Submit archival request

Просмотреть файл

@ -11,7 +11,7 @@ steps:
displayName: 🔍 Verify Signed Files
inputs:
TargetFolders: |
$(Build.SourcesDirectory)/bin/Packages/$(BuildConfiguration)/NuGet
$(Build.SourcesDirectory)/bin/Packages/$(BuildConfiguration)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- ${{ if parameters.IsOptProf }}:

6
src/AssemblyInfo.vb Normal file
Просмотреть файл

@ -0,0 +1,6 @@
' Copyright (c) Microsoft Corporation. All rights reserved.
' Licensed under the MIT license. See LICENSE file in the project root for full license information.
Imports System.Runtime.InteropServices
<Assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)>

Просмотреть файл

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.cs" Condition=" '$(Language)'=='C#' " />
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.vb" Condition=" '$(Language)'=='VB' " />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove($(MSBuildThisFile), $(MSBuildThisFileDirectory)..))" />