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

This commit is contained in:
Andrew Arnott 2023-05-18 06:31:23 -06:00
Родитель 86557d69b2 4406d85960
Коммит f05639d216
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F33A420C60ED9C6F
7 изменённых файлов: 36 добавлений и 14 удалений

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

@ -1,5 +1,5 @@
# Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions
FROM mcr.microsoft.com/dotnet/sdk:7.0.101-jammy
FROM mcr.microsoft.com/dotnet/sdk:7.0.203-jammy
# Installing mono makes `dotnet test` work without errors even for net472.
# But installing it takes a long time, so it's excluded by default.

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

@ -24,7 +24,6 @@ parameters:
default: true
variables:
MSBuildTreatWarningsAsErrors: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BuildConfiguration: Release
# codecov_token: 4dc9e7e2-6b01-4932-a180-847b52b43d35 # Get a new one from https://codecov.io/

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

@ -2,7 +2,8 @@ parameters:
RunTests:
steps:
- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog"
- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnaserror /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog"
displayName: 🛠 dotnet build
- powershell: azure-pipelines/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults

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

@ -51,7 +51,6 @@ stages:
- stage: Build
variables:
MSBuildTreatWarningsAsErrors: false # re-enable after LOC warnings have been resolved
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BuildConfiguration: Release
NUGET_PACKAGES: $(Agent.TempDirectory)/.nuget/packages

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

@ -28,7 +28,6 @@ steps:
!**/linux-*/**
!**/osx*/**
TargetFolder: $(Build.ArtifactStagingDirectory)/APIScanInputs
condition: and(succeeded(), ${{ parameters.EnableAPIScan }}, ne(variables.ApiScanClientId, ''))
- task: BinSkim@4
displayName: 🔍 Run BinSkim

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

@ -1,3 +1,27 @@
[string]::join(',',(@{
'MicrosoftVisualStudioThreadingVersion' = & { (dotnet tool run nbgv get-version --project "$PSScriptRoot\..\..\src\Microsoft.VisualStudio.Threading" --format json | ConvertFrom-Json).AssemblyVersion };
}.GetEnumerator() |% { "$($_.key)=$($_.value)" }))
$MacroName = 'MicrosoftVisualStudioThreadingVersion'
$SampleProject = "$PSScriptRoot\..\..\src\Microsoft.VisualStudio.Threading"
try {
return [string]::join(',',(@{
($MacroName) = & { (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion };
}.GetEnumerator() |% { "$($_.key)=$($_.value)" }))
}
catch {
Write-Error $_
Write-Error "Failed. Diagnostic data proceeds:"
[string]::join(',',(@{
($MacroName) = & {
Write-Host "dotnet tool run nbgv get-version --project `"$SampleProject`" --format json"
$result1 = dotnet tool run nbgv get-version --project $SampleProject --format json
Write-Host $result1
$result2 = dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json
Write-Host $result2
Write-Host $result2.AssemblyVersion
Write-Host (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion
Write-Output (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion
};
}.GetEnumerator() |% { "$($_.key)=$($_.value)" }))
Write-Host "one more..."
$r = & { (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion };
Write-Host $r
}

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

@ -102,13 +102,13 @@ Push-Location $PSScriptRoot
try {
$HeaderColor = 'Green'
if (!$NoRestore -and $PSCmdlet.ShouldProcess("NuGet packages", "Restore")) {
$RestoreArguments = @()
if ($Interactive)
{
$RestoreArguments += '--interactive'
}
$RestoreArguments = @()
if ($Interactive)
{
$RestoreArguments += '--interactive'
}
if (!$NoRestore -and $PSCmdlet.ShouldProcess("NuGet packages", "Restore")) {
Write-Host "Restoring NuGet packages" -ForegroundColor $HeaderColor
dotnet restore @RestoreArguments
if ($lastexitcode -ne 0) {