Skip to content

Commit

Permalink
Merge pull request #1174 from microsoft/libtemplateUpdate
Browse files Browse the repository at this point in the history
Merge latest Library.Template
  • Loading branch information
AArnott authored May 9, 2024
2 parents 67da07f + c3dfe42 commit 6e5cb82
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 55 deletions.
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"isRoot": true,
"tools": {
"powershell": {
"version": "7.4.1",
"version": "7.4.2",
"commands": [
"pwsh"
]
},
"dotnet-coverage": {
"version": "17.10.3",
"version": "17.11.0",
"commands": [
"dotnet-coverage"
]
Expand All @@ -21,4 +21,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<PackageVersion Include="System.Text.Encodings.Web" Version="4.7.1" />
<PackageVersion Include="System.Text.Json" Version="4.7.2" />
<PackageVersion Include="Xunit.Combinatorial" Version="1.6.24" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
<PackageVersion Include="xunit" Version="2.8.0" />
</ItemGroup>
<ItemGroup Condition="'$(IsTestProject)'!='true'">
<!-- These versions carefully chosen to support VS 2019 Update 11. -->
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines/OptProf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ stages:
targetType: filePath
filePath: $(Agent.TempDirectory)/Variables-Windows/_pipelines.ps1
- task: NuGetCommand@2
displayName: Push CoreXT packages to VS feed
displayName: Push VS-repo packages to VS feed
inputs:
command: push
packagesToPush: $(Agent.TempDirectory)/VSInsertion-Windows/*.nupkg
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/apiscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
displayName: 📢 collect apiscan artifact
targetPath: $(Pipeline.Workspace)/.gdn/.r/apiscan/001/Logs
artifactName: apiscan-logs
condition: succeededOrFailed()
variables:
- name: SymbolsFeatureName
value: $[ dependencies.Windows.outputs['SetPipelineVariables.SymbolsFeatureName'] ]
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/archive-sourcecode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ parameters:

variables:
- group: VS Core team # Expected to provide ManagerAlias, SourceCodeArchivalUri
- template: GlobalVariables.yml

extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
Expand Down
30 changes: 1 addition & 29 deletions azure-pipelines/artifacts/VSInsertion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (!$BuildConfiguration) {
$BuildConfiguration = 'Debug'
}

$NuGetPackages = "$RepoRoot/bin/Packages/$BuildConfiguration/NuGet"
$NuGetPackages = "$RepoRoot/bin/Packages/$BuildConfiguration"

if (!(Test-Path $NuGetPackages)) {
Write-Warning "Skipping because NuGet packages haven't been built yet."
Expand All @@ -27,32 +27,4 @@ $result = @{
"$NuGetPackages" = (Get-ChildItem $NuGetPackages -Recurse)
}

if ($env:IsOptProf) {
$CoreXTPackages = "$RepoRoot/bin/Packages/$BuildConfiguration/CoreXT"

$ArtifactBasePath = "$RepoRoot\obj\_artifacts"
$ArtifactPath = "$ArtifactBasePath\VSInsertion"
if (-not (Test-Path $ArtifactPath)) { New-Item -ItemType Directory -Path $ArtifactPath | Out-Null }

$profilingInputs = [xml](Get-Content -Path "$PSScriptRoot\..\ProfilingInputs.props")
$profilingInputs.Project.ItemGroup.TestStore.Include = "vstsdrop:" + (& "$PSScriptRoot\..\variables\ProfilingInputsDropName.ps1")
$profilingInputs.Save("$ArtifactPath\ProfilingInputs.props")

$InsertionMetadataVersion = $(dotnet tool run nbgv get-version -p "$RepoRoot\src" -f json | ConvertFrom-Json).NuGetPackageVersion
if ($env:BUILD_BUILDID) {
# We must ensure unique versions for the insertion metadata package so
# it can contain information that is unique to this build.
# In particular it includes the ProfilingInputsDropName, which contains the BuildId.
# A non-unique package version here may collide with a prior run of this same commit,
# ultimately resulting in a failure of the optprof run.
$InsertionMetadataVersion += '.' + $env:BUILD_BUILDID
}
& (& "$PSScriptRoot\..\Get-NuGetTool.ps1") pack "$PSScriptRoot\..\InsertionMetadataPackage.nuspec" -OutputDirectory $CoreXTPackages -BasePath $ArtifactPath -Version $InsertionMetadataVersion | Out-Null
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

$result["$CoreXTPackages"] = (Get-ChildItem "$CoreXTPackages\LibraryName.VSInsertionMetadata.$InsertionMetadataVersion.nupkg");
}

$result
2 changes: 1 addition & 1 deletion azure-pipelines/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ steps:
condition: and(succeeded(), ${{ parameters.RunTests }})

- ${{ if parameters.IsOptProf }}:
# We have to artifically run this script so that the extra .nupkg is produced for variables/InsertConfigValues.ps1 to notice.
# We have to artifically run this script so that the extra .nupkg is produced for variables/InsertPropsValues.ps1 to notice.
- powershell: azure-pipelines\artifacts\VSInsertion.ps1
displayName: 🔧 Prepare VSInsertion artifact

Expand Down
14 changes: 0 additions & 14 deletions azure-pipelines/variables/InsertConfigValues.ps1

This file was deleted.

10 changes: 5 additions & 5 deletions azure-pipelines/variables/InsertPropsValues.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
$BinPath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\..\bin\Packages\$env:BUILDCONFIGURATION")
$InsertedPkgs = (& "$PSScriptRoot\..\artifacts\VSInsertion.ps1")

$dirsToSearch = "$BinPath\*.nupkg" |? { Test-Path $_ }
$icv=@()
if ($dirsToSearch) {
Get-ChildItem -Path $dirsToSearch |% {
if ($_.Name -match "^(.*)\.(\d+\.\d+\.\d+(?:-.*?)?)(?:\.symbols)?\.nupkg$") {
foreach ($kvp in $InsertedPkgs.GetEnumerator()) {
$kvp.Value |% {
if ($_.Name -match "^(.*?)\.(\d+\.\d+\.\d+(?:\.\d+)?(?:-.*?)?)(?:\.symbols)?\.nupkg$") {
$id = $Matches[1]
$version = $Matches[2]
$icv += "$id=$version"
}
}
}
Expand Down

0 comments on commit 6e5cb82

Please sign in to comment.