From e56affe8dda690242d5e54cf1bbcaa294dedee08 Mon Sep 17 00:00:00 2001
From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Date: Tue, 13 Oct 2026 01:20:28 +0900
Subject: [PATCH 1/5] Init
---
.config/dotnet-tools.json | 7 -
.editorconfig | 5 +-
.github/workflows/build.yml | 78 +++++--
.github/workflows/copilot-setup-steps.yml | 12 +-
.github/workflows/docs.yml | 11 +-
.github/workflows/docs_validate.yml | 19 +-
.github/workflows/libtemplate-update.yml | 98 --------
CONTRIBUTING.md | 67 ++----
Directory.Build.props | 12 +-
Directory.Packages.props | 6 +-
Directory.Solution.targets | 4 +
Microsoft.Windows.CsWin32.sln | 215 ------------------
Microsoft.Windows.CsWin32.slnx | 46 ++++
README.md | 4 +
azure-pipelines/NuGetSbom.props | 3 +
azure-pipelines/archive-sourcecode.yml | 2 +-
azure-pipelines/libtemplate-update.yml | 172 --------------
azure-pipelines/nuget.config | 13 ++
init.ps1 | 33 ++-
nuget.config | 17 +-
.../Microsoft.Windows.CsWin32.targets | 2 +
test/Directory.Build.props | 2 +-
test/Directory.Build.targets | 6 +
.../MyReferenceAssemblies.cs | 7 +-
test/Restore.Tests.ps1 | 54 ++++-
tools/Check-DotNetRuntime.ps1 | 41 ----
tools/Check-DotNetSdk.ps1 | 37 ---
tools/Convert-PDB.ps1 | 2 +-
tools/Get-LibTemplateBasis.ps1 | 25 --
tools/Get-ProcDump.ps1 | 6 +-
tools/Install-NuGetCredProvider.ps1 | 2 +-
tools/MergeFrom-Template.ps1 | 79 -------
32 files changed, 301 insertions(+), 786 deletions(-)
delete mode 100644 .github/workflows/libtemplate-update.yml
create mode 100644 Directory.Solution.targets
delete mode 100644 Microsoft.Windows.CsWin32.sln
create mode 100644 Microsoft.Windows.CsWin32.slnx
delete mode 100644 azure-pipelines/libtemplate-update.yml
create mode 100644 azure-pipelines/nuget.config
delete mode 100644 tools/Check-DotNetRuntime.ps1
delete mode 100644 tools/Check-DotNetSdk.ps1
delete mode 100644 tools/Get-LibTemplateBasis.ps1
delete mode 100644 tools/MergeFrom-Template.ps1
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 6149d84b..1d5a56f3 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -2,13 +2,6 @@
"version": 1,
"isRoot": true,
"tools": {
- "powershell": {
- "version": "7.6.6",
- "commands": [
- "pwsh"
- ],
- "rollForward": false
- },
"dotnet-coverage": {
"version": "18.12.0",
"commands": [
diff --git a/.editorconfig b/.editorconfig
index e4057392..a0b40cd5 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -201,5 +201,6 @@ dotnet_diagnostic.MsgPack002.severity = error
# CA2016: Forward the CancellationToken parameter
dotnet_diagnostic.CA2016.severity = warning
-[*.sln]
-indent_style = tab
+[*.slnx]
+indent_style = space
+indent_size = 2
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ea169edf..b49517d1 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -21,7 +21,6 @@ env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
NBGV_GitEngine: Disabled
BuildConfiguration: Release
- RestoreRetryCount: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login == 'renovate[bot]' && 10 || 1 }}
jobs:
build:
@@ -34,11 +33,17 @@ jobs:
- name: Verify restore retry behavior
run: ./test/Restore.Tests.ps1
shell: pwsh
- - name: โ๏ธ Install prerequisites
- run: ./init.ps1 -UpgradePrerequisites -NoNuGetCredProvider -RestoreRetryCount $env:RestoreRetryCount
- shell: pwsh
+ - name: โ๏ธ Install .NET
+ uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
+ with:
+ global-json-file: global.json
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
- name: ๐ ๏ธ Build
- run: dotnet build -t:build,pack -c ${{ env.BuildConfiguration }} -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904
+ run: dotnet build -c ${{ env.BuildConfiguration }} -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904
+ - name: ๐ฆ Pack
+ run: dotnet pack --no-build -c ${{ env.BuildConfiguration }}
- name: ๐ฆ Upload build output
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
@@ -54,14 +59,20 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- - name: โ๏ธ Install prerequisites
- run: ./init.ps1 -UpgradePrerequisites -NoNuGetCredProvider -RestoreRetryCount $env:RestoreRetryCount
- shell: pwsh
+ - name: โ๏ธ Install .NET
+ uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
+ with:
+ global-json-file: global.json
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
- name: ๐ฆ Download build
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-windows
path: bin/
+ - name: Restore packages
+ run: dotnet restore
- name: ๐งช Run tests
run: |
dotnet test --no-build -c ${{ env.BuildConfiguration }} `
@@ -87,9 +98,13 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- - name: โ๏ธ Install prerequisites
- run: ./init.ps1 -UpgradePrerequisites -NoNuGetCredProvider -RestoreRetryCount $env:RestoreRetryCount
- shell: pwsh
+ - name: โ๏ธ Install .NET
+ uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
+ with:
+ global-json-file: global.json
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
- name: ๐ฆ Download build
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
@@ -99,6 +114,8 @@ jobs:
# tests (Direct2D uses the WARP software rasterizer, so no GPU is required). They remain
# tagged RequiresHardware so the locked-down Azure DevOps 1ES build pool keeps excluding
# them, but we exercise the real runtime code paths here rather than only on dev machines.
+ - name: Restore packages
+ run: dotnet restore
- name: ๐งช Run hardware-dependent tests
run: |
dotnet test --no-build -c ${{ env.BuildConfiguration }} `
@@ -126,15 +143,23 @@ jobs:
- name: Verify restore retry behavior
run: ./test/Restore.Tests.ps1
shell: pwsh
- - name: โ๏ธ Install prerequisites
- run: ./init.ps1 -UpgradePrerequisites -NoNuGetCredProvider -RestoreRetryCount $env:RestoreRetryCount
- shell: pwsh
+ - name: โ๏ธ Install .NET
+ uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
+ with:
+ global-json-file: global.json
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
- name: โ๏ธ Install Mono
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends mono-complete
- name: ๐ ๏ธ Build
- run: dotnet build -t:build,pack -c ${{ env.BuildConfiguration }} -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904
+ run: dotnet build -c ${{ env.BuildConfiguration }} -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904
+ - name: ๐ฆ Pack
+ run: dotnet pack --no-build -c ${{ env.BuildConfiguration }}
+ - name: Restore packages
+ run: dotnet restore
- name: ๐งช Run tests
run: |
# Keep this list aligned with the portable projects exercised by the official Linux build.
@@ -203,14 +228,20 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- - name: โ๏ธ Install prerequisites
- run: ./init.ps1 -UpgradePrerequisites -NoNuGetCredProvider -RestoreRetryCount $env:RestoreRetryCount
- shell: pwsh
+ - name: โ๏ธ Install .NET
+ uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
+ with:
+ global-json-file: global.json
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
- name: ๐ฆ Download build
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-windows
path: bin/
+ - name: Restore packages
+ run: dotnet restore
- name: ๐งช Run heavy tests
run: |
dotnet test test/Microsoft.Windows.CsWin32.Tests --no-build -c ${{ env.BuildConfiguration }} `
@@ -220,6 +251,7 @@ jobs:
--logger trx `
--results-directory TestResults `
-- RunConfiguration.TreatNoTestsAsError=false
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
dotnet test test/CsWin32Generator.Tests --no-build -c ${{ env.BuildConfiguration }} `
--filter "${{ matrix.filter }}" `
--blame-hang-timeout 7200s `
@@ -246,9 +278,13 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
- - name: โ๏ธ Install prerequisites
- run: ./init.ps1 -UpgradePrerequisites -NoNuGetCredProvider -RestoreRetryCount $env:RestoreRetryCount
- shell: pwsh
+ - name: โ๏ธ Install .NET
+ uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
+ with:
+ global-json-file: global.json
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
- name: โ๏ธ Install .NET 8 analyzer-floor SDK
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml
index 71adf9e7..9dbe8a0f 100644
--- a/.github/workflows/copilot-setup-steps.yml
+++ b/.github/workflows/copilot-setup-steps.yml
@@ -29,9 +29,17 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- - name: โ Install prerequisites
+ - name: โ Install .NET
+ uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
+ with:
+ global-json-file: global.json
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
+ - name: Restore packages
run: |
- ./init.ps1 -UpgradePrerequisites -NoNuGetCredProvider
+ dotnet restore
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
dotnet --info
# Print mono version if it is present.
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 54228407..700579b5 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -27,8 +27,15 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- - name: โ Install prerequisites
- run: ./init.ps1 -UpgradePrerequisites
+ - name: โ Install .NET
+ uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
+ with:
+ global-json-file: global.json
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
+ - name: Restore CLI tools
+ run: dotnet tool restore
- run: dotnet docfx docfx/docfx.json
name: ๐ Generate documentation
diff --git a/.github/workflows/docs_validate.yml b/.github/workflows/docs_validate.yml
index 93ec12e6..f967fb71 100644
--- a/.github/workflows/docs_validate.yml
+++ b/.github/workflows/docs_validate.yml
@@ -8,13 +8,10 @@ on:
- main
- microbuild
-env:
- RestoreRetryCount: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login == 'renovate[bot]' && 10 || 1 }}
-
jobs:
build:
name: ๐ Doc validation
- runs-on: ubuntu-26.04
+ runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
@@ -23,11 +20,15 @@ jobs:
uses: becheran/mlc@b0d0d353e04fcbcfd1d86716103d78a61e5b25dd # v1.2.2
with:
args: --do-not-warn-for-redirect-to https://learn.microsoft.com*,https://dotnet.microsoft.com/*,https://dev.azure.com/*,https://app.codecov.io/* -p docfx -i https://aka.ms/onboardsupport,https://aka.ms/spot,https://msrc.microsoft.com/*,https://www.microsoft.com/msrc*,https://microsoft.com/msrc*,https://www.npmjs.com/package/*,https://get.dot.net/
- - name: โ Install prerequisites
- run: |
- ./init.ps1 -UpgradePrerequisites -RestoreRetryCount $env:RestoreRetryCount
- dotnet --info
- shell: pwsh
+ - name: โ Install .NET
+ uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
+ with:
+ global-json-file: global.json
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
+ - name: Restore CLI tools
+ run: dotnet tool restore
- name: ๐ Verify docfx build
run: dotnet docfx docfx/docfx.json --warningsAsErrors --disableGitFeatures
if: runner.os == 'Linux'
diff --git a/.github/workflows/libtemplate-update.yml b/.github/workflows/libtemplate-update.yml
deleted file mode 100644
index af1a9eef..00000000
--- a/.github/workflows/libtemplate-update.yml
+++ /dev/null
@@ -1,98 +0,0 @@
-name: โ Library.Template update
-
-# PREREQUISITE: This workflow requires the repo to be configured to allow workflows to create pull requests.
-# Visit https://github.com/USER/REPO/settings/actions
-# Under "Workflow permissions" check "Allow GitHub Actions to create ...pull requests"
-# Click Save.
-
-on:
- schedule:
- - cron: "0 3 * * Mon" # Sun @ 8 or 9 PM Mountain Time (depending on DST)
- workflow_dispatch:
-
-jobs:
- merge:
- runs-on: ubuntu-latest
- permissions:
- contents: write
- pull-requests: write
- steps:
- - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- with:
- fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
-
- - name: merge
- id: merge
- shell: pwsh
- run: |
- $LibTemplateBranch = & ./tools/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated
- if ($LASTEXITCODE -ne 0) {
- exit $LASTEXITCODE
- }
-
- git fetch https://github.com/aarnott/Library.Template $LibTemplateBranch
- if ($LASTEXITCODE -ne 0) {
- exit $LASTEXITCODE
- }
- $LibTemplateCommit = git rev-parse FETCH_HEAD
- git diff --stat ...FETCH_HEAD
-
- if ((git rev-list FETCH_HEAD ^HEAD --count) -eq 0) {
- Write-Host "There are no Library.Template updates to merge."
- echo "uptodate=true" >> $env:GITHUB_OUTPUT
- exit 0
- }
-
- # Pushing commits that add or change files under .github/workflows will cause our workflow to fail.
- # But it usually isn't necessary because the target branch already has (or doesn't have) these changes.
- # So if the merge doesn't bring in any changes to these files, try the merge locally and push that
- # to keep github happy.
- if ((git rev-list FETCH_HEAD ^HEAD --count -- .github/workflows) -eq 0) {
- # Indeed there are no changes in that area. So merge locally to try to appease GitHub.
- git checkout -b auto/libtemplateUpdate
- git config user.name "Andrew Arnott"
- git config user.email "andrewarnott@live.com"
- git merge FETCH_HEAD
- if ($LASTEXITCODE -ne 0) {
- Write-Host "Merge conflicts prevent creating the pull request. Please run tools/MergeFrom-Template.ps1 locally and push the result as a pull request."
- exit 2
- }
-
- git -c http.extraheader="AUTHORIZATION: bearer $env:GH_TOKEN" push origin -u HEAD
- } else {
- Write-Host "Changes to github workflows are included in this update. Please run tools/MergeFrom-Template.ps1 locally and push the result as a pull request."
- exit 1
- }
- - name: pull request
- shell: pwsh
- if: success() && steps.merge.outputs.uptodate != 'true'
- run: |
- # If there is already an active pull request, don't create a new one.
- $existingPR = gh pr list -H auto/libtemplateUpdate --json url | ConvertFrom-Json
- if ($existingPR) {
- Write-Host "::warning::Skipping pull request creation because one already exists at $($existingPR[0].url)"
- exit 0
- }
-
- $prTitle = "Merge latest Library.Template"
- $prBody = "This merges the latest features and fixes from [Library.Template's branch](https://github.com/AArnott/Library.Template/tree/).
-
- โ ๏ธ Do **not** squash this pull request when completing it. You must *merge* it.
-
-
- Merge conflicts?
- Resolve merge conflicts locally by carrying out these steps:
-
- ```
- git fetch
- git checkout auto/libtemplateUpdate
- git merge origin/main
- # resolve conflicts
- git commit
- git push
- ```
- "
-
- gh pr create -H auto/libtemplateUpdate -b $prBody -t $prTitle
- env:
- GH_TOKEN: ${{ github.token }}
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ad35a87d..14d85145 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -7,37 +7,29 @@ FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
with any additional questions or comments.
-## Best practices
+## Building and testing
-* Use Windows PowerShell or [PowerShell Core][pwsh] (including on Linux/OSX) to run .ps1 scripts.
- Some scripts set environment variables to help you, but they are only retained if you use PowerShell as your shell.
+Install the [.NET SDK](https://get.dot.net/) specified in `global.json` (or a newer patch in the same SDK feature band). On Windows, open `Microsoft.Windows.CsWin32.slnx` in a Visual Studio version that supports that SDK and C# 14, then build the solution. No initialization script, CLI tool restore, or custom shell environment is required.
-## Prerequisites
+From the repository root, the equivalent commands are:
-All dependencies can be installed by running the `init.ps1` script at the root of the repository
-using Windows PowerShell or [PowerShell Core][pwsh] (on any OS).
-Some dependencies installed by `init.ps1` may only be discoverable from the same command line environment the init script was run from due to environment variables, so be sure to launch Visual Studio or build the repo from that same environment.
-Alternatively, run `init.ps1 -InstallLocality Machine` (which may require elevation) in order to install dependencies at machine-wide locations so Visual Studio and builds work everywhere.
+```console
+dotnet build
+dotnet test --filter "TestCategory!=HighMemory&TestCategory!=RequiresHardware"
+dotnet pack -c Release
+```
-The only prerequisite for building, testing, and deploying from this repository
-is the [.NET SDK](https://get.dot.net/).
-You should install the version specified in `global.json` or a later version within
-the same major.minor.Bxx "hundreds" band.
-For example if 2.2.300 is specified, you may install 2.2.300, 2.2.301, or 2.2.310
-while the 2.2.400 version would not be considered compatible by .NET SDK.
-See [.NET Core Versioning](https://learn.microsoft.com/dotnet/core/versions/) for more information.
+Package restore runs automatically. Dependencies come from nuget.org, except for the source-generator testing previews available only on Microsoft's public `msft_consumption` feed; `nuget.config` maps those packages explicitly. `dotnet pack` builds the solution before packaging, including the non-packable generator and MSBuild task whose outputs are shipped in the package. Packages are written to `bin/Packages//NuGet`.
-## Package restore
+Tests target .NET 8, 9, 10, and .NET Framework 4.7.2. Install the corresponding runtimes to run the full matrix; the .NET 10 SDK alone is sufficient to compile it. Windows-specific tests need Windows; .NET Framework tests need .NET Framework on Windows or Mono on Linux/macOS. To build on Linux/macOS, use `dotnet build -p:Platform=NonWindows` and the same platform property when testing or packing.
-The easiest way to restore packages may be to run `init.ps1` which automatically authenticates
-to the feeds that packages for this repo come from, if any.
-`dotnet restore` or `nuget restore` also work but may require extra steps to authenticate to any applicable feeds.
+The excluded tests exercise large metadata sets or Windows runtime services. They remain covered by the separate CI jobs and can also be run locally by changing the filter.
-## Building
+## Official builds
-This repository can be built on Windows, Linux, and OSX.
+Microsoft's Azure Pipelines retain the 1ESPT/MicroBuild toolset, signing, SBOM generation, artifact collection, and release/insertion pipelines. `EnableMicroBuild` defaults to true when `TF_BUILD=true`, and those builds restore from `azure-pipelines/nuget.config`, preserving the `msft_consumption` feed. Local and GitHub Actions builds do not load the MicroBuild packages or SBOM configuration.
-Building, testing, and packing this repository can be done by using the standard dotnet CLI commands (e.g. `dotnet build`, `dotnet test`, `dotnet pack`, etc.).
+`init.ps1` remains an optional environment installer and the official pipelines' bootstrap. Use [PowerShell][pwsh] to run it. For a local build that intentionally uses MicroBuild, run `init.ps1 -Signing` or pass `-p:EnableMicroBuild=true` when restoring and building; authenticated feed access and the signing plugins may be required. CLI tools for documentation, coverage, release versioning, and source archival can be restored separately with `dotnet tool restore`. These tools are not needed for an ordinary solution build.
## Parsing the metadata
@@ -48,7 +40,7 @@ When we identify a gem that we should support but do not yet support, file [an i
To consume a newer [win32metadata](https://github.com/microsoft/win32metadata) release, update the `MetadataVersion` (and, when a new WDK metadata package ships, `WDKMetadataVersion`) property in `Directory.Packages.props`.
-CsWin32 restores these packages from the `msft_consumption` feed (`azure-public/vside`), which pulls them from nuget.org via an upstream source. A new package version is **not** available on the feed until it has been *pulled through* at least once, and only a feed **Collaborator/Contributor** can trigger that. Regular contributors typically only have **Reader** access, so a plain `dotnet restore` of the new version fails with `NU1102` until the package is on the feed.
+Local and GitHub Actions builds restore these packages directly from nuget.org. Official builds use the `msft_consumption` feed (`azure-public/vside`), which pulls them from nuget.org via an upstream source. A new package version is **not** available on that feed until it has been *pulled through* at least once, and only a feed **Collaborator/Contributor** can trigger that.
Azure Artifacts can take [3-6 hours to discover a newly published nuget.org package](https://learn.microsoft.com/azure/devops/artifacts/concepts/upstream-sources#upstream-sources-health-status).
If the pull-through pipeline also fails with `NU1102` despite the package being available on nuget.org, wait for upstream discovery and queue it again before rerunning the PR checks.
@@ -57,7 +49,7 @@ To pull the new version through:
1. Push your branch (with the bumped `MetadataVersion`) to GitHub.
2. Queue the **CsWin32 unofficial** Azure Pipeline (`devdiv/DevDiv`, definition `25100`, YAML `azure-pipelines/unofficial.yml`) against your branch. Its build agent runs as a feed Collaborator, so its restore pulls the new package onto the feed automatically.
-3. Wait until the pipeline reaches its `dotnet build` step, then confirm the version is on the feed (it is then restorable by everyone, including the GitHub Actions PR build):
+3. Wait until the pipeline reaches its `dotnet build` step, then confirm the version is on the feed (it is then available to official builds):
```pwsh
$idx = Invoke-RestMethod "https://pkgs.dev.azure.com/azure-public/vside/_packaging/msft_consumption/nuget/v3/flat2/microsoft.windows.sdk.win32metadata/index.json"
@@ -75,17 +67,6 @@ Use `nbgv tag` to create a tag for a particular commit that you mean to release.
Push the tag.
-### GitHub Actions
-
-When your repo is hosted by GitHub and you are using GitHub Actions, you should create a GitHub Release using the standard GitHub UI.
-Having previously used `nbgv tag` and pushing the tag will help you identify the precise commit and name to use for this release.
-
-After publishing the release, the `.github/workflows/release.yml` workflow will be automatically triggered, which will:
-
-1. Find the most recent `.github/workflows/build.yml` GitHub workflow run of the tagged release.
-1. Upload the `deployables` artifact from that workflow run to your GitHub Release.
-1. If you have `NUGET_API_KEY` defined as a secret variable for your repo or org, any nuget packages in the `deployables` artifact will be pushed to nuget.org.
-
### Azure Pipelines
When your repo builds with Azure Pipelines, use the `azure-pipelines/release.yml` pipeline.
@@ -108,22 +89,8 @@ Configuration is in the `.github/renovate.json` file.
When changing the renovate.json file, follow [these validation steps](https://docs.renovatebot.com/config-validation/).
-Renovate PR validation retries package and tool restores up to 10 times, with 60 seconds between attempts, only when Azure Artifacts reports `No local versions of package` for an upstream package that has not been saved to the feed. Generic tool-download failures, authentication errors without that cache-miss message, and other restore errors fail immediately. When retries are enabled, tool restore uses detailed output so the underlying feed error is available for classification. This retry window does not replace the authenticated pull-through pipeline or the upstream discovery wait described above.
+The optional `init.ps1 -RestoreRetryCount 10` retries restores with 60 seconds between attempts only when Azure Artifacts reports `No local versions of package` for an upstream package that has not been saved to the feed. Generic download and authentication failures fail immediately. GitHub Actions use nuget.org directly and do not need this feed-specific retry mechanism.
Run `./test/Restore.Tests.ps1` with PowerShell to exercise the retry behavior without restoring packages or installing test dependencies. These regression checks also run in the Windows and Linux build jobs.
If Renovate is not creating pull requests when you expect it to, check that the [Renovate GitHub App](https://github.com/apps/renovate) is configured for your account or repo.
-
-## Merging latest from Library.Template
-
-### Maintaining your repo based on this template
-
-The best way to keep your repo in sync with Library.Template's evolving features and best practices is to periodically merge the template into your repo:
-
-```ps1
-git fetch
-git checkout origin/main
-./tools/MergeFrom-Template.ps1
-# resolve any conflicts, then commit the merge commit.
-git push origin -u HEAD
-```
diff --git a/Directory.Build.props b/Directory.Build.props
index fcb28cc2..612480ba 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -6,9 +6,6 @@
$(RepoRootPath)obj\$([MSBuild]::MakeRelative($(RepoRootPath), $(MSBuildProjectDirectory)))\
$(RepoRootPath)bin\$(MSBuildProjectName)\
$(RepoRootPath)bin\Packages\$(Configuration)\NuGet\
- $(RepoRootPath)bin\Packages\$(Configuration)\Vsix\$(Platform)\
- $(RepoRootPath)bin\Packages\$(Configuration)\Vsix\
- $(VSIXOutputPath)
enable
enable
latest
@@ -27,7 +24,7 @@
true
-
+
$(MSBuildThisFileDirectory)
@@ -44,6 +41,11 @@
snupkg
net8.0
+
+
+ true
+ false
+ $(RepoRootPath)azure-pipelines\nuget.config
@@ -70,5 +72,5 @@
-
+
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 40f3db34..8a3bc06f 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -44,7 +44,7 @@
-
+
@@ -53,10 +53,10 @@
-
+
-
+
diff --git a/Directory.Solution.targets b/Directory.Solution.targets
new file mode 100644
index 00000000..9f5d7578
--- /dev/null
+++ b/Directory.Solution.targets
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/Microsoft.Windows.CsWin32.sln b/Microsoft.Windows.CsWin32.sln
deleted file mode 100644
index 926a92ee..00000000
--- a/Microsoft.Windows.CsWin32.sln
+++ /dev/null
@@ -1,215 +0,0 @@
-๏ปฟ
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 18
-VisualStudioVersion = 18.0.11018.11 main
-MinimumVisualStudioVersion = 15.0.26124.0
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1CE9670B-D5FF-46A7-9D00-24E70E6ED48B}"
- ProjectSection(SolutionItems) = preProject
- .editorconfig = .editorconfig
- Directory.Build.props = Directory.Build.props
- Directory.Build.targets = Directory.Build.targets
- Directory.Packages.Analyzers.props = Directory.Packages.Analyzers.props
- Directory.Packages.props = Directory.Packages.props
- global.json = global.json
- nuget.config = nuget.config
- README.md = README.md
- stylecop.json = stylecop.json
- version.json = version.json
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9E154A29-1796-4B85-BD81-B6A385D8FF71}"
- ProjectSection(SolutionItems) = preProject
- src\.editorconfig = src\.editorconfig
- src\Directory.Build.props = src\Directory.Build.props
- src\Directory.Build.targets = src\Directory.Build.targets
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}"
- ProjectSection(SolutionItems) = preProject
- test\.editorconfig = test\.editorconfig
- test\Directory.Build.props = test\Directory.Build.props
- test\Directory.Build.targets = test\Directory.Build.targets
- test\GenerationSandbox.props = test\GenerationSandbox.props
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Windows.CsWin32", "src\Microsoft.Windows.CsWin32\Microsoft.Windows.CsWin32.csproj", "{E3E96466-44B6-41AF-BBC8-9D30183ED8A9}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Windows.CsWin32.Roslyn4", "src\Microsoft.Windows.CsWin32.Roslyn4\Microsoft.Windows.CsWin32.Roslyn4.csproj", "{93A6CCA2-5A52-46B9-8A91-928AFA67429D}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Windows.CsWin32.Tests", "test\Microsoft.Windows.CsWin32.Tests\Microsoft.Windows.CsWin32.Tests.csproj", "{0129FE6E-3480-408A-BF40-9E6343CDB06C}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenerationSandbox.Tests", "test\GenerationSandbox.Tests\GenerationSandbox.Tests.csproj", "{7E8A5179-F94C-410F-8BBE-FDAAA95A19C3}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpellChecker", "test\SpellChecker\SpellChecker.csproj", "{744BE74F-8C4A-49E8-9683-52D987224285}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinRTInteropTest", "test\WinRTInteropTest\WinRTInteropTest.csproj", "{0E067B66-C2EC-4106-87D2-5310CFCDC5B8}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenerationSandbox.Unmarshalled.Tests", "test\GenerationSandbox.Unmarshalled.Tests\GenerationSandbox.Unmarshalled.Tests.csproj", "{3D303454-7DB0-4F9F-BD9E-07F09D3C70E3}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Windows.CsWin32.BuildTasks", "src\Microsoft.Windows.CsWin32.BuildTasks\Microsoft.Windows.CsWin32.BuildTasks.csproj", "{D3363193-DE88-5AFE-BA2D-CAF66280F243}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsWin32Generator", "src\CsWin32Generator\CsWin32Generator.csproj", "{DBA19B76-E786-297A-C44F-6121CA5FFCDC}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsWin32Generator.Tests", "test\CsWin32Generator.Tests\CsWin32Generator.Tests.csproj", "{168AF67E-678E-FDC9-7C20-7407D58A37FE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsWin32Generator.BuildTasks.Tests", "test\CsWin32Generator.BuildTasks.Tests\CsWin32Generator.BuildTasks.Tests.csproj", "{DC26E9DC-DFB1-19BD-6BAA-38B23E99C3C6}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenerationSandbox.BuildTask.Tests", "test\GenerationSandbox.BuildTask.Tests\GenerationSandbox.BuildTask.Tests.csproj", "{A0253377-BC40-63BD-F41A-AC7EBA7A3C54}"
- ProjectSection(ProjectDependencies) = postProject
- {D3363193-DE88-5AFE-BA2D-CAF66280F243} = {D3363193-DE88-5AFE-BA2D-CAF66280F243}
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC} = {DBA19B76-E786-297A-C44F-6121CA5FFCDC}
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenerationSandbox.AutoWinRTDisabled.Tests", "test\GenerationSandbox.AutoWinRTDisabled.Tests\GenerationSandbox.AutoWinRTDisabled.Tests.csproj", "{A3AACB6C-0398-4325-B1C7-D9CE72A909DA}"
- ProjectSection(ProjectDependencies) = postProject
- {D3363193-DE88-5AFE-BA2D-CAF66280F243} = {D3363193-DE88-5AFE-BA2D-CAF66280F243}
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC} = {DBA19B76-E786-297A-C44F-6121CA5FFCDC}
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenerationSandbox.BuiltInCom.Tests", "test\GenerationSandbox.BuiltInCom.Tests\GenerationSandbox.BuiltInCom.Tests.csproj", "{1D316174-9568-4128-AE4C-B1A01EBA65FE}"
- ProjectSection(ProjectDependencies) = postProject
- {D3363193-DE88-5AFE-BA2D-CAF66280F243} = {D3363193-DE88-5AFE-BA2D-CAF66280F243}
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC} = {DBA19B76-E786-297A-C44F-6121CA5FFCDC}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|NonWindows = Debug|NonWindows
- Release|Any CPU = Release|Any CPU
- Release|NonWindows = Release|NonWindows
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E3E96466-44B6-41AF-BBC8-9D30183ED8A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E3E96466-44B6-41AF-BBC8-9D30183ED8A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E3E96466-44B6-41AF-BBC8-9D30183ED8A9}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {E3E96466-44B6-41AF-BBC8-9D30183ED8A9}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {E3E96466-44B6-41AF-BBC8-9D30183ED8A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E3E96466-44B6-41AF-BBC8-9D30183ED8A9}.Release|Any CPU.Build.0 = Release|Any CPU
- {E3E96466-44B6-41AF-BBC8-9D30183ED8A9}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {E3E96466-44B6-41AF-BBC8-9D30183ED8A9}.Release|NonWindows.Build.0 = Release|Any CPU
- {93A6CCA2-5A52-46B9-8A91-928AFA67429D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {93A6CCA2-5A52-46B9-8A91-928AFA67429D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {93A6CCA2-5A52-46B9-8A91-928AFA67429D}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {93A6CCA2-5A52-46B9-8A91-928AFA67429D}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {93A6CCA2-5A52-46B9-8A91-928AFA67429D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {93A6CCA2-5A52-46B9-8A91-928AFA67429D}.Release|Any CPU.Build.0 = Release|Any CPU
- {93A6CCA2-5A52-46B9-8A91-928AFA67429D}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {93A6CCA2-5A52-46B9-8A91-928AFA67429D}.Release|NonWindows.Build.0 = Release|Any CPU
- {0129FE6E-3480-408A-BF40-9E6343CDB06C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0129FE6E-3480-408A-BF40-9E6343CDB06C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0129FE6E-3480-408A-BF40-9E6343CDB06C}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {0129FE6E-3480-408A-BF40-9E6343CDB06C}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {0129FE6E-3480-408A-BF40-9E6343CDB06C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0129FE6E-3480-408A-BF40-9E6343CDB06C}.Release|Any CPU.Build.0 = Release|Any CPU
- {0129FE6E-3480-408A-BF40-9E6343CDB06C}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {0129FE6E-3480-408A-BF40-9E6343CDB06C}.Release|NonWindows.Build.0 = Release|Any CPU
- {7E8A5179-F94C-410F-8BBE-FDAAA95A19C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7E8A5179-F94C-410F-8BBE-FDAAA95A19C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7E8A5179-F94C-410F-8BBE-FDAAA95A19C3}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {7E8A5179-F94C-410F-8BBE-FDAAA95A19C3}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {7E8A5179-F94C-410F-8BBE-FDAAA95A19C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7E8A5179-F94C-410F-8BBE-FDAAA95A19C3}.Release|Any CPU.Build.0 = Release|Any CPU
- {7E8A5179-F94C-410F-8BBE-FDAAA95A19C3}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {7E8A5179-F94C-410F-8BBE-FDAAA95A19C3}.Release|NonWindows.Build.0 = Release|Any CPU
- {744BE74F-8C4A-49E8-9683-52D987224285}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {744BE74F-8C4A-49E8-9683-52D987224285}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {744BE74F-8C4A-49E8-9683-52D987224285}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {744BE74F-8C4A-49E8-9683-52D987224285}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {744BE74F-8C4A-49E8-9683-52D987224285}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {744BE74F-8C4A-49E8-9683-52D987224285}.Release|Any CPU.Build.0 = Release|Any CPU
- {744BE74F-8C4A-49E8-9683-52D987224285}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {744BE74F-8C4A-49E8-9683-52D987224285}.Release|NonWindows.Build.0 = Release|Any CPU
- {0E067B66-C2EC-4106-87D2-5310CFCDC5B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0E067B66-C2EC-4106-87D2-5310CFCDC5B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0E067B66-C2EC-4106-87D2-5310CFCDC5B8}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {0E067B66-C2EC-4106-87D2-5310CFCDC5B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0E067B66-C2EC-4106-87D2-5310CFCDC5B8}.Release|Any CPU.Build.0 = Release|Any CPU
- {0E067B66-C2EC-4106-87D2-5310CFCDC5B8}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {3D303454-7DB0-4F9F-BD9E-07F09D3C70E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3D303454-7DB0-4F9F-BD9E-07F09D3C70E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3D303454-7DB0-4F9F-BD9E-07F09D3C70E3}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {3D303454-7DB0-4F9F-BD9E-07F09D3C70E3}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {3D303454-7DB0-4F9F-BD9E-07F09D3C70E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3D303454-7DB0-4F9F-BD9E-07F09D3C70E3}.Release|Any CPU.Build.0 = Release|Any CPU
- {3D303454-7DB0-4F9F-BD9E-07F09D3C70E3}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {3D303454-7DB0-4F9F-BD9E-07F09D3C70E3}.Release|NonWindows.Build.0 = Release|Any CPU
- {D3363193-DE88-5AFE-BA2D-CAF66280F243}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D3363193-DE88-5AFE-BA2D-CAF66280F243}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D3363193-DE88-5AFE-BA2D-CAF66280F243}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {D3363193-DE88-5AFE-BA2D-CAF66280F243}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {D3363193-DE88-5AFE-BA2D-CAF66280F243}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D3363193-DE88-5AFE-BA2D-CAF66280F243}.Release|Any CPU.Build.0 = Release|Any CPU
- {D3363193-DE88-5AFE-BA2D-CAF66280F243}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {D3363193-DE88-5AFE-BA2D-CAF66280F243}.Release|NonWindows.Build.0 = Release|Any CPU
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC}.Release|Any CPU.Build.0 = Release|Any CPU
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC}.Release|NonWindows.Build.0 = Release|Any CPU
- {168AF67E-678E-FDC9-7C20-7407D58A37FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {168AF67E-678E-FDC9-7C20-7407D58A37FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {168AF67E-678E-FDC9-7C20-7407D58A37FE}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {168AF67E-678E-FDC9-7C20-7407D58A37FE}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {168AF67E-678E-FDC9-7C20-7407D58A37FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {168AF67E-678E-FDC9-7C20-7407D58A37FE}.Release|Any CPU.Build.0 = Release|Any CPU
- {168AF67E-678E-FDC9-7C20-7407D58A37FE}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {168AF67E-678E-FDC9-7C20-7407D58A37FE}.Release|NonWindows.Build.0 = Release|Any CPU
- {DC26E9DC-DFB1-19BD-6BAA-38B23E99C3C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DC26E9DC-DFB1-19BD-6BAA-38B23E99C3C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DC26E9DC-DFB1-19BD-6BAA-38B23E99C3C6}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {DC26E9DC-DFB1-19BD-6BAA-38B23E99C3C6}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {DC26E9DC-DFB1-19BD-6BAA-38B23E99C3C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DC26E9DC-DFB1-19BD-6BAA-38B23E99C3C6}.Release|Any CPU.Build.0 = Release|Any CPU
- {DC26E9DC-DFB1-19BD-6BAA-38B23E99C3C6}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {DC26E9DC-DFB1-19BD-6BAA-38B23E99C3C6}.Release|NonWindows.Build.0 = Release|Any CPU
- {A0253377-BC40-63BD-F41A-AC7EBA7A3C54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A0253377-BC40-63BD-F41A-AC7EBA7A3C54}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A0253377-BC40-63BD-F41A-AC7EBA7A3C54}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {A0253377-BC40-63BD-F41A-AC7EBA7A3C54}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {A0253377-BC40-63BD-F41A-AC7EBA7A3C54}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A0253377-BC40-63BD-F41A-AC7EBA7A3C54}.Release|Any CPU.Build.0 = Release|Any CPU
- {A0253377-BC40-63BD-F41A-AC7EBA7A3C54}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {A0253377-BC40-63BD-F41A-AC7EBA7A3C54}.Release|NonWindows.Build.0 = Release|Any CPU
- {A3AACB6C-0398-4325-B1C7-D9CE72A909DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A3AACB6C-0398-4325-B1C7-D9CE72A909DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A3AACB6C-0398-4325-B1C7-D9CE72A909DA}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {A3AACB6C-0398-4325-B1C7-D9CE72A909DA}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {A3AACB6C-0398-4325-B1C7-D9CE72A909DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A3AACB6C-0398-4325-B1C7-D9CE72A909DA}.Release|Any CPU.Build.0 = Release|Any CPU
- {A3AACB6C-0398-4325-B1C7-D9CE72A909DA}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {A3AACB6C-0398-4325-B1C7-D9CE72A909DA}.Release|NonWindows.Build.0 = Release|Any CPU
- {1D316174-9568-4128-AE4C-B1A01EBA65FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1D316174-9568-4128-AE4C-B1A01EBA65FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1D316174-9568-4128-AE4C-B1A01EBA65FE}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
- {1D316174-9568-4128-AE4C-B1A01EBA65FE}.Debug|NonWindows.Build.0 = Debug|Any CPU
- {1D316174-9568-4128-AE4C-B1A01EBA65FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1D316174-9568-4128-AE4C-B1A01EBA65FE}.Release|Any CPU.Build.0 = Release|Any CPU
- {1D316174-9568-4128-AE4C-B1A01EBA65FE}.Release|NonWindows.ActiveCfg = Release|Any CPU
- {1D316174-9568-4128-AE4C-B1A01EBA65FE}.Release|NonWindows.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {E3E96466-44B6-41AF-BBC8-9D30183ED8A9} = {9E154A29-1796-4B85-BD81-B6A385D8FF71}
- {0129FE6E-3480-408A-BF40-9E6343CDB06C} = {36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}
- {7E8A5179-F94C-410F-8BBE-FDAAA95A19C3} = {36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}
- {744BE74F-8C4A-49E8-9683-52D987224285} = {36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}
- {0E067B66-C2EC-4106-87D2-5310CFCDC5B8} = {36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}
- {3D303454-7DB0-4F9F-BD9E-07F09D3C70E3} = {36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}
- {D3363193-DE88-5AFE-BA2D-CAF66280F243} = {9E154A29-1796-4B85-BD81-B6A385D8FF71}
- {DBA19B76-E786-297A-C44F-6121CA5FFCDC} = {9E154A29-1796-4B85-BD81-B6A385D8FF71}
- {168AF67E-678E-FDC9-7C20-7407D58A37FE} = {36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}
- {DC26E9DC-DFB1-19BD-6BAA-38B23E99C3C6} = {36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}
- {A0253377-BC40-63BD-F41A-AC7EBA7A3C54} = {36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}
- {A3AACB6C-0398-4325-B1C7-D9CE72A909DA} = {36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}
- {1D316174-9568-4128-AE4C-B1A01EBA65FE} = {36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {E3944F6A-384B-4B0F-B93F-3BD513DC57BD}
- EndGlobalSection
-EndGlobal
diff --git a/Microsoft.Windows.CsWin32.slnx b/Microsoft.Windows.CsWin32.slnx
new file mode 100644
index 00000000..b482730a
--- /dev/null
+++ b/Microsoft.Windows.CsWin32.slnx
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index 95557af3..1c6c1c32 100644
--- a/README.md
+++ b/README.md
@@ -23,3 +23,7 @@ C#/Win32 provides **P/Invoke** and **COM Interop** projection support for C#. It
## Demo

+
+## Building from source
+
+Install the .NET SDK specified in `global.json`, then open `Microsoft.Windows.CsWin32.slnx` in a compatible Visual Studio or run `dotnet build` from the repository root. No initialization script is required. See [CONTRIBUTING.md](CONTRIBUTING.md) for testing, packaging, and official build instructions.
diff --git a/azure-pipelines/NuGetSbom.props b/azure-pipelines/NuGetSbom.props
index dbfee864..0807b680 100644
--- a/azure-pipelines/NuGetSbom.props
+++ b/azure-pipelines/NuGetSbom.props
@@ -1,5 +1,8 @@
+ $(RepoRootPath)bin\Packages\$(Configuration)\Vsix\$(Platform)\
+ $(RepoRootPath)bin\Packages\$(Configuration)\Vsix\
+ $(VSIXOutputPath)
true
2
diff --git a/azure-pipelines/archive-sourcecode.yml b/azure-pipelines/archive-sourcecode.yml
index ee349e5b..44d341c5 100644
--- a/azure-pipelines/archive-sourcecode.yml
+++ b/azure-pipelines/archive-sourcecode.yml
@@ -60,7 +60,7 @@ extends:
displayName: ๐ Authenticate NuGet feeds
inputs:
forceReinstallCredentialProvider: true
- - script: dotnet tool restore
+ - script: dotnet tool restore --configfile azure-pipelines/nuget.config
displayName: โ๏ธ Restore CLI tools
- powershell: tools/variables/_define.ps1
failOnStderr: true
diff --git a/azure-pipelines/libtemplate-update.yml b/azure-pipelines/libtemplate-update.yml
deleted file mode 100644
index a0421bd6..00000000
--- a/azure-pipelines/libtemplate-update.yml
+++ /dev/null
@@ -1,172 +0,0 @@
-# This pipeline schedules regular merges of Library.Template into a repo that is based on it.
-# Only Azure Repos are supported. GitHub support comes via a GitHub Actions workflow.
-
-trigger: none
-pr: none
-schedules:
-- cron: "0 3 * * Mon" # Sun @ 8 or 9 PM Mountain Time (depending on DST)
- displayName: Weekly trigger
- branches:
- include:
- - main
- always: true
-
-resources:
- repositories:
- - repository: MicroBuildTemplate
- type: git
- name: 1ESPipelineTemplates/MicroBuildTemplate
- ref: refs/tags/release
-
-parameters:
-- name: AutoComplete
- displayName: Auto-complete pull request
- type: boolean
- default: false
-
-variables:
-- template: GlobalVariables.yml
-
-extends:
- template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
- parameters:
- settings:
- networkIsolationPolicy: Permissive,CFSClean
- sdl:
- sourceAnalysisPool:
- name: AzurePipelines-EO
- demands:
- - ImageOverride -equals 1ESPT-Windows2022
- credscan:
- enabled: false
-
- stages:
- - stage: Merge
- jobs:
- - job: merge
- pool:
- name: AzurePipelines-EO
- demands:
- - ImageOverride -equals 1ESPT-Ubuntu22.04
- os: Linux
- steps:
- - checkout: self
- fetchDepth: 0
- clean: true
- - pwsh: |
- $LibTemplateBranch = & ./tools/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated
- if ($LASTEXITCODE -ne 0) {
- exit $LASTEXITCODE
- }
-
- git fetch https://github.com/aarnott/Library.Template $LibTemplateBranch
- if ($LASTEXITCODE -ne 0) {
- exit $LASTEXITCODE
- }
- $LibTemplateCommit = git rev-parse FETCH_HEAD
-
- if ((git rev-list FETCH_HEAD ^HEAD --count) -eq 0) {
- Write-Host "There are no Library.Template updates to merge."
- exit 0
- }
-
- $UpdateBranchName = 'auto/libtemplateUpdate'
- git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push origin -f FETCH_HEAD:refs/heads/$UpdateBranchName
-
- Write-Host "Creating pull request"
- $contentType = 'application/json';
- $headers = @{ Authorization = 'Bearer $(System.AccessToken)' };
- $rawRequest = @{
- sourceRefName = "refs/heads/$UpdateBranchName";
- targetRefName = "refs/heads/main";
- title = 'Merge latest Library.Template';
- description = "This merges the latest features and fixes from [Library.Template's $LibTemplateBranch branch](https://github.com/AArnott/Library.Template/tree/$LibTemplateBranch).";
- }
- $request = ConvertTo-Json $rawRequest
-
- $prApiBaseUri = '$(System.TeamFoundationCollectionUri)/$(System.TeamProject)/_apis/git/repositories/$(Build.Repository.ID)/pullrequests'
- $prCreationUri = $prApiBaseUri + "?api-version=6.0"
- Write-Host "POST $prCreationUri"
- Write-Host $request
-
- $prCreationResult = Invoke-RestMethod -uri $prCreationUri -method POST -Headers $headers -ContentType $contentType -Body $request
- $prUrl = "$($prCreationResult.repository.webUrl)/pullrequest/$($prCreationResult.pullRequestId)"
- Write-Host "Pull request: $prUrl"
- $prApiBaseUri += "/$($prCreationResult.pullRequestId)"
-
- $SummaryPath = Join-Path '$(Agent.TempDirectory)' 'summary.md'
- Set-Content -Path $SummaryPath -Value "[Insertion pull request]($prUrl)"
- Write-Host "##vso[task.uploadsummary]$SummaryPath"
-
- # Tag the PR
- $tagUri = "$prApiBaseUri/labels?api-version=7.0"
- $rawRequest = @{
- name = 'auto-template-merge';
- }
- $request = ConvertTo-Json $rawRequest
- Invoke-RestMethod -uri $tagUri -method POST -Headers $headers -ContentType $contentType -Body $request | Out-Null
-
- # Add properties to the PR that we can programatically parse later.
- Function Set-PRProperties($properties) {
- $rawRequest = $properties.GetEnumerator() |% {
- @{
- op = 'add'
- path = "/$($_.key)"
- from = $null
- value = $_.value
- }
- }
- $request = ConvertTo-Json $rawRequest
- $setPrPropertyUri = "$prApiBaseUri/properties?api-version=7.0"
- Write-Debug "$request"
- $setPrPropertyResult = Invoke-RestMethod -uri $setPrPropertyUri -method PATCH -Headers $headers -ContentType 'application/json-patch+json' -Body $request -StatusCodeVariable setPrPropertyStatus -SkipHttpErrorCheck
- if ($setPrPropertyStatus -ne 200) {
- Write-Host "##vso[task.logissue type=warning]Failed to set pull request properties. Result: $setPrPropertyStatus. $($setPrPropertyResult.message)"
- }
- }
- Write-Host "Setting pull request properties"
- Set-PRProperties @{
- 'AutomatedMerge.SourceBranch' = $LibTemplateBranch
- 'AutomatedMerge.SourceCommit' = $LibTemplateCommit
- }
-
- # Add an *active* PR comment to warn users to *merge* the pull request instead of squash it.
- $request = ConvertTo-Json @{
- comments = @(
- @{
- parentCommentId = 0
- content = "Do **not** squash this pull request when completing it. You must *merge* it."
- commentType = 'system'
- }
- )
- status = 'active'
- }
- $result = Invoke-RestMethod -uri "$prApiBaseUri/threads?api-version=7.1" -method POST -Headers $headers -ContentType $contentType -Body $request -StatusCodeVariable addCommentStatus -SkipHttpErrorCheck
- if ($addCommentStatus -ne 200) {
- Write-Host "##vso[task.logissue type=warning]Failed to post comment on pull request. Result: $addCommentStatus. $($result.message)"
- }
-
- # Set auto-complete on the PR
- if ('${{ parameters.AutoComplete }}' -eq 'True') {
- Write-Host "Setting auto-complete"
- $mergeMessage = "Merged PR $($prCreationResult.pullRequestId): " + $commitMessage
- $rawRequest = @{
- autoCompleteSetBy = @{
- id = $prCreationResult.createdBy.id
- };
- completionOptions = @{
- deleteSourceBranch = $true;
- mergeCommitMessage = $mergeMessage;
- mergeStrategy = 'noFastForward';
- };
- }
- $request = ConvertTo-Json $rawRequest
- Write-Host $request
- $uri = "$($prApiBaseUri)?api-version=6.0"
- $result = Invoke-RestMethod -uri $uri -method PATCH -Headers $headers -ContentType $contentType -Body $request -StatusCodeVariable autoCompleteStatus -SkipHttpErrorCheck
- if ($autoCompleteStatus -ne 200) {
- Write-Host "##vso[task.logissue type=warning]Failed to set auto-complete on pull request. Result: $autoCompleteStatus. $($result.message)"
- }
- }
-
- displayName: Create pull request
diff --git a/azure-pipelines/nuget.config b/azure-pipelines/nuget.config
new file mode 100644
index 00000000..930616fc
--- /dev/null
+++ b/azure-pipelines/nuget.config
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/init.ps1 b/init.ps1
index e12fcc9a..4f8ba41d 100755
--- a/init.ps1
+++ b/init.ps1
@@ -123,6 +123,14 @@ function Invoke-RestoreWithRetry {
$EnvVars = @{}
$PrependPath = @()
+$useMicroBuild = $env:TF_BUILD -eq 'true' -or $env:EnableMicroBuild -eq 'true' -or $env:SignType -or $Signing -or $Localization -or $Setup -or $OptProf -or $SBOM
+if ($useMicroBuild) {
+ $EnvVars['EnableMicroBuild'] = 'true'
+}
+$nugetConfigFile = Join-Path $PSScriptRoot 'nuget.config'
+if ($useMicroBuild) {
+ $nugetConfigFile = Join-Path $PSScriptRoot 'azure-pipelines/nuget.config'
+}
if (!$NoPrerequisites) {
if (!$NoNuGetCredProvider) {
@@ -137,7 +145,7 @@ if (!$NoPrerequisites) {
# The procdump tool and env var is required for dotnet test to collect hang/crash dumps of tests.
# But it only works on Windows.
if ($env:OS -eq 'Windows_NT') {
- $EnvVars['PROCDUMP_PATH'] = & "$PSScriptRoot\tools\Get-ProcDump.ps1"
+ $EnvVars['PROCDUMP_PATH'] = & "$PSScriptRoot\tools\Get-ProcDump.ps1" -ConfigFile $nugetConfigFile
}
}
@@ -150,6 +158,9 @@ try {
$HeaderColor = 'Green'
$RestoreArguments = @()
+ if ($useMicroBuild) {
+ $RestoreArguments += '--configfile', $nugetConfigFile
+ }
if ($Interactive) {
$RestoreArguments += '--interactive'
}
@@ -158,7 +169,7 @@ try {
Write-Host "Restoring NuGet packages" -ForegroundColor $HeaderColor
Invoke-RestoreWithRetry -Restore {
$PSNativeCommandUseErrorActionPreference = $false
- dotnet restore @RestoreArguments
+ dotnet restore @RestoreArguments "-p:EnableMicroBuild=$useMicroBuild"
} -FailureMessage "Failure while restoring packages."
}
@@ -178,37 +189,41 @@ try {
$InstallNuGetPkgScriptPath = "$PSScriptRoot\tools\Install-NuGetPackage.ps1"
$nugetVerbosity = 'quiet'
if ($Verbose) { $nugetVerbosity = 'normal' }
- $MicroBuildPackageSource = 'https://pkgs.dev.azure.com/devdiv/_packaging/MicroBuildToolset%40Local/nuget/v3/index.json'
+ $MicroBuildInstallArguments = @{
+ Source = 'https://pkgs.dev.azure.com/devdiv/_packaging/MicroBuildToolset%40Local/nuget/v3/index.json'
+ ConfigFile = $nugetConfigFile
+ Verbosity = $nugetVerbosity
+ }
if ($Signing) {
Write-Host "Installing MicroBuild signing plugin" -ForegroundColor $HeaderColor
- & $InstallNuGetPkgScriptPath MicroBuild.Plugins.Signing -source $MicroBuildPackageSource -Verbosity $nugetVerbosity
+ & $InstallNuGetPkgScriptPath MicroBuild.Plugins.Signing @MicroBuildInstallArguments
$EnvVars['SignType'] = "Test"
}
if ($Setup) {
Write-Host "Installing MicroBuild SwixBuild plugin..." -ForegroundColor $HeaderColor
- & $InstallNuGetPkgScriptPath Microsoft.VisualStudioEng.MicroBuild.Plugins.SwixBuild -source $MicroBuildPackageSource -Verbosity $nugetVerbosity
+ & $InstallNuGetPkgScriptPath Microsoft.VisualStudioEng.MicroBuild.Plugins.SwixBuild @MicroBuildInstallArguments
}
if ($OptProf) {
Write-Host "Installing MicroBuild OptProf plugin" -ForegroundColor $HeaderColor
- & $InstallNuGetPkgScriptPath MicroBuild.Plugins.OptProf -source $MicroBuildPackageSource -Verbosity $nugetVerbosity
+ & $InstallNuGetPkgScriptPath MicroBuild.Plugins.OptProf @MicroBuildInstallArguments
$EnvVars['OptProfEnabled'] = '1'
}
if ($Localization) {
Write-Host "Installing MicroBuild localization plugin" -ForegroundColor $HeaderColor
- & $InstallNuGetPkgScriptPath MicroBuild.Plugins.Localization -source $MicroBuildPackageSource -Verbosity $nugetVerbosity
+ & $InstallNuGetPkgScriptPath MicroBuild.Plugins.Localization @MicroBuildInstallArguments
$EnvVars['LocType'] = "Pseudo"
$EnvVars['LocLanguages'] = "JPN"
}
if ($SBOM) {
Write-Host "Installing MicroBuild SBOM plugin" -ForegroundColor $HeaderColor
- & $InstallNuGetPkgScriptPath MicroBuild.Plugins.Sbom -source $MicroBuildPackageSource -Verbosity $nugetVerbosity
+ & $InstallNuGetPkgScriptPath MicroBuild.Plugins.Sbom @MicroBuildInstallArguments
# The feed with the latest versions of the tool is at 'https://1essharedassets.pkgs.visualstudio.com/1esPkgs/_packaging/SBOMTool/nuget/v3/index.json',
# but we'll use the feed that the SBOM task itself uses to install the tool for consistency.
- $PkgMicrosoft_ManifestTool_CrossPlatform = & $InstallNuGetPkgScriptPath Microsoft.ManifestTool.CrossPlatform -source $MicroBuildPackageSource -Verbosity $nugetVerbosity
+ $PkgMicrosoft_ManifestTool_CrossPlatform = & $InstallNuGetPkgScriptPath Microsoft.ManifestTool.CrossPlatform @MicroBuildInstallArguments
$EnvVars['GenerateSBOM'] = "true"
$EnvVars['PkgMicrosoft_ManifestTool_CrossPlatform'] = $PkgMicrosoft_ManifestTool_CrossPlatform
}
diff --git a/nuget.config b/nuget.config
index 0a73357e..7bbe00f6 100644
--- a/nuget.config
+++ b/nuget.config
@@ -1,12 +1,27 @@
-๏ปฟ
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Microsoft.Windows.CsWin32/Microsoft.Windows.CsWin32.targets b/src/Microsoft.Windows.CsWin32/Microsoft.Windows.CsWin32.targets
index cf04e55e..dccb8142 100644
--- a/src/Microsoft.Windows.CsWin32/Microsoft.Windows.CsWin32.targets
+++ b/src/Microsoft.Windows.CsWin32/Microsoft.Windows.CsWin32.targets
@@ -1,6 +1,8 @@
$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs
+
+ false
diff --git a/test/Directory.Build.props b/test/Directory.Build.props
index e8b338a7..b9619174 100644
--- a/test/Directory.Build.props
+++ b/test/Directory.Build.props
@@ -9,6 +9,6 @@
-
+
diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets
index 9f32cd06..d1be2b5e 100644
--- a/test/Directory.Build.targets
+++ b/test/Directory.Build.targets
@@ -1,5 +1,11 @@
+
+
+
+
+
+
diff --git a/test/Microsoft.Windows.CsWin32.Tests/MyReferenceAssemblies.cs b/test/Microsoft.Windows.CsWin32.Tests/MyReferenceAssemblies.cs
index d21790af..b037ae0d 100644
--- a/test/Microsoft.Windows.CsWin32.Tests/MyReferenceAssemblies.cs
+++ b/test/Microsoft.Windows.CsWin32.Tests/MyReferenceAssemblies.cs
@@ -1,4 +1,4 @@
-๏ปฟ// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma warning disable SA1202 // Elements should be ordered by access - because field initializer depend on each other
@@ -27,13 +27,16 @@ internal static class MyReferenceAssemblies
private static string FindNuGetConfigPath()
{
+ bool useMicroBuild = string.Equals(Environment.GetEnvironmentVariable("TF_BUILD"), "true", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(Environment.GetEnvironmentVariable("EnableMicroBuild"), "true", StringComparison.OrdinalIgnoreCase)
+ || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SignType"));
string? path = AppContext.BaseDirectory;
while (path is not null)
{
string candidate = Path.Combine(path, "nuget.config");
if (File.Exists(candidate))
{
- return candidate;
+ return useMicroBuild ? Path.Combine(path, "azure-pipelines", "nuget.config") : candidate;
}
path = Path.GetDirectoryName(path);
diff --git a/test/Restore.Tests.ps1 b/test/Restore.Tests.ps1
index fc410949..da1e7f71 100644
--- a/test/Restore.Tests.ps1
+++ b/test/Restore.Tests.ps1
@@ -8,7 +8,7 @@
Param()
$ErrorActionPreference = 'Stop'
-$initPath = Join-Path $PSScriptRoot '..\init.ps1'
+$initPath = (Resolve-Path (Join-Path $PSScriptRoot '..\init.ps1')).Path
$tokens = $null
$parseErrors = $null
$initAst = [System.Management.Automation.Language.Parser]::ParseFile($initPath, [ref]$tokens, [ref]$parseErrors)
@@ -146,5 +146,57 @@ Test-ToolRestoreArguments
Test-ToolRestoreArguments -RestoreRetryCount 1
Test-ToolRestoreArguments -RestoreRetryCount 3
Test-ToolRestoreArguments -RestoreRetryCount 3 -Interactive
+
+# Exercise both restore commands with the real bootstrap while avoiding installs and network access.
+function Test-RestoreConfiguration {
+ Param([switch]$AzurePipelines, [switch]$LocalMicroBuild)
+
+ $state = [pscustomobject]@{ Calls = [Collections.Generic.List[object]]::new() }
+ $originalDotnet = Get-Item Function:global:dotnet -ErrorAction SilentlyContinue
+ $originalEnvironment = @{}
+ foreach ($name in @('TF_BUILD', 'EnableMicroBuild', 'SignType', 'GITHUB_ACTIONS', 'CmdEnvScriptPath')) {
+ $originalEnvironment[$name] = [Environment]::GetEnvironmentVariable($name)
+ [Environment]::SetEnvironmentVariable($name, $null)
+ }
+
+ try {
+ if ($AzurePipelines) { $env:TF_BUILD = 'true' }
+ if ($LocalMicroBuild) { $env:EnableMicroBuild = 'true' }
+ Set-Item Function:global:dotnet -Value {
+ $state.Calls.Add(@($args))
+ $global:LASTEXITCODE = 0
+ }.GetNewClosure()
+ & $initPath -NoPrerequisites
+
+ $expectedRestore = @('restore')
+ $expectedTools = @('tool', 'restore')
+ if ($AzurePipelines -or $LocalMicroBuild) {
+ $configArguments = @('--configfile', (Join-Path (Split-Path $initPath) 'azure-pipelines/nuget.config'))
+ $expectedRestore += $configArguments
+ $expectedTools += $configArguments
+ }
+ $expectedRestore += "-p:EnableMicroBuild=$($AzurePipelines -or $LocalMicroBuild)"
+
+ if ($state.Calls.Count -ne 2 -or ($state.Calls[0] -join '|') -ne ($expectedRestore -join '|') -or ($state.Calls[1] -join '|') -ne ($expectedTools -join '|')) {
+ throw "Unexpected restore configuration (AzurePipelines=$AzurePipelines, LocalMicroBuild=$LocalMicroBuild)."
+ }
+ }
+ finally {
+ if ($null -eq $originalDotnet) {
+ Remove-Item Function:global:dotnet
+ } else {
+ Set-Item Function:global:dotnet -Value $originalDotnet.ScriptBlock
+ }
+ foreach ($name in $originalEnvironment.Keys) {
+ [Environment]::SetEnvironmentVariable($name, $originalEnvironment[$name])
+ }
+ }
+
+ Write-Host "PASS: Restore configuration (AzurePipelines=$AzurePipelines, LocalMicroBuild=$LocalMicroBuild)"
+}
+
+Test-RestoreConfiguration
+Test-RestoreConfiguration -AzurePipelines
+Test-RestoreConfiguration -LocalMicroBuild
Write-Host 'All restore retry regression checks passed.'
exit 0
diff --git a/tools/Check-DotNetRuntime.ps1 b/tools/Check-DotNetRuntime.ps1
deleted file mode 100644
index 9d012109..00000000
--- a/tools/Check-DotNetRuntime.ps1
+++ /dev/null
@@ -1,41 +0,0 @@
-<#
-.SYNOPSIS
- Checks whether a given .NET Core runtime is installed.
-#>
-[CmdletBinding()]
-Param (
- [Parameter()]
- [ValidateSet('Microsoft.AspNetCore.App','Microsoft.NETCore.App')]
- [string]$Runtime='Microsoft.NETCore.App',
- [Parameter(Mandatory=$true)]
- [Version]$Version
-)
-
-$dotnet = Get-Command dotnet -ErrorAction SilentlyContinue
-if (!$dotnet) {
- # Nothing is installed.
- Write-Output $false
- exit 1
-}
-
-Function IsVersionMatch {
- Param(
- [Parameter()]
- $actualVersion
- )
- return $actualVersion -and
- $Version.Major -eq $actualVersion.Major -and
- $Version.Minor -eq $actualVersion.Minor -and
- (($Version.Build -eq -1) -or ($Version.Build -eq $actualVersion.Build)) -and
- (($Version.Revision -eq -1) -or ($Version.Revision -eq $actualVersion.Revision))
-}
-
-$installedRuntimes = dotnet --list-runtimes |? { $_.Split()[0] -ieq $Runtime } |% { $v = $null; [Version]::tryparse($_.Split()[1], [ref] $v); $v }
-$matchingRuntimes = $installedRuntimes |? { IsVersionMatch -actualVersion $_ }
-if (!$matchingRuntimes) {
- Write-Output $false
- exit 1
-}
-
-Write-Output $true
-exit 0
diff --git a/tools/Check-DotNetSdk.ps1 b/tools/Check-DotNetSdk.ps1
deleted file mode 100644
index 6c9fa772..00000000
--- a/tools/Check-DotNetSdk.ps1
+++ /dev/null
@@ -1,37 +0,0 @@
-<#
-.SYNOPSIS
- Checks whether the .NET Core SDK required by this repo is installed.
-#>
-[CmdletBinding()]
-Param (
-)
-
-$dotnet = Get-Command dotnet -ErrorAction SilentlyContinue
-if (!$dotnet) {
- # Nothing is installed.
- Write-Output $false
- exit 1
-}
-
-# We need to set the current directory so dotnet considers the SDK required by our global.json file.
-Push-Location "$PSScriptRoot\.."
-try {
- dotnet -h 2>&1 | Out-Null
- if (($LASTEXITCODE -eq 129) -or # On Linux
- ($LASTEXITCODE -eq -2147450751) # On Windows
- ) {
- # These exit codes indicate no matching SDK exists.
- Write-Output $false
- exit 2
- }
-
- # The required SDK is already installed!
- Write-Output $true
- exit 0
-} catch {
- # I don't know why, but on some build agents (e.g. MicroBuild), an exception is thrown from the `dotnet` invocation when a match is not found.
- Write-Output $false
- exit 3
-} finally {
- Pop-Location
-}
diff --git a/tools/Convert-PDB.ps1 b/tools/Convert-PDB.ps1
index 7e1303a2..350319b6 100644
--- a/tools/Convert-PDB.ps1
+++ b/tools/Convert-PDB.ps1
@@ -32,7 +32,7 @@ if (-not (Test-Path $pdb2pdbpath)) {
Write-Verbose "& (& $PSScriptRoot/Get-NuGetTool.ps1) install Microsoft.DiaSymReader.Pdb2Pdb -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir -Source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json | Out-Null"
# This package originally comes from the https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json feed.
# Add this feed as an upstream to whatever feed is in nuget.config if this step fails.
- & (& $PSScriptRoot/Get-NuGetTool.ps1) install Microsoft.DiaSymReader.Pdb2Pdb -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir | Out-Null
+ & (& $PSScriptRoot/Get-NuGetTool.ps1) install Microsoft.DiaSymReader.Pdb2Pdb -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir -ConfigFile "$PSScriptRoot/../azure-pipelines/nuget.config" | Out-Null
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to install Microsoft.DiaSymReader.Pdb2Pdb. Consider adding https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json as an upstream to your nuget.config feed."
return
diff --git a/tools/Get-LibTemplateBasis.ps1 b/tools/Get-LibTemplateBasis.ps1
deleted file mode 100644
index 2181c77b..00000000
--- a/tools/Get-LibTemplateBasis.ps1
+++ /dev/null
@@ -1,25 +0,0 @@
-<#
-.SYNOPSIS
- Returns the name of the well-known branch in the Library.Template repository upon which HEAD is based.
-#>
-[CmdletBinding(SupportsShouldProcess = $true)]
-Param(
- [switch]$ErrorIfNotRelated
-)
-
-# This list should be sorted in order of decreasing specificity.
-$branchMarkers = @(
- @{ commit = 'fd0a7b25ccf030bbd16880cca6efe009d5b1fffc'; branch = 'microbuild' };
- @{ commit = '05f49ce799c1f9cc696d53eea89699d80f59f833'; branch = 'main' };
-)
-
-foreach ($entry in $branchMarkers) {
- if (git rev-list HEAD | Select-String -Pattern $entry.commit) {
- return $entry.branch
- }
-}
-
-if ($ErrorIfNotRelated) {
- Write-Error "Library.Template has not been previously merged with this repo. Please review https://github.com/AArnott/Library.Template/tree/main?tab=readme-ov-file#readme for instructions."
- exit 1
-}
diff --git a/tools/Get-ProcDump.ps1 b/tools/Get-ProcDump.ps1
index 6fba954d..6748db26 100644
--- a/tools/Get-ProcDump.ps1
+++ b/tools/Get-ProcDump.ps1
@@ -2,13 +2,17 @@
.SYNOPSIS
Downloads 32-bit and 64-bit procdump executables and returns the path to where they were installed.
#>
+Param(
+ [string]$ConfigFile="$PSScriptRoot\..\nuget.config"
+)
+
$version = '0.0.1'
$baseDir = "$PSScriptRoot\..\obj\tools"
$procDumpToolPath = "$baseDir\procdump.$version\bin"
if (-not (Test-Path $procDumpToolPath)) {
if (-not (Test-Path $baseDir)) { New-Item -Type Directory -Path $baseDir | Out-Null }
$baseDir = (Resolve-Path $baseDir).Path # Normalize it
- & (& $PSScriptRoot\Get-NuGetTool.ps1) install procdump -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir | Out-Null
+ & (& $PSScriptRoot\Get-NuGetTool.ps1) install procdump -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir -ConfigFile $ConfigFile | Out-Null
}
(Resolve-Path $procDumpToolPath).Path
diff --git a/tools/Install-NuGetCredProvider.ps1 b/tools/Install-NuGetCredProvider.ps1
index b776f56d..8153eb0b 100755
--- a/tools/Install-NuGetCredProvider.ps1
+++ b/tools/Install-NuGetCredProvider.ps1
@@ -49,7 +49,7 @@ if ($AccessToken) {
$endpoints = @()
$endpointURIs = @()
- Get-ChildItem "$PSScriptRoot\..\nuget.config" -Recurse |% {
+ Get-Item "$PSScriptRoot\..\azure-pipelines\nuget.config" |% {
$nugetConfig = [xml](Get-Content -LiteralPath $_)
$nugetConfig.configuration.packageSources.add |? { ($_.value -match '^https://pkgs\.dev\.azure\.com/') -or ($_.value -match '^https://[\w\-]+\.pkgs\.visualstudio\.com/') } |% {
diff --git a/tools/MergeFrom-Template.ps1 b/tools/MergeFrom-Template.ps1
deleted file mode 100644
index 240a5709..00000000
--- a/tools/MergeFrom-Template.ps1
+++ /dev/null
@@ -1,79 +0,0 @@
-
-<#
-.SYNOPSIS
- Merges the latest changes from Library.Template into HEAD of this repo.
-.PARAMETER LocalBranch
- The name of the local branch to create at HEAD and use to merge into from Library.Template.
-#>
-[CmdletBinding(SupportsShouldProcess = $true)]
-Param(
- [string]$LocalBranch = "dev/$($env:USERNAME)/libtemplateUpdate"
-)
-
-Function Spawn-Tool($command, $commandArgs, $workingDirectory, $allowFailures) {
- if ($workingDirectory) {
- Push-Location $workingDirectory
- }
- try {
- if ($env:TF_BUILD) {
- Write-Host "$pwd >"
- Write-Host "##[command]$command $commandArgs"
- }
- else {
- Write-Host "$command $commandArgs" -ForegroundColor Yellow
- }
- if ($commandArgs) {
- & $command @commandArgs
- } else {
- Invoke-Expression $command
- }
- if ((!$allowFailures) -and ($LASTEXITCODE -ne 0)) { exit $LASTEXITCODE }
- }
- finally {
- if ($workingDirectory) {
- Pop-Location
- }
- }
-}
-
-$remoteBranch = & $PSScriptRoot\Get-LibTemplateBasis.ps1 -ErrorIfNotRelated
-if ($LASTEXITCODE -ne 0) {
- exit $LASTEXITCODE
-}
-
-$LibTemplateUrl = 'https://github.com/aarnott/Library.Template'
-Spawn-Tool 'git' ('fetch', $LibTemplateUrl, $remoteBranch)
-$SourceCommit = Spawn-Tool 'git' ('rev-parse', 'FETCH_HEAD')
-$BaseBranch = Spawn-Tool 'git' ('branch', '--show-current')
-$SourceCommitUrl = "$LibTemplateUrl/commit/$SourceCommit"
-
-# To reduce the odds of merge conflicts at this stage, we always move HEAD to the last successful merge.
-$basis = Spawn-Tool 'git' ('rev-parse', 'HEAD') # TODO: consider improving this later
-
-Write-Host "Merging the $remoteBranch branch of Library.Template ($SourceCommit) into local repo $basis" -ForegroundColor Green
-
-Spawn-Tool 'git' ('checkout', '-b', $LocalBranch, $basis) $null $true
-if ($LASTEXITCODE -eq 128) {
- Spawn-Tool 'git' ('checkout', $LocalBranch)
- Spawn-Tool 'git' ('merge', $basis)
-}
-
-Spawn-Tool 'git' ('merge', 'FETCH_HEAD', '--no-ff', '-m', "Merge the $remoteBranch branch from $LibTemplateUrl`n`nSpecifically, this merges [$SourceCommit from that repo]($SourceCommitUrl).")
-if ($LASTEXITCODE -eq 1) {
- Write-Error "Merge conflict detected. Manual resolution required."
- exit 1
-}
-elseif ($LASTEXITCODE -ne 0) {
- Write-Error "Merge failed with exit code $LASTEXITCODE."
- exit $LASTEXITCODE
-}
-
-$result = New-Object PSObject -Property @{
- BaseBranch = $BaseBranch # The original branch that was checked out when the script ran.
- LocalBranch = $LocalBranch # The name of the local branch that was created before the merge.
- SourceCommit = $SourceCommit # The commit from Library.Template that was merged in.
- SourceBranch = $remoteBranch # The branch from Library.Template that was merged in.
-}
-
-Write-Host $result
-Write-Output $result
From 2ccb80f476a3d425c74e600019f4bf1251ba6472 Mon Sep 17 00:00:00 2001
From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Date: Tue, 13 Oct 2026 01:41:09 +0900
Subject: [PATCH 2/5] Delete init.ps1
---
.github/workflows/build.yml | 6 -
CONTRIBUTING.md | 10 +-
azure-pipelines/archive-sourcecode.yml | 8 +-
azure-pipelines/build.yml | 2 +-
azure-pipelines/install-dependencies.yml | 42 ++-
azure-pipelines/integration-test.yml | 6 +
init.cmd | 20 --
init.ps1 | 239 -------------
test/Restore.Tests.ps1 | 202 -----------
tools/Get-ProcDump.ps1 | 1 +
tools/Install-DotNetSdk.ps1 | 432 -----------------------
tools/Install-NuGetCredProvider.ps1 | 76 ----
tools/Install-NuGetPackage.ps1 | 63 ----
tools/Set-EnvVars.ps1 | 97 -----
14 files changed, 47 insertions(+), 1157 deletions(-)
delete mode 100644 init.cmd
delete mode 100755 init.ps1
delete mode 100644 test/Restore.Tests.ps1
delete mode 100644 tools/Install-DotNetSdk.ps1
delete mode 100755 tools/Install-NuGetCredProvider.ps1
delete mode 100644 tools/Install-NuGetPackage.ps1
delete mode 100644 tools/Set-EnvVars.ps1
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b49517d1..3f1e6939 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -30,9 +30,6 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- - name: Verify restore retry behavior
- run: ./test/Restore.Tests.ps1
- shell: pwsh
- name: โ๏ธ Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
@@ -140,9 +137,6 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- - name: Verify restore retry behavior
- run: ./test/Restore.Tests.ps1
- shell: pwsh
- name: โ๏ธ Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 14d85145..7624fcac 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -29,7 +29,9 @@ The excluded tests exercise large metadata sets or Windows runtime services. The
Microsoft's Azure Pipelines retain the 1ESPT/MicroBuild toolset, signing, SBOM generation, artifact collection, and release/insertion pipelines. `EnableMicroBuild` defaults to true when `TF_BUILD=true`, and those builds restore from `azure-pipelines/nuget.config`, preserving the `msft_consumption` feed. Local and GitHub Actions builds do not load the MicroBuild packages or SBOM configuration.
-`init.ps1` remains an optional environment installer and the official pipelines' bootstrap. Use [PowerShell][pwsh] to run it. For a local build that intentionally uses MicroBuild, run `init.ps1 -Signing` or pass `-p:EnableMicroBuild=true` when restoring and building; authenticated feed access and the signing plugins may be required. CLI tools for documentation, coverage, release versioning, and source archival can be restored separately with `dotnet tool restore`. These tools are not needed for an ordinary solution build.
+Azure Pipelines install the SDKs and runtimes declared in the repository's `global.json` files using `UseDotNet@2`, authenticate with `NuGetAuthenticate@1`, and run `dotnet restore` and `dotnet tool restore` directly. Windows jobs also configure ProcDump for test crash dumps. The symbol/coverage job skips project restore while still restoring its CLI tools. Signing, SBOM, and other MicroBuild plugins remain managed by 1ESPT and the existing MicroBuild tasks.
+
+For an unsigned local build that intentionally uses the MicroBuild configuration, pass `-p:EnableMicroBuild=true` when restoring and building. Reproducing an official signed build also requires Microsoft's signing infrastructure; use the official pipelines for that. CLI tools for documentation, coverage, release versioning, and source archival can be restored separately with `dotnet tool restore`. These tools are not needed for an ordinary solution build.
## Parsing the metadata
@@ -58,8 +60,6 @@ To pull the new version through:
After the package is on the feed, build and run the tests (`dotnet test --filter "TestCategory!=RequiresHardware"`) and fix any regressions before opening the PR.
-[pwsh]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell
-
## Releases
Use `nbgv tag` to create a tag for a particular commit that you mean to release.
@@ -89,8 +89,4 @@ Configuration is in the `.github/renovate.json` file.
When changing the renovate.json file, follow [these validation steps](https://docs.renovatebot.com/config-validation/).
-The optional `init.ps1 -RestoreRetryCount 10` retries restores with 60 seconds between attempts only when Azure Artifacts reports `No local versions of package` for an upstream package that has not been saved to the feed. Generic download and authentication failures fail immediately. GitHub Actions use nuget.org directly and do not need this feed-specific retry mechanism.
-
-Run `./test/Restore.Tests.ps1` with PowerShell to exercise the retry behavior without restoring packages or installing test dependencies. These regression checks also run in the Windows and Linux build jobs.
-
If Renovate is not creating pull requests when you expect it to, check that the [Renovate GitHub App](https://github.com/apps/renovate) is configured for your account or repo.
diff --git a/azure-pipelines/archive-sourcecode.yml b/azure-pipelines/archive-sourcecode.yml
index 44d341c5..d53f6711 100644
--- a/azure-pipelines/archive-sourcecode.yml
+++ b/azure-pipelines/archive-sourcecode.yml
@@ -54,8 +54,12 @@ extends:
- checkout: self
clean: true
fetchDepth: 0
- - powershell: tools/Install-DotNetSdk.ps1
- displayName: โ Install .NET SDK
+ - task: UseDotNet@2
+ displayName: โ Install .NET SDKs and runtimes
+ inputs:
+ packageType: sdk
+ useGlobalJson: true
+ workingDirectory: $(Build.SourcesDirectory)
- task: NuGetAuthenticate@1
displayName: ๐ Authenticate NuGet feeds
inputs:
diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml
index f455d99f..92ce9ae8 100644
--- a/azure-pipelines/build.yml
+++ b/azure-pipelines/build.yml
@@ -337,7 +337,7 @@ jobs:
clean: true
- template: install-dependencies.yml
parameters:
- initArgs: -NoRestore
+ restoreProjects: false
- template: publish-symbols.yml
parameters:
EnableLinuxBuild: ${{ parameters.EnableLinuxBuild }}
diff --git a/azure-pipelines/install-dependencies.yml b/azure-pipelines/install-dependencies.yml
index 9835c3f8..3a2bdd44 100644
--- a/azure-pipelines/install-dependencies.yml
+++ b/azure-pipelines/install-dependencies.yml
@@ -1,12 +1,19 @@
parameters:
-- name: initArgs
- type: string
- default: ''
+- name: restoreProjects
+ type: boolean
+ default: true
- name: needsAzurePublicFeeds
type: boolean
default: true # If nuget.config pulls from the azure-public account, we need to authenticate when building on the devdiv account.
steps:
+- task: UseDotNet@2
+ displayName: โ Install .NET SDKs and runtimes
+ inputs:
+ packageType: sdk
+ useGlobalJson: true
+ workingDirectory: $(Build.SourcesDirectory)
+
- ${{ if and(parameters.needsAzurePublicFeeds, eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9')) }}:
- template: WIFtoPATauth.yml
parameters:
@@ -20,15 +27,26 @@ steps:
nuGetServiceConnections: azure-public/msft_consumption
- powershell: |
- $AccessToken = '$(System.AccessToken)' # Avoid specifying the access token directly on the init.ps1 command line to avoid it showing up in errors
- .\init.ps1 -AccessToken $AccessToken ${{ parameters['initArgs'] }} -UpgradePrerequisites -NoNuGetCredProvider
- dotnet --info
-
- # Print mono version if it is present.
- if (Get-Command mono -ErrorAction SilentlyContinue) {
- mono --version
- }
- displayName: โ Install prerequisites
+ $procDumpPath = & ./tools/Get-ProcDump.ps1 -ConfigFile ./azure-pipelines/nuget.config
+ Write-Host "##vso[task.setvariable variable=PROCDUMP_PATH]$procDumpPath"
+ displayName: โ Configure crash-dump collection
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+
+- ${{ if parameters.restoreProjects }}:
+ - script: dotnet restore --configfile azure-pipelines/nuget.config
+ displayName: ๐ฆ Restore project packages
+ env:
+ NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS: 20
+ NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS: 20
+
+- script: dotnet tool restore --configfile azure-pipelines/nuget.config
+ displayName: โ Restore CLI tools
+ env:
+ NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS: 20
+ NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS: 20
+
+- script: dotnet --info
+ displayName: โ Show .NET environment
- powershell: tools/variables/_define.ps1
failOnStderr: true
diff --git a/azure-pipelines/integration-test.yml b/azure-pipelines/integration-test.yml
index 491f3533..01c5fe9e 100644
--- a/azure-pipelines/integration-test.yml
+++ b/azure-pipelines/integration-test.yml
@@ -15,6 +15,12 @@ jobs:
- checkout: self
fetchDepth: 1 # no need for git history here
clean: true
+ - task: UseDotNet@2
+ displayName: โ Install integration-test SDKs and runtimes
+ inputs:
+ packageType: sdk
+ useGlobalJson: true
+ workingDirectory: $(Build.SourcesDirectory)
- task: CopyFiles@2
inputs:
SourceFolder: integration-tests
diff --git a/init.cmd b/init.cmd
deleted file mode 100644
index 667efabb..00000000
--- a/init.cmd
+++ /dev/null
@@ -1,20 +0,0 @@
-@echo off
-SETLOCAL
-set PS1UnderCmd=1
-
-:: Get the datetime in a format that can go in a filename.
-set _my_datetime=%date%_%time%
-set _my_datetime=%_my_datetime: =_%
-set _my_datetime=%_my_datetime::=%
-set _my_datetime=%_my_datetime:/=_%
-set _my_datetime=%_my_datetime:.=_%
-set CmdEnvScriptPath=%temp%\envvarscript_%_my_datetime%.cmd
-
-powershell.exe -NoProfile -NoLogo -ExecutionPolicy bypass -Command "try { & '%~dpn0.ps1' %*; exit $LASTEXITCODE } catch { write-host $_; exit 1 }"
-
-:: Set environment variables in the parent cmd.exe process.
-IF EXIST "%CmdEnvScriptPath%" (
- ENDLOCAL
- CALL "%CmdEnvScriptPath%"
- DEL "%CmdEnvScriptPath%"
-)
diff --git a/init.ps1 b/init.ps1
deleted file mode 100755
index 4f8ba41d..00000000
--- a/init.ps1
+++ /dev/null
@@ -1,239 +0,0 @@
-#!/usr/bin/env pwsh
-
-<#
-.SYNOPSIS
- Installs dependencies required to build and test the projects in this repository.
-.DESCRIPTION
- This MAY not require elevation, as the SDK and runtimes are installed to a per-user location,
- unless the `-InstallLocality` switch is specified directing to a per-repo or per-machine location.
- See detailed help on that switch for more information.
-
- The CmdEnvScriptPath environment variable may be optionally set to a path to a cmd shell script to be created (or appended to if it already exists) that will set the environment variables in cmd.exe that are set within the PowerShell environment.
- This is used by init.cmd in order to reapply any new environment variables to the parent cmd.exe process that were set in the powershell child process.
-.PARAMETER InstallLocality
- A value indicating whether dependencies should be installed locally to the repo or at a per-user location.
- Per-user allows sharing the installed dependencies across repositories and allows use of a shared expanded package cache.
- Visual Studio will only notice and use these SDKs/runtimes if VS is launched from the environment that runs this script.
- Per-repo allows for high isolation, allowing for a more precise recreation of the environment within an Azure Pipelines build.
- When using 'repo', environment variables are set to cause the locally installed dotnet SDK to be used.
- Per-repo can lead to file locking issues when dotnet.exe is left running as a build server and can be mitigated by running `dotnet build-server shutdown`.
- Per-machine requires elevation and will download and install all SDKs and runtimes to machine-wide locations so all applications can find it.
-.PARAMETER NoPrerequisites
- Skips the installation of prerequisite software (e.g. SDKs, tools).
-.PARAMETER NoNuGetCredProvider
- Skips the installation of the NuGet credential provider. Useful in pipelines with the `NuGetAuthenticate` task, as a workaround for https://github.com/microsoft/artifacts-credprovider/issues/244.
- This switch is ignored and installation is skipped when -NoPrerequisites is specified.
-.PARAMETER UpgradePrerequisites
- Takes time to install prerequisites even if they are already present in case they need to be upgraded.
- No effect if -NoPrerequisites is specified.
-.PARAMETER NoRestore
- Skips the package restore step.
-.PARAMETER NoToolRestore
- Skips the dotnet tool restore step.
-.PARAMETER Signing
- Install the MicroBuild signing plugin for building test-signed builds on desktop machines.
-.PARAMETER Localization
- Install the MicroBuild localization plugin for building loc builds on desktop machines.
- The environment is configured to build pseudo-loc for JPN only, but may be used to build
- all languages with shipping-style loc by using the `/p:loctype=full,loclanguages=vs`
- when building.
-.PARAMETER Setup
- Install the MicroBuild setup plugin for building VSIXv3 packages.
-.PARAMETER OptProf
- Install the MicroBuild OptProf plugin for building optimized assemblies on desktop machines.
-.PARAMETER Sbom
- Install the MicroBuild SBOM plugin.
-.PARAMETER AccessToken
- An optional access token for authenticating to Azure Artifacts authenticated feeds.
-.PARAMETER Interactive
- Runs NuGet restore in interactive mode. This can turn authentication failures into authentication challenges.
-.PARAMETER RestoreRetryCount
- The maximum number of restore attempts when Azure Artifacts explicitly reports an unsaved upstream package.
-.PARAMETER RestoreRetryDelaySeconds
- The delay between restore attempts when a package is not yet available from the configured feed.
-#>
-[CmdletBinding(SupportsShouldProcess = $true)]
-Param (
- [ValidateSet('repo', 'user', 'machine')]
- [string]$InstallLocality = 'user',
- [Parameter()]
- [switch]$NoPrerequisites,
- [Parameter()]
- [switch]$NoNuGetCredProvider,
- [Parameter()]
- [switch]$UpgradePrerequisites,
- [Parameter()]
- [switch]$NoRestore,
- [Parameter()]
- [switch]$NoToolRestore,
- [Parameter()]
- [switch]$Signing,
- [Parameter()]
- [switch]$Localization,
- [Parameter()]
- [switch]$Setup,
- [Parameter()]
- [switch]$OptProf,
- [Parameter()]
- [switch]$SBOM,
- [Parameter()]
- [string]$AccessToken,
- [Parameter()]
- [switch]$Interactive,
- [Parameter()]
- [ValidateRange(1, 10)]
- [int]$RestoreRetryCount = 1,
- [Parameter()]
- [ValidateRange(0, 600)]
- [int]$RestoreRetryDelaySeconds = 60
-)
-
-function Invoke-RestoreWithRetry {
- [CmdletBinding()]
- Param (
- [Parameter(Mandatory = $true)]
- [scriptblock]$Restore,
- [Parameter(Mandatory = $true)]
- [string]$FailureMessage
- )
-
- for ($attempt = 1; $attempt -le $RestoreRetryCount; $attempt++) {
- if ($RestoreRetryCount -eq 1) {
- & $Restore
- $exitCode = $LASTEXITCODE
- $restoreOutput = $null
- } else {
- & $Restore 2>&1 | Tee-Object -Variable restoreOutput | Out-Host
- $exitCode = $LASTEXITCODE
- }
-
- if ($exitCode -eq 0) {
- return
- }
-
- $feedCacheMiss = ($restoreOutput -join "`n") -match 'No local versions of package'
- if (!$feedCacheMiss -or $attempt -eq $RestoreRetryCount) {
- throw $FailureMessage
- }
-
- Write-Warning "A dependency is not available from the package feed yet. Retrying in $RestoreRetryDelaySeconds seconds (attempt $($attempt + 1) of $RestoreRetryCount)."
- Start-Sleep -Seconds $RestoreRetryDelaySeconds
- }
-}
-
-$EnvVars = @{}
-$PrependPath = @()
-$useMicroBuild = $env:TF_BUILD -eq 'true' -or $env:EnableMicroBuild -eq 'true' -or $env:SignType -or $Signing -or $Localization -or $Setup -or $OptProf -or $SBOM
-if ($useMicroBuild) {
- $EnvVars['EnableMicroBuild'] = 'true'
-}
-$nugetConfigFile = Join-Path $PSScriptRoot 'nuget.config'
-if ($useMicroBuild) {
- $nugetConfigFile = Join-Path $PSScriptRoot 'azure-pipelines/nuget.config'
-}
-
-if (!$NoPrerequisites) {
- if (!$NoNuGetCredProvider) {
- & "$PSScriptRoot\tools\Install-NuGetCredProvider.ps1" -AccessToken $AccessToken -Force:$UpgradePrerequisites
- }
-
- & "$PSScriptRoot\tools\Install-DotNetSdk.ps1" -InstallLocality $InstallLocality
- if ($LASTEXITCODE -eq 3010) {
- Exit 3010
- }
-
- # The procdump tool and env var is required for dotnet test to collect hang/crash dumps of tests.
- # But it only works on Windows.
- if ($env:OS -eq 'Windows_NT') {
- $EnvVars['PROCDUMP_PATH'] = & "$PSScriptRoot\tools\Get-ProcDump.ps1" -ConfigFile $nugetConfigFile
- }
-}
-
-# Workaround nuget credential provider bug that causes very unreliable package restores on Azure Pipelines
-$env:NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS = 20
-$env:NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS = 20
-
-Push-Location $PSScriptRoot
-try {
- $HeaderColor = 'Green'
-
- $RestoreArguments = @()
- if ($useMicroBuild) {
- $RestoreArguments += '--configfile', $nugetConfigFile
- }
- if ($Interactive) {
- $RestoreArguments += '--interactive'
- }
-
- if (!$NoRestore -and $PSCmdlet.ShouldProcess("NuGet packages", "Restore")) {
- Write-Host "Restoring NuGet packages" -ForegroundColor $HeaderColor
- Invoke-RestoreWithRetry -Restore {
- $PSNativeCommandUseErrorActionPreference = $false
- dotnet restore @RestoreArguments "-p:EnableMicroBuild=$useMicroBuild"
- } -FailureMessage "Failure while restoring packages."
- }
-
- if (!$NoToolRestore -and $PSCmdlet.ShouldProcess("dotnet tool", "restore")) {
- $ToolRestoreArguments = @($RestoreArguments)
- if ($RestoreRetryCount -gt 1) {
- # Default tool verbosity hides the underlying feed error behind a generic download failure.
- $ToolRestoreArguments += '--verbosity', 'detailed'
- }
-
- Invoke-RestoreWithRetry -Restore {
- $PSNativeCommandUseErrorActionPreference = $false
- dotnet tool restore @ToolRestoreArguments
- } -FailureMessage "Failure while restoring dotnet CLI tools."
- }
-
- $InstallNuGetPkgScriptPath = "$PSScriptRoot\tools\Install-NuGetPackage.ps1"
- $nugetVerbosity = 'quiet'
- if ($Verbose) { $nugetVerbosity = 'normal' }
- $MicroBuildInstallArguments = @{
- Source = 'https://pkgs.dev.azure.com/devdiv/_packaging/MicroBuildToolset%40Local/nuget/v3/index.json'
- ConfigFile = $nugetConfigFile
- Verbosity = $nugetVerbosity
- }
- if ($Signing) {
- Write-Host "Installing MicroBuild signing plugin" -ForegroundColor $HeaderColor
- & $InstallNuGetPkgScriptPath MicroBuild.Plugins.Signing @MicroBuildInstallArguments
- $EnvVars['SignType'] = "Test"
- }
-
- if ($Setup) {
- Write-Host "Installing MicroBuild SwixBuild plugin..." -ForegroundColor $HeaderColor
- & $InstallNuGetPkgScriptPath Microsoft.VisualStudioEng.MicroBuild.Plugins.SwixBuild @MicroBuildInstallArguments
- }
-
- if ($OptProf) {
- Write-Host "Installing MicroBuild OptProf plugin" -ForegroundColor $HeaderColor
- & $InstallNuGetPkgScriptPath MicroBuild.Plugins.OptProf @MicroBuildInstallArguments
- $EnvVars['OptProfEnabled'] = '1'
- }
-
- if ($Localization) {
- Write-Host "Installing MicroBuild localization plugin" -ForegroundColor $HeaderColor
- & $InstallNuGetPkgScriptPath MicroBuild.Plugins.Localization @MicroBuildInstallArguments
- $EnvVars['LocType'] = "Pseudo"
- $EnvVars['LocLanguages'] = "JPN"
- }
-
- if ($SBOM) {
- Write-Host "Installing MicroBuild SBOM plugin" -ForegroundColor $HeaderColor
- & $InstallNuGetPkgScriptPath MicroBuild.Plugins.Sbom @MicroBuildInstallArguments
- # The feed with the latest versions of the tool is at 'https://1essharedassets.pkgs.visualstudio.com/1esPkgs/_packaging/SBOMTool/nuget/v3/index.json',
- # but we'll use the feed that the SBOM task itself uses to install the tool for consistency.
- $PkgMicrosoft_ManifestTool_CrossPlatform = & $InstallNuGetPkgScriptPath Microsoft.ManifestTool.CrossPlatform @MicroBuildInstallArguments
- $EnvVars['GenerateSBOM'] = "true"
- $EnvVars['PkgMicrosoft_ManifestTool_CrossPlatform'] = $PkgMicrosoft_ManifestTool_CrossPlatform
- }
-
- & "$PSScriptRoot/tools/Set-EnvVars.ps1" -Variables $EnvVars -PrependPath $PrependPath | Out-Null
-}
-catch {
- Write-Error $error[0]
- exit $lastexitcode
-}
-finally {
- Pop-Location
-}
diff --git a/test/Restore.Tests.ps1 b/test/Restore.Tests.ps1
deleted file mode 100644
index da1e7f71..00000000
--- a/test/Restore.Tests.ps1
+++ /dev/null
@@ -1,202 +0,0 @@
-#!/usr/bin/env pwsh
-
-<#
-.SYNOPSIS
- Exercises init.ps1 restore retries without installing prerequisites or restoring packages.
-#>
-[CmdletBinding()]
-Param()
-
-$ErrorActionPreference = 'Stop'
-$initPath = (Resolve-Path (Join-Path $PSScriptRoot '..\init.ps1')).Path
-$tokens = $null
-$parseErrors = $null
-$initAst = [System.Management.Automation.Language.Parser]::ParseFile($initPath, [ref]$tokens, [ref]$parseErrors)
-if ($parseErrors.Count -ne 0) {
- throw ($parseErrors -join "`n")
-}
-
-# Load the production helper without executing init.ps1's installation and restore steps.
-$retryFunction = $initAst.Find({
- Param($node)
- $node -is [System.Management.Automation.Language.FunctionDefinitionAst] -and $node.Name -eq 'Invoke-RestoreWithRetry'
-}, $false)
-if ($null -eq $retryFunction) {
- throw 'Could not find Invoke-RestoreWithRetry in init.ps1.'
-}
-. ([scriptblock]::Create($retryFunction.Extent.Text))
-$pwsh = (Get-Process -Id $PID).Path
-
-<#
-.SYNOPSIS
- Runs a native failing or succeeding restore command and checks attempts, warnings, and errors.
-#>
-function Test-RestoreRetry {
- Param(
- [string]$Name,
- [string]$Output = '',
- [int]$Failures = 0,
- [int]$RestoreRetryCount = 3,
- [int]$ExpectedAttempts = 1,
- [int]$ExpectedWarnings = 0,
- [switch]$StandardError,
- [switch]$ExpectFailure
- )
-
- $RestoreRetryDelaySeconds = 0
- $state = [pscustomobject]@{ Attempts = 0 }
- $warnings = @()
- $failure = $null
- try {
- Invoke-RestoreWithRetry -Restore {
- $PSNativeCommandUseErrorActionPreference = $false
- $state.Attempts++
- $exitCode = [int]($state.Attempts -le $Failures)
- $stream = if ($StandardError) { 'Error' } else { 'Out' }
- $command = "[Console]::$stream.WriteLine('$($Output.Replace("'", "''"))'); exit $exitCode"
- $encodedCommand = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($command))
- & $pwsh -NoLogo -NoProfile -NonInteractive -EncodedCommand $encodedCommand
- } -FailureMessage 'Restore regression failure.' -WarningVariable warnings -WarningAction SilentlyContinue
- }
- catch {
- $failure = $_.Exception.Message
- }
-
- if ($state.Attempts -ne $ExpectedAttempts -or @($warnings).Count -ne $ExpectedWarnings) {
- throw "${Name}: expected $ExpectedAttempts attempts and $ExpectedWarnings warnings; got $($state.Attempts) attempts and $(@($warnings).Count) warnings."
- }
- if ($ExpectFailure) {
- if ($failure -ne 'Restore regression failure.') {
- throw "${Name}: expected restore failure; got '$failure'."
- }
- } elseif ($null -ne $failure) {
- throw "${Name}: unexpected failure '$failure'."
- }
-
- Write-Host "PASS: $Name"
-}
-
-$cacheMiss = "Response status code does not indicate success: 401 (Unauthorized - No local versions of package 'sample'; please provide authentication to access versions from upstream that have not yet been saved to your feed.)"
-$toolFailure = 'Downloading sample-tool version 1.2.3 failed'
-Test-RestoreRetry -Name 'Success does not retry'
-Test-RestoreRetry -Name 'A successful exit takes precedence over output' -Output $cacheMiss
-Test-RestoreRetry -Name 'Package cache miss retries until success' -Output $cacheMiss -Failures 2 -ExpectedAttempts 3 -ExpectedWarnings 2
-Test-RestoreRetry -Name 'Cache miss on stderr retries until success' -Output $cacheMiss -StandardError -Failures 2 -ExpectedAttempts 3 -ExpectedWarnings 2
-Test-RestoreRetry -Name 'Detailed tool cache miss retries until success' -Output "$toolFailure`n$cacheMiss" -Failures 2 -ExpectedAttempts 3 -ExpectedWarnings 2
-Test-RestoreRetry -Name 'Retry exhaustion fails' -Output $cacheMiss -Failures 10 -RestoreRetryCount 10 -ExpectedAttempts 10 -ExpectedWarnings 9 -ExpectFailure
-Test-RestoreRetry -Name 'Single-attempt caller never retries' -Output $cacheMiss -Failures 3 -RestoreRetryCount 1 -ExpectFailure
-Test-RestoreRetry -Name 'Generic tool failure is not a cache miss' -Output $toolFailure -Failures 3 -ExpectFailure
-Test-RestoreRetry -Name 'Tool authentication failure fails immediately' -Output "$toolFailure`nResponse status code does not indicate success: 401 (Unauthorized)." -Failures 3 -ExpectFailure
-Test-RestoreRetry -Name 'Tool permission failure fails immediately' -Output "$toolFailure`nResponse status code does not indicate success: 403 (Forbidden)." -Failures 3 -ExpectFailure
-Test-RestoreRetry -Name 'Missing package version fails immediately' -Output 'error NU1102: Unable to find package sample-tool with version 1.2.3' -Failures 3 -ExpectFailure
-Test-RestoreRetry -Name 'Incompatible package fails immediately' -Output "$toolFailure`nerror NU1202: Package sample-tool is not compatible with net10.0." -Failures 3 -ExpectFailure
-Test-RestoreRetry -Name 'Failure without output fails immediately' -Failures 3 -ExpectFailure
-
-<#
-.SYNOPSIS
- Checks the actual init.ps1 tool-restore arguments while replacing dotnet with a successful stub.
-#>
-function Test-ToolRestoreArguments {
- Param(
- [int]$RestoreRetryCount = 1,
- [switch]$Interactive
- )
-
- $state = [pscustomobject]@{ Arguments = @(); Calls = 0 }
- $originalDotnet = Get-Item Function:global:dotnet -ErrorAction SilentlyContinue
- try {
- Set-Item Function:global:dotnet -Value {
- $state.Arguments = @($args)
- $state.Calls++
- $global:LASTEXITCODE = 0
- }.GetNewClosure()
- $initArguments = @{ NoPrerequisites = $true; NoRestore = $true; Interactive = $Interactive }
- if ($PSBoundParameters.ContainsKey('RestoreRetryCount')) {
- $initArguments.RestoreRetryCount = $RestoreRetryCount
- }
- & $initPath @initArguments
-
- $retryCountParameter = $initAst.ParamBlock.Parameters | Where-Object { $_.Name.VariablePath.UserPath -eq 'RestoreRetryCount' }
- if ($retryCountParameter.DefaultValue.Value -ne 1) {
- throw 'The default retry count must remain one.'
- }
- $expectedArguments = @('tool', 'restore')
- if ($Interactive) {
- $expectedArguments += '--interactive'
- }
- if ($RestoreRetryCount -gt 1) {
- $expectedArguments += '--verbosity', 'detailed'
- }
- if ($state.Calls -ne 1 -or ($state.Arguments -join '|') -ne ($expectedArguments -join '|')) {
- throw "Unexpected tool restore arguments: $($state.Arguments -join ' ')"
- }
- }
- finally {
- if ($null -eq $originalDotnet) {
- Remove-Item Function:global:dotnet
- } else {
- Set-Item Function:global:dotnet -Value $originalDotnet.ScriptBlock
- }
- }
-
- Write-Host "PASS: Tool restore arguments (attempts=$RestoreRetryCount, interactive=$Interactive)"
-}
-
-Test-ToolRestoreArguments
-Test-ToolRestoreArguments -RestoreRetryCount 1
-Test-ToolRestoreArguments -RestoreRetryCount 3
-Test-ToolRestoreArguments -RestoreRetryCount 3 -Interactive
-
-# Exercise both restore commands with the real bootstrap while avoiding installs and network access.
-function Test-RestoreConfiguration {
- Param([switch]$AzurePipelines, [switch]$LocalMicroBuild)
-
- $state = [pscustomobject]@{ Calls = [Collections.Generic.List[object]]::new() }
- $originalDotnet = Get-Item Function:global:dotnet -ErrorAction SilentlyContinue
- $originalEnvironment = @{}
- foreach ($name in @('TF_BUILD', 'EnableMicroBuild', 'SignType', 'GITHUB_ACTIONS', 'CmdEnvScriptPath')) {
- $originalEnvironment[$name] = [Environment]::GetEnvironmentVariable($name)
- [Environment]::SetEnvironmentVariable($name, $null)
- }
-
- try {
- if ($AzurePipelines) { $env:TF_BUILD = 'true' }
- if ($LocalMicroBuild) { $env:EnableMicroBuild = 'true' }
- Set-Item Function:global:dotnet -Value {
- $state.Calls.Add(@($args))
- $global:LASTEXITCODE = 0
- }.GetNewClosure()
- & $initPath -NoPrerequisites
-
- $expectedRestore = @('restore')
- $expectedTools = @('tool', 'restore')
- if ($AzurePipelines -or $LocalMicroBuild) {
- $configArguments = @('--configfile', (Join-Path (Split-Path $initPath) 'azure-pipelines/nuget.config'))
- $expectedRestore += $configArguments
- $expectedTools += $configArguments
- }
- $expectedRestore += "-p:EnableMicroBuild=$($AzurePipelines -or $LocalMicroBuild)"
-
- if ($state.Calls.Count -ne 2 -or ($state.Calls[0] -join '|') -ne ($expectedRestore -join '|') -or ($state.Calls[1] -join '|') -ne ($expectedTools -join '|')) {
- throw "Unexpected restore configuration (AzurePipelines=$AzurePipelines, LocalMicroBuild=$LocalMicroBuild)."
- }
- }
- finally {
- if ($null -eq $originalDotnet) {
- Remove-Item Function:global:dotnet
- } else {
- Set-Item Function:global:dotnet -Value $originalDotnet.ScriptBlock
- }
- foreach ($name in $originalEnvironment.Keys) {
- [Environment]::SetEnvironmentVariable($name, $originalEnvironment[$name])
- }
- }
-
- Write-Host "PASS: Restore configuration (AzurePipelines=$AzurePipelines, LocalMicroBuild=$LocalMicroBuild)"
-}
-
-Test-RestoreConfiguration
-Test-RestoreConfiguration -AzurePipelines
-Test-RestoreConfiguration -LocalMicroBuild
-Write-Host 'All restore retry regression checks passed.'
-exit 0
diff --git a/tools/Get-ProcDump.ps1 b/tools/Get-ProcDump.ps1
index 6748db26..5b6d44b0 100644
--- a/tools/Get-ProcDump.ps1
+++ b/tools/Get-ProcDump.ps1
@@ -13,6 +13,7 @@ if (-not (Test-Path $procDumpToolPath)) {
if (-not (Test-Path $baseDir)) { New-Item -Type Directory -Path $baseDir | Out-Null }
$baseDir = (Resolve-Path $baseDir).Path # Normalize it
& (& $PSScriptRoot\Get-NuGetTool.ps1) install procdump -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir -ConfigFile $ConfigFile | Out-Null
+ if ($LASTEXITCODE -ne 0) { throw 'Failed to install ProcDump.' }
}
(Resolve-Path $procDumpToolPath).Path
diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1
deleted file mode 100644
index 0ebc1a71..00000000
--- a/tools/Install-DotNetSdk.ps1
+++ /dev/null
@@ -1,432 +0,0 @@
-#!/usr/bin/env pwsh
-
-<#
-.SYNOPSIS
- Installs the .NET SDK specified in the global.json file at the root of this repository,
- along with supporting .NET runtimes used for testing.
-.DESCRIPTION
- This MAY not require elevation, as the SDK and runtimes are installed locally to this repo location,
- unless `-InstallLocality machine` is specified.
-.PARAMETER InstallLocality
- A value indicating whether dependencies should be installed locally to the repo or at a per-user location.
- Per-user allows sharing the installed dependencies across repositories and allows use of a shared expanded package cache.
- Visual Studio will only notice and use these SDKs/runtimes if VS is launched from the environment that runs this script.
- Per-repo allows for high isolation, allowing for a more precise recreation of the environment within an Azure Pipelines build.
- When using 'repo', environment variables are set to cause the locally installed dotnet SDK to be used.
- Per-repo can lead to file locking issues when dotnet.exe is left running as a build server and can be mitigated by running `dotnet build-server shutdown`.
- Per-machine requires elevation and will download and install all SDKs and runtimes to machine-wide locations so all applications can find it.
-.PARAMETER SdkOnly
- Skips installing the runtime.
-.PARAMETER IncludeX86
- Installs a x86 SDK and runtimes in addition to the x64 ones. Only supported on Windows. Ignored on others.
-.PARAMETER IncludeAspNetCore
- Installs the ASP.NET Core runtime along with the .NET runtime.
-#>
-[CmdletBinding(SupportsShouldProcess=$true,ConfirmImpact='Medium')]
-Param (
- [ValidateSet('repo','user','machine')]
- [string]$InstallLocality='user',
- [switch]$SdkOnly,
- [switch]$IncludeX86,
- [switch]$IncludeAspNetCore
-)
-
-$DotNetInstallScriptRoot = "$PSScriptRoot/../obj/tools"
-if (!(Test-Path $DotNetInstallScriptRoot)) { New-Item -ItemType Directory -Path $DotNetInstallScriptRoot -WhatIf:$false | Out-Null }
-$DotNetInstallScriptRoot = Resolve-Path $DotNetInstallScriptRoot
-
-# Look up actual required .NET SDK version from global.json
-$sdks = @(New-Object PSObject -Property @{ Version = & "$PSScriptRoot/variables/DotNetSdkVersion.ps1" })
-
-# Sometimes a repo requires extra SDKs to be installed (e.g. msbuild.locator scenarios running in tests).
-# In such a circumstance, a precise SDK version or a channel can be added as in the example below:
-# $sdks += New-Object PSObject -Property @{ Channel = '8.0' }
-
-If ($IncludeX86 -and ($IsMacOS -or $IsLinux)) {
- Write-Verbose "Ignoring -IncludeX86 switch because 32-bit runtimes are only supported on Windows."
- $IncludeX86 = $false
-}
-
-$arch = [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture
-if (!$arch) { # Windows Powershell leaves this blank
- $arch = 'x64'
- if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { $arch = 'ARM64' }
- if (${env:ProgramFiles(Arm)}) { $arch = 'ARM64' }
-}
-
-# Search for all .NET runtime versions referenced from MSBuild projects and arrange to install them.
-$runtimeVersions = @()
-$windowsDesktopRuntimeVersions = @()
-$aspnetRuntimeVersions = @()
-if (!$SdkOnly) {
- Get-ChildItem "$PSScriptRoot\..\src\*.*proj", "$PSScriptRoot\..\test\*.*proj", "$PSScriptRoot\..\Directory.Build.props","$PSScriptRoot\..\GenerationSandbox.props" -Recurse | % {
- $projXml = [xml](Get-Content -LiteralPath $_)
- $pg = $projXml.Project.PropertyGroup
- if ($pg) {
- $targetFrameworks = @()
- $tf = $pg.TargetFramework
- $targetFrameworks += $tf
- $tfs = $pg.TargetFrameworks
- if ($tfs) {
- $targetFrameworks = $tfs -Split ';'
- }
- }
- $targetFrameworks |? { $_ -match 'net(?:coreapp)?(\d+\.\d+)' } |% {
- $v = $Matches[1]
- $runtimeVersions += $v
- $aspnetRuntimeVersions += $v
- if ($v -ge '3.0' -and -not ($IsMacOS -or $IsLinux)) {
- $windowsDesktopRuntimeVersions += $v
- }
- }
-
- # Add target frameworks of the form: netXX
- $targetFrameworks |? { $_ -match 'net(\d+\.\d+)' } |% {
- $v = $Matches[1]
- $runtimeVersions += $v
- $aspnetRuntimeVersions += $v
- if (-not ($IsMacOS -or $IsLinux)) {
- $windowsDesktopRuntimeVersions += $v
- }
- }
- }
-}
-
-if (!$IncludeAspNetCore) {
- $aspnetRuntimeVersions = @()
-}
-
-Function Get-FileFromWeb([Uri]$Uri, $OutDir) {
- $OutFile = Join-Path $OutDir $Uri.Segments[-1]
- if (!(Test-Path $OutFile)) {
- Write-Verbose "Downloading $Uri..."
- if (!(Test-Path $OutDir)) { New-Item -ItemType Directory -Path $OutDir | Out-Null }
- try {
- (New-Object System.Net.WebClient).DownloadFile($Uri, $OutFile)
- } finally {
- # This try/finally causes the script to abort
- }
- }
-
- $OutFile
-}
-
-Function Get-InstallerExe(
- $Version,
- $Architecture,
- [ValidateSet('Sdk','Runtime','WindowsDesktop')]
- [string]$sku
-) {
- # Get the latest/actual version for the specified one
- $TypedVersion = $null
- if (![Version]::TryParse($Version, [ref] $TypedVersion)) {
- Write-Error "Unable to parse $Version into an a.b.c.d version. This version cannot be installed machine-wide."
- exit 1
- }
-
- if ($TypedVersion.Build -eq -1) {
- $versionInfo = -Split (Invoke-WebRequest -Uri "https://dotnetcli.blob.core.windows.net/dotnet/$sku/$Version/latest.version" -UseBasicParsing)
- $Version = $versionInfo[-1]
- }
-
- $majorMinor = "$($TypedVersion.Major).$($TypedVersion.Minor)"
- $ReleasesFile = Join-Path $DotNetInstallScriptRoot "$majorMinor\releases.json"
- if (!(Test-Path $ReleasesFile)) {
- Get-FileFromWeb -Uri "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/$majorMinor/releases.json" -OutDir (Split-Path $ReleasesFile) | Out-Null
- }
-
- $releases = Get-Content $ReleasesFile | ConvertFrom-Json
- $url = $null
- foreach ($release in $releases.releases) {
- $filesElement = $null
- if ($release.$sku.version -eq $Version) {
- $filesElement = $release.$sku.files
- }
- if (!$filesElement -and ($sku -eq 'sdk') -and $release.sdks) {
- foreach ($sdk in $release.sdks) {
- if ($sdk.version -eq $Version) {
- $filesElement = $sdk.files
- break
- }
- }
- }
-
- if ($filesElement) {
- foreach ($file in $filesElement) {
- if ($file.rid -eq "win-$Architecture") {
- $url = $file.url
- Break
- }
- }
-
- if ($url) {
- Break
- }
- }
- }
-
- if ($url) {
- Get-FileFromWeb -Uri $url -OutDir $DotNetInstallScriptRoot
- } else {
- throw "Unable to find release of $sku v$Version"
- }
-}
-
-Function Install-DotNet($Version, $Architecture, [ValidateSet('Sdk','Runtime','WindowsDesktop','AspNetCore')][string]$sku = 'Sdk') {
- Write-Host "Downloading .NET $sku $Version..."
- $Installer = Get-InstallerExe -Version $Version -Architecture $Architecture -sku $sku
- Write-Host "Installing .NET $sku $Version..."
- cmd /c start /wait $Installer /install /passive /norestart
- if ($LASTEXITCODE -eq 3010) {
- Write-Verbose "Restart required"
- } elseif ($LASTEXITCODE -ne 0) {
- throw "Failure to install .NET SDK"
- }
-}
-
-$switches = @()
-$envVars = @{
- # For locally installed dotnet, skip first time experience which takes a long time
- 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' = 'true';
-}
-
-if ($InstallLocality -eq 'machine') {
- if ($IsMacOS -or $IsLinux) {
- $DotNetInstallDir = '/usr/share/dotnet'
- } else {
- $restartRequired = $false
- $sdks |% {
- if ($_.Version) { $version = $_.Version } else { $version = $_.Channel }
- if ($PSCmdlet.ShouldProcess(".NET SDK $_", "Install")) {
- Install-DotNet -Version $version -Architecture $arch
- $restartRequired = $restartRequired -or ($LASTEXITCODE -eq 3010)
-
- if ($IncludeX86) {
- Install-DotNet -Version $version -Architecture x86
- $restartRequired = $restartRequired -or ($LASTEXITCODE -eq 3010)
- }
- }
- }
-
- $runtimeVersions | Sort-Object | Get-Unique |% {
- if ($PSCmdlet.ShouldProcess(".NET runtime $_", "Install")) {
- Install-DotNet -Version $_ -sku Runtime -Architecture $arch
- $restartRequired = $restartRequired -or ($LASTEXITCODE -eq 3010)
-
- if ($IncludeX86) {
- Install-DotNet -Version $_ -sku Runtime -Architecture x86
- $restartRequired = $restartRequired -or ($LASTEXITCODE -eq 3010)
- }
- }
- }
-
- $windowsDesktopRuntimeVersions | Sort-Object | Get-Unique |% {
- if ($PSCmdlet.ShouldProcess(".NET Windows Desktop $_", "Install")) {
- Install-DotNet -Version $_ -sku WindowsDesktop -Architecture $arch
- $restartRequired = $restartRequired -or ($LASTEXITCODE -eq 3010)
-
- if ($IncludeX86) {
- Install-DotNet -Version $_ -sku WindowsDesktop -Architecture x86
- $restartRequired = $restartRequired -or ($LASTEXITCODE -eq 3010)
- }
- }
- }
-
- $aspnetRuntimeVersions | Sort-Object | Get-Unique |% {
- if ($PSCmdlet.ShouldProcess("ASP.NET Core $_", "Install")) {
- Install-DotNet -Version $_ -sku AspNetCore -Architecture $arch
- $restartRequired = $restartRequired -or ($LASTEXITCODE -eq 3010)
-
- if ($IncludeX86) {
- Install-DotNet -Version $_ -sku AspNetCore -Architecture x86
- $restartRequired = $restartRequired -or ($LASTEXITCODE -eq 3010)
- }
- }
- }
- if ($restartRequired) {
- Write-Host -ForegroundColor Yellow "System restart required"
- Exit 3010
- }
-
- return
- }
-} elseif ($InstallLocality -eq 'repo') {
- $DotNetInstallDir = "$DotNetInstallScriptRoot/.dotnet"
- $DotNetX86InstallDir = "$DotNetInstallScriptRoot/x86/.dotnet"
-} elseif ($env:AGENT_TOOLSDIRECTORY) {
- $DotNetInstallDir = "$env:AGENT_TOOLSDIRECTORY/dotnet"
- $DotNetX86InstallDir = "$env:AGENT_TOOLSDIRECTORY/x86/dotnet"
-} else {
- $DotNetInstallDir = Join-Path $HOME .dotnet
-}
-
-if ($DotNetInstallDir) {
- if (!(Test-Path $DotNetInstallDir)) { New-Item -ItemType Directory -Path $DotNetInstallDir }
- $DotNetInstallDir = Resolve-Path $DotNetInstallDir
- Write-Host "Installing .NET SDK and runtimes to $DotNetInstallDir" -ForegroundColor Blue
- $envVars['DOTNET_MULTILEVEL_LOOKUP'] = '0'
- $envVars['DOTNET_ROOT'] = $DotNetInstallDir
-}
-
-if ($IncludeX86) {
- if ($DotNetX86InstallDir) {
- if (!(Test-Path $DotNetX86InstallDir)) { New-Item -ItemType Directory -Path $DotNetX86InstallDir }
- $DotNetX86InstallDir = Resolve-Path $DotNetX86InstallDir
- Write-Host "Installing x86 .NET SDK and runtimes to $DotNetX86InstallDir" -ForegroundColor Blue
- } else {
- # Only machine-wide or repo-wide installations can handle two unique dotnet.exe architectures.
- Write-Error "The installation location or OS isn't supported for x86 installation. Try a different -InstallLocality value."
- return 1
- }
-}
-
-if ($IsMacOS -or $IsLinux) {
- $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/0b09de9bc136cacb5f849a6957ebd4062173c148/src/dotnet-install.sh"
- $DotNetInstallScriptPath = "$DotNetInstallScriptRoot/dotnet-install.sh"
-} else {
- $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/0b09de9bc136cacb5f849a6957ebd4062173c148/src/dotnet-install.ps1"
- $DotNetInstallScriptPath = "$DotNetInstallScriptRoot/dotnet-install.ps1"
-}
-
-if (-not (Test-Path $DotNetInstallScriptPath)) {
- Invoke-WebRequest -Uri $DownloadUri -OutFile $DotNetInstallScriptPath -UseBasicParsing
- if ($IsMacOS -or $IsLinux) {
- chmod +x $DotNetInstallScriptPath
- }
-}
-
-# In case the script we invoke is in a directory with spaces, wrap it with single quotes.
-# In case the path includes single quotes, escape them.
-$DotNetInstallScriptPathExpression = $DotNetInstallScriptPath.Replace("'", "''")
-$DotNetInstallScriptPathExpression = "& '$DotNetInstallScriptPathExpression'"
-
-$anythingInstalled = $false
-$global:LASTEXITCODE = 0
-
-$sdks |% {
- if ($_.Version) { $parameters = '-Version', $_.Version } else { $parameters = '-Channel', $_.Channel }
-
- if ($PSCmdlet.ShouldProcess(".NET SDK $_", "Install")) {
- $anythingInstalled = $true
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression $parameters -Architecture $arch -InstallDir $DotNetInstallDir $switches"
-
- if ($LASTEXITCODE -ne 0) {
- Write-Error ".NET SDK installation failure: $LASTEXITCODE"
- exit $LASTEXITCODE
- }
- } else {
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression $parameters -Architecture $arch -InstallDir $DotNetInstallDir $switches -DryRun"
- }
-
- if ($IncludeX86) {
- if ($PSCmdlet.ShouldProcess(".NET x86 SDK $_", "Install")) {
- $anythingInstalled = $true
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression $parameters -Architecture x86 -InstallDir $DotNetX86InstallDir $switches"
-
- if ($LASTEXITCODE -ne 0) {
- Write-Error ".NET x86 SDK installation failure: $LASTEXITCODE"
- exit $LASTEXITCODE
- }
- } else {
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression $parameters -Architecture x86 -InstallDir $DotNetX86InstallDir $switches -DryRun"
- }
- }
-}
-
-$dotnetRuntimeSwitches = $switches + '-Runtime','dotnet'
-
-$runtimeVersions | Sort-Object -Unique |% {
- if ($PSCmdlet.ShouldProcess(".NET $Arch runtime $_", "Install")) {
- $anythingInstalled = $true
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture $arch -InstallDir $DotNetInstallDir $dotnetRuntimeSwitches"
-
- if ($LASTEXITCODE -ne 0) {
- Write-Error ".NET SDK installation failure: $LASTEXITCODE"
- exit $LASTEXITCODE
- }
- } else {
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture $arch -InstallDir $DotNetInstallDir $dotnetRuntimeSwitches -DryRun"
- }
-
- if ($IncludeX86) {
- if ($PSCmdlet.ShouldProcess(".NET x86 runtime $_", "Install")) {
- $anythingInstalled = $true
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture x86 -InstallDir $DotNetX86InstallDir $dotnetRuntimeSwitches"
-
- if ($LASTEXITCODE -ne 0) {
- Write-Error ".NET SDK installation failure: $LASTEXITCODE"
- exit $LASTEXITCODE
- }
- } else {
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture x86 -InstallDir $DotNetX86InstallDir $dotnetRuntimeSwitches -DryRun"
- }
- }
-}
-
-$windowsDesktopRuntimeSwitches = $switches + '-Runtime','windowsdesktop'
-
-$windowsDesktopRuntimeVersions | Sort-Object -Unique |% {
- if ($PSCmdlet.ShouldProcess(".NET WindowsDesktop $arch runtime $_", "Install")) {
- $anythingInstalled = $true
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture $arch -InstallDir $DotNetInstallDir $windowsDesktopRuntimeSwitches"
-
- if ($LASTEXITCODE -ne 0) {
- Write-Error ".NET SDK installation failure: $LASTEXITCODE"
- exit $LASTEXITCODE
- }
- } else {
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture $arch -InstallDir $DotNetInstallDir $windowsDesktopRuntimeSwitches -DryRun"
- }
-
- if ($IncludeX86) {
- if ($PSCmdlet.ShouldProcess(".NET WindowsDesktop x86 runtime $_", "Install")) {
- $anythingInstalled = $true
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture x86 -InstallDir $DotNetX86InstallDir $windowsDesktopRuntimeSwitches"
-
- if ($LASTEXITCODE -ne 0) {
- Write-Error ".NET SDK installation failure: $LASTEXITCODE"
- exit $LASTEXITCODE
- }
- } else {
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture x86 -InstallDir $DotNetX86InstallDir $windowsDesktopRuntimeSwitches -DryRun"
- }
- }
-}
-
-$aspnetRuntimeSwitches = $switches + '-Runtime','aspnetcore'
-
-$aspnetRuntimeVersions | Sort-Object -Unique |% {
- if ($PSCmdlet.ShouldProcess(".NET ASP.NET Core $arch runtime $_", "Install")) {
- $anythingInstalled = $true
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture $arch -InstallDir $DotNetInstallDir $aspnetRuntimeSwitches"
-
- if ($LASTEXITCODE -ne 0) {
- Write-Error ".NET SDK installation failure: $LASTEXITCODE"
- exit $LASTEXITCODE
- }
- } else {
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture $arch -InstallDir $DotNetInstallDir $aspnetRuntimeSwitches -DryRun"
- }
-
- if ($IncludeX86) {
- if ($PSCmdlet.ShouldProcess(".NET ASP.NET Core x86 runtime $_", "Install")) {
- $anythingInstalled = $true
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture x86 -InstallDir $DotNetX86InstallDir $aspnetRuntimeSwitches"
-
- if ($LASTEXITCODE -ne 0) {
- Write-Error ".NET SDK installation failure: $LASTEXITCODE"
- exit $LASTEXITCODE
- }
- } else {
- Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture x86 -InstallDir $DotNetX86InstallDir $aspnetRuntimeSwitches -DryRun"
- }
- }
-}
-
-if ($PSCmdlet.ShouldProcess("Set DOTNET environment variables to discover these installed runtimes?")) {
- & "$PSScriptRoot/Set-EnvVars.ps1" -Variables $envVars -PrependPath $DotNetInstallDir | Out-Null
-}
-
-if ($anythingInstalled -and ($InstallLocality -ne 'machine') -and !$env:TF_BUILD -and !$env:GITHUB_ACTIONS) {
- Write-Warning ".NET runtimes or SDKs were installed to a non-machine location. Perform your builds or open Visual Studio from this same environment in order for tools to discover the location of these dependencies."
-}
diff --git a/tools/Install-NuGetCredProvider.ps1 b/tools/Install-NuGetCredProvider.ps1
deleted file mode 100755
index 8153eb0b..00000000
--- a/tools/Install-NuGetCredProvider.ps1
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/env pwsh
-
-<#
-.SYNOPSIS
- Downloads and installs the Microsoft Artifacts Credential Provider
- from https://github.com/microsoft/artifacts-credprovider
- to assist in authenticating to Azure Artifact feeds in interactive development
- or unattended build agents.
-.PARAMETER Force
- Forces install of the CredProvider plugin even if one already exists. This is useful to upgrade an older version.
-.PARAMETER AccessToken
- An optional access token for authenticating to Azure Artifacts authenticated feeds.
-#>
-[CmdletBinding()]
-Param (
- [Parameter()]
- [switch]$Force,
- [Parameter()]
- [string]$AccessToken
-)
-
-$envVars = @{}
-
-$toolsPath = & "$PSScriptRoot\Get-TempToolsPath.ps1"
-
-if ($IsMacOS -or $IsLinux) {
- $installerScript = "installcredprovider.sh"
- $sourceUrl = "https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh"
-} else {
- $installerScript = "installcredprovider.ps1"
- $sourceUrl = "https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1"
-}
-
-$installerScript = Join-Path $toolsPath $installerScript
-
-if (!(Test-Path $installerScript) -or $Force) {
- Invoke-WebRequest $sourceUrl -OutFile $installerScript
-}
-
-$installerScript = (Resolve-Path $installerScript).Path
-
-if ($IsMacOS -or $IsLinux) {
- chmod u+x $installerScript
-}
-
-& $installerScript -Force:$Force -AddNetfx -InstallNet8
-
-if ($AccessToken) {
- $endpoints = @()
-
- $endpointURIs = @()
- Get-Item "$PSScriptRoot\..\azure-pipelines\nuget.config" |% {
- $nugetConfig = [xml](Get-Content -LiteralPath $_)
-
- $nugetConfig.configuration.packageSources.add |? { ($_.value -match '^https://pkgs\.dev\.azure\.com/') -or ($_.value -match '^https://[\w\-]+\.pkgs\.visualstudio\.com/') } |% {
- if ($endpointURIs -notcontains $_.Value) {
- $endpointURIs += $_.Value
- $endpoint = New-Object -TypeName PSObject
- Add-Member -InputObject $endpoint -MemberType NoteProperty -Name endpoint -Value $_.value
- Add-Member -InputObject $endpoint -MemberType NoteProperty -Name username -Value ado
- Add-Member -InputObject $endpoint -MemberType NoteProperty -Name password -Value $AccessToken
- $endpoints += $endpoint
- }
- }
- }
-
- $auth = New-Object -TypeName PSObject
- Add-Member -InputObject $auth -MemberType NoteProperty -Name endpointCredentials -Value $endpoints
-
- $authJson = ConvertTo-Json -InputObject $auth
- $envVars += @{
- 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS'=$authJson;
- }
-}
-
-& "$PSScriptRoot/Set-EnvVars.ps1" -Variables $envVars | Out-Null
diff --git a/tools/Install-NuGetPackage.ps1 b/tools/Install-NuGetPackage.ps1
deleted file mode 100644
index 3c11b0f6..00000000
--- a/tools/Install-NuGetPackage.ps1
+++ /dev/null
@@ -1,63 +0,0 @@
-<#
-.SYNOPSIS
- Installs a NuGet package.
-.PARAMETER PackageID
- The Package ID to install.
-.PARAMETER Version
- The version of the package to install. If unspecified, the latest stable release is installed.
-.PARAMETER Source
- The package source feed to find the package to install from.
-.PARAMETER Prerelease
- Include prerelease packages when searching for the latest version.
-.PARAMETER ExcludeVersion
- Installs the package without adding the version to the folder name.
-.PARAMETER DirectDownload
- Bypass the local cache when downloading packages.
-.PARAMETER PackagesDir
- The directory to install the package to. By default, it uses the Packages folder at the root of the repo.
-.PARAMETER ConfigFile
- The nuget.config file to use. By default, it uses :/nuget.config.
-.OUTPUTS
- System.String. The path to the installed package.
-#>
-[CmdletBinding(SupportsShouldProcess=$true,ConfirmImpact='Low')]
-Param(
- [Parameter(Position=1,Mandatory=$true)]
- [string]$PackageId,
- [Parameter()]
- [string]$Version,
- [Parameter()]
- [string]$Source,
- [Parameter()]
- [switch]$Prerelease,
- [Parameter()]
- [switch]$ExcludeVersion,
- [Parameter()]
- [switch]$DirectDownload,
- [Parameter()]
- [string]$PackagesDir="$PSScriptRoot\..\packages",
- [Parameter()]
- [string]$ConfigFile="$PSScriptRoot\..\nuget.config",
- [Parameter()]
- [ValidateSet('Quiet','Normal','Detailed')]
- [string]$Verbosity='normal'
-)
-
-$nugetPath = & "$PSScriptRoot\Get-NuGetTool.ps1"
-
-Write-Verbose "Installing $PackageId..."
-$nugetArgs = "Install",$PackageId,"-OutputDirectory",$PackagesDir,'-ConfigFile',$ConfigFile
-if ($Version) { $nugetArgs += "-Version",$Version }
-if ($Source) { $nugetArgs += "-FallbackSource",$Source }
-if ($Prerelease) { $nugetArgs += "-Prerelease" }
-if ($ExcludeVersion) { $nugetArgs += '-ExcludeVersion' }
-if ($DirectDownload) { $nugetArgs += '-DirectDownload' }
-$nugetArgs += '-Verbosity',$Verbosity
-
-if ($PSCmdlet.ShouldProcess($PackageId, 'nuget install')) {
- $p = Start-Process $nugetPath $nugetArgs -NoNewWindow -Wait -PassThru
- if ($null -ne $p.ExitCode -and $p.ExitCode -ne 0) { throw }
-}
-
-# Provide the path to the installed package directory to our caller.
-Write-Output (Get-ChildItem "$PackagesDir\$PackageId.*")[0].FullName
diff --git a/tools/Set-EnvVars.ps1 b/tools/Set-EnvVars.ps1
deleted file mode 100644
index 2bd3ca4d..00000000
--- a/tools/Set-EnvVars.ps1
+++ /dev/null
@@ -1,97 +0,0 @@
-<#
-.SYNOPSIS
- Set environment variables in the environment.
- Azure Pipeline and CMD environments are considered.
-.PARAMETER Variables
- A hashtable of variables to be set.
-.PARAMETER PrependPath
- A set of paths to prepend to the PATH environment variable.
-.OUTPUTS
- A boolean indicating whether the environment variables can be expected to propagate to the caller's environment.
-.DESCRIPTION
- The CmdEnvScriptPath environment variable may be optionally set to a path to a cmd shell script to be created (or appended to if it already exists) that will set the environment variables in cmd.exe that are set within the PowerShell environment.
- This is used by init.cmd in order to reapply any new environment variables to the parent cmd.exe process that were set in the powershell child process.
-#>
-[CmdletBinding(SupportsShouldProcess=$true)]
-Param(
- [Parameter(Mandatory=$true, Position=1)]
- $Variables,
- [string[]]$PrependPath
-)
-
-if ($Variables.Count -eq 0) {
- return $true
-}
-
-$cmdInstructions = !$env:TF_BUILD -and !$env:GITHUB_ACTIONS -and !$env:CmdEnvScriptPath -and ($env:PS1UnderCmd -eq '1')
-if ($cmdInstructions) {
- Write-Warning "Environment variables have been set that will be lost because you're running under cmd.exe"
- Write-Host "Environment variables that must be set manually:" -ForegroundColor Blue
-} else {
- Write-Host "Environment variables set:" -ForegroundColor Blue
- Write-Host ($Variables | Out-String)
- if ($PrependPath) {
- Write-Host "Paths prepended to PATH: $PrependPath"
- }
-}
-
-if ($env:TF_BUILD) {
- Write-Host "Azure Pipelines detected. Logging commands will be used to propagate environment variables and prepend path."
-}
-
-if ($env:GITHUB_ACTIONS) {
- Write-Host "GitHub Actions detected. Logging commands will be used to propagate environment variables and prepend path."
-}
-
-$CmdEnvScript = ''
-$Variables.GetEnumerator() |% {
- Set-Item -LiteralPath env:$($_.Key) -Value $_.Value
-
- # If we're running in a cloud CI, set these environment variables so they propagate.
- if ($env:TF_BUILD) {
- Write-Host "##vso[task.setvariable variable=$($_.Key);]$($_.Value)"
- }
- if ($env:GITHUB_ACTIONS) {
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "$($_.Key)=$($_.Value)"
- }
-
- if ($cmdInstructions) {
- Write-Host "SET $($_.Key)=$($_.Value)"
- }
-
- $CmdEnvScript += "SET $($_.Key)=$($_.Value)`r`n"
-}
-
-$pathDelimiter = ';'
-if ($IsMacOS -or $IsLinux) {
- $pathDelimiter = ':'
-}
-
-if ($PrependPath) {
- $PrependPath |% {
- $newPathValue = "$_$pathDelimiter$env:PATH"
- Set-Item -LiteralPath env:PATH -Value $newPathValue
- if ($cmdInstructions) {
- Write-Host "SET PATH=$newPathValue"
- }
-
- if ($env:TF_BUILD) {
- Write-Host "##vso[task.prependpath]$_"
- }
- if ($env:GITHUB_ACTIONS) {
- Add-Content -LiteralPath $env:GITHUB_PATH -Value $_
- }
-
- $CmdEnvScript += "SET PATH=$_$pathDelimiter%PATH%"
- }
-}
-
-if ($env:CmdEnvScriptPath) {
- if (Test-Path $env:CmdEnvScriptPath) {
- $CmdEnvScript = (Get-Content -LiteralPath $env:CmdEnvScriptPath) + $CmdEnvScript
- }
-
- Set-Content -LiteralPath $env:CmdEnvScriptPath -Value $CmdEnvScript
-}
-
-return !$cmdInstructions
From 2eb0cffc497281f44d391b9ddda011dcc8256857 Mon Sep 17 00:00:00 2001
From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Date: Tue, 13 Oct 2026 01:45:32 +0900
Subject: [PATCH 3/5] Delete unused files
---
.prettierrc.yaml | 0
COPYRIGHT | 2 --
CodeQL.yml | 3 ---
SUPPORT.md | 13 -------------
4 files changed, 18 deletions(-)
delete mode 100644 .prettierrc.yaml
delete mode 100644 COPYRIGHT
delete mode 100644 CodeQL.yml
delete mode 100644 SUPPORT.md
diff --git a/.prettierrc.yaml b/.prettierrc.yaml
deleted file mode 100644
index e69de29b..00000000
diff --git a/COPYRIGHT b/COPYRIGHT
deleted file mode 100644
index 85b364bd..00000000
--- a/COPYRIGHT
+++ /dev/null
@@ -1,2 +0,0 @@
-Copyright (c) Microsoft Corporation. All rights reserved.
-Licensed under the MIT license. See LICENSE file in the project root for full license information.
diff --git a/CodeQL.yml b/CodeQL.yml
deleted file mode 100644
index 903500b5..00000000
--- a/CodeQL.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-path_classifiers:
- library:
- - 'test/**'
diff --git a/SUPPORT.md b/SUPPORT.md
deleted file mode 100644
index 84d8d36d..00000000
--- a/SUPPORT.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Support
-
-## How to file issues and get help
-
-This project uses GitHub Issues to track bugs and feature requests.
-Please search the existing issues before filing new issues to avoid duplicates.
-For new issues, file your bug or feature request as a new Issue.
-
-For help and questions about using this project, please file a GitHub issue.
-
-## Microsoft Support Policy
-
-Support for this C# projection generator is limited to the resources listed above.
From 909b46588c55ccc92c8fd8d073ad04be44856c89 Mon Sep 17 00:00:00 2001
From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Date: Sun, 18 Oct 2026 00:22:08 +0900
Subject: [PATCH 4/5] Remove obsolete Azure pipeline workflows
---
CONTRIBUTING.md | 2 +-
azure-pipelines/Archive-SourceCode.ps1 | 234 ---------------
azure-pipelines/Get-InsertionPRId.ps1 | 26 --
azure-pipelines/OptProf.yml | 121 --------
azure-pipelines/OptProf_part2.yml | 91 ------
azure-pipelines/PostPRMessage.ps1 | 57 ----
azure-pipelines/archive-sourcecode.yml | 94 ------
azure-pipelines/build.yml | 267 ++++++++----------
azure-pipelines/dotnet.yml | 14 +-
azure-pipelines/microbuild.after.yml | 21 --
azure-pipelines/microbuild.before.yml | 34 +--
azure-pipelines/official.yml | 5 -
azure-pipelines/unofficial.yml | 5 -
azure-pipelines/vs-validation.yml | 123 --------
src/OptProf.targets | 17 --
.../Library.VSInsertionMetadata.proj | 11 -
src/VSInsertionMetadata/ProfilingInputs.props | 5 -
.../VSInsertionMetadata.targets | 71 -----
tools/artifacts/VSInsertion.ps1 | 7 +-
tools/variables/BusinessGroupName.ps1 | 1 -
tools/variables/ProfilingInputsDropName.ps1 | 5 -
21 files changed, 118 insertions(+), 1093 deletions(-)
delete mode 100644 azure-pipelines/Archive-SourceCode.ps1
delete mode 100644 azure-pipelines/Get-InsertionPRId.ps1
delete mode 100644 azure-pipelines/OptProf.yml
delete mode 100644 azure-pipelines/OptProf_part2.yml
delete mode 100644 azure-pipelines/PostPRMessage.ps1
delete mode 100644 azure-pipelines/archive-sourcecode.yml
delete mode 100644 azure-pipelines/vs-validation.yml
delete mode 100644 src/OptProf.targets
delete mode 100644 src/VSInsertionMetadata/Library.VSInsertionMetadata.proj
delete mode 100644 src/VSInsertionMetadata/ProfilingInputs.props
delete mode 100644 src/VSInsertionMetadata/VSInsertionMetadata.targets
delete mode 100644 tools/variables/BusinessGroupName.ps1
delete mode 100644 tools/variables/ProfilingInputsDropName.ps1
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7624fcac..a24380f1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -31,7 +31,7 @@ Microsoft's Azure Pipelines retain the 1ESPT/MicroBuild toolset, signing, SBOM g
Azure Pipelines install the SDKs and runtimes declared in the repository's `global.json` files using `UseDotNet@2`, authenticate with `NuGetAuthenticate@1`, and run `dotnet restore` and `dotnet tool restore` directly. Windows jobs also configure ProcDump for test crash dumps. The symbol/coverage job skips project restore while still restoring its CLI tools. Signing, SBOM, and other MicroBuild plugins remain managed by 1ESPT and the existing MicroBuild tasks.
-For an unsigned local build that intentionally uses the MicroBuild configuration, pass `-p:EnableMicroBuild=true` when restoring and building. Reproducing an official signed build also requires Microsoft's signing infrastructure; use the official pipelines for that. CLI tools for documentation, coverage, release versioning, and source archival can be restored separately with `dotnet tool restore`. These tools are not needed for an ordinary solution build.
+For an unsigned local build that intentionally uses the MicroBuild configuration, pass `-p:EnableMicroBuild=true` when restoring and building. Reproducing an official signed build also requires Microsoft's signing infrastructure; use the official pipelines for that. CLI tools for documentation, coverage, and release versioning can be restored separately with `dotnet tool restore`. These tools are not needed for an ordinary solution build.
## Parsing the metadata
diff --git a/azure-pipelines/Archive-SourceCode.ps1 b/azure-pipelines/Archive-SourceCode.ps1
deleted file mode 100644
index 0360a14f..00000000
--- a/azure-pipelines/Archive-SourceCode.ps1
+++ /dev/null
@@ -1,234 +0,0 @@
-#Requires -PSEdition Core -Version 7
-<#
-.SYNOPSIS
- Submits a source archival request for this repo.
-.PARAMETER Requester
- The alias for the user requesting this backup.
-.PARAMETER ManagerAlias
- The alias of the manager that owns the repo.
-.PARAMETER TeamAlias
- The alias of the team that owns the repo.
-.PARAMETER BusinessGroupName
- A human-readable title for your team or business group.
-.PARAMETER ProductionType
-.PARAMETER ReleaseType
- The type of release being backed up.
-.PARAMETER ReleaseDate
- The date of the release of your software. Defaults to today.
-.PARAMETER OwnerAlias
- The alias of the owner.
-.PARAMETER OS
-.PARAMETER ProductLanguage
- One or more languages.
-.PARAMETER Notes
- Any notes to record with the backup.
-.PARAMETER FileCollection
- One or more collections to archive.
-.PARAMETER ProductName
- The name of the product. This will default to the repository name.
-.PARAMETER RepoUrl
- The URL to the repository. This will default to the repository containing this script.
-.PARAMETER BackupType
- The kind of backup to be performed.
-.PARAMETER ServerPath
- The UNC path to the server to be backed up (if applicable).
-.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://dpsopsrequestforms.azurewebsites.net/#/help -> SCA Request Help -> SCA API Help -> Description
-#>
-[CmdletBinding(SupportsShouldProcess = $true, PositionalBinding = $false)]
-param (
- [Parameter()]
- [string]$Requester,
- [Parameter(Mandatory = $true)]
- [string]$ManagerAlias,
- [Parameter(Mandatory = $true)]
- [string]$TeamAlias,
- [Parameter(Mandatory = $true)]
- [string]$BusinessGroupName,
- [Parameter()]
- [string]$ProductionType = 'Visual Studio',
- [Parameter()]
- [string]$ReleaseType = 'RTW',
- [Parameter()]
- [DateTime]$ReleaseDate = [DateTime]::Today,
- [Parameter()]
- [string]$OwnerAlias,
- [Parameter()]
- [ValidateSet('64-Bit Win', '32-Bit Win', 'Linux', 'Mac', '64-Bit ARM', '32-Bit ARM')]
- [string[]]$OS = @('64-Bit Win'),
- [Parameter(Mandatory = $true)]
- [ValidateSet('English', 'Chinese Simplified', 'Chinese Traditional', 'Czech', 'French', 'German', 'Italian', 'Japanese', 'Korean', 'Polish', 'Portuguese', 'Russian', 'Spanish', 'Turkish')]
- [string[]]$ProductLanguage,
- [Parameter()]
- [string]$Notes = '',
- [Parameter()]
- [ValidateSet('Binaries', 'Localization', 'Source Code')]
- [string[]]$FileCollection = @('Source Code'),
- [Parameter()]
- [string]$ProductName,
- [Parameter()]
- [Uri]$RepoUrl,
- [Parameter()]
- [ValidateSet('Server Path', 'Code Repo(Git URL/AzureDevOps)', 'Git', 'Azure Storage Account')]
- [string]$BackupType = 'Code Repo(Git URL/AzureDevOps)',
- [Parameter()]
- [string]$ServerPath = '',
- [Parameter()]
- [Uri]$SourceCodeArchivalUri = $env:SOURCECODEARCHIVALURI,
- [Parameter(Mandatory = $true)]
- [string]$AccessToken
-)
-
-function Invoke-Git() {
- # Make sure we invoke git from within the repo.
- Push-Location $PSScriptRoot
- try {
- return (git $args)
- }
- finally {
- Pop-Location
- }
-}
-
-if (!$ProductName) {
- if ($env:BUILD_REPOSITORY_NAME) {
- Write-Verbose 'Using $env:BUILD_REPOSITORY_NAME for ProductName.' # single quotes are intentional so user sees the name of env var.
- $ProductName = $env:BUILD_REPOSITORY_NAME
- }
- else {
- $originUrl = [Uri](Invoke-Git remote get-url origin)
- if ($originUrl) {
- $lastPathSegment = $originUrl.Segments[$originUrl.Segments.Length - 1]
- if ($lastPathSegment.EndsWith('.git')) {
- $lastPathSegment = $lastPathSegment.Substring(0, $lastPathSegment.Length - '.git'.Length)
- }
- Write-Verbose 'Using origin remote URL to derive ProductName.'
- $ProductName = $lastPathSegment
- }
- }
-
- if (!$ProductName) {
- Write-Error "Unable to determine default value for -ProductName."
- }
-}
-
-if (!$OwnerAlias) {
- if ($env:BUILD_REQUESTEDFOREMAIL) {
- Write-Verbose 'Using $env:BUILD_REQUESTEDFOREMAIL and slicing to just the alias for OwnerAlias.'
- $OwnerAlias = ($env:BUILD_REQUESTEDFOREMAIL -split '@')[0]
- } else {
- $OwnerAlias = $TeamAlias
- }
-
- if (!$OwnerAlias) {
- Write-Error "Unable to determine default value for -OwnerAlias."
- }
-}
-
-if (!$Requester) {
- if ($env:BUILD_REQUESTEDFOREMAIL) {
- Write-Verbose 'Using $env:BUILD_REQUESTEDFOREMAIL and slicing to just the alias for Requester.'
- $Requester = ($env:BUILD_REQUESTEDFOREMAIL -split '@')[0]
- }
- else {
- Write-Verbose 'Using $env:USERNAME for Requester.'
- $Requester = $env:USERNAME
- }
- if (!$Requester) {
- $Requester = $OwnerAlias
- }
-}
-
-if (!$RepoUrl) {
- $RepoUrl = $env:BUILD_REPOSITORY_URI
- if (!$RepoUrl) {
- $originUrl = [Uri](Invoke-Git remote get-url origin)
- if ($originUrl) {
- Write-Verbose 'Using git origin remote url for GitURL.'
- $RepoUrl = $originUrl
- }
-
- if (!$RepoUrl) {
- Write-Error "Unable to determine default value for -RepoUrl."
- }
- }
-}
-
-Push-Location $PSScriptRoot
-$versionsObj = dotnet nbgv get-version -f json | ConvertFrom-Json
-Pop-Location
-
-$ReleaseDateString = $ReleaseDate.ToShortDateString()
-$Version = $versionsObj.Version
-
-$BackupSize = Get-ChildItem $PSScriptRoot\..\.git -Recurse -File | Measure-Object -Property Length -Sum
-$DataSizeMB = [int]($BackupSize.Sum / 1mb)
-$FileCount = $BackupSize.Count
-
-$Request = @{
- "Requester" = $Requester
- "Manager" = $ManagerAlias
- "TeamAlias" = $TeamAlias
- "AdditionalContacts" = $AdditionalContacts
- "BusinessGroupName" = $BusinessGroupName
- "ProductName" = $ProductName
- "Version" = $Version
- "ProductionType" = $ProductionType
- "ReleaseType" = $ReleaseType
- "ReleaseDateString" = $ReleaseDateString
- "OS" = [string]::Join(',', $OS)
- "ProductLanguage" = [string]::Join(',', $ProductLanguage)
- "FileCollection" = [string]::Join(',', $FileCollection)
- "OwnerAlias" = $OwnerAlias
- "Notes" = $Notes.Trim()
- "CustomerProvidedDataSizeMB" = $DataSizeMB
- "CustomerProvidedFileCount" = $FileCount
- "BackupType" = $BackupType
- "ServerPath" = $ServerPath
- "AzureStorageAccount" = $AzureStorageAccount
- "AzureStorageContainer" = $AzureStorageContainer
- "GitURL" = $RepoUrl
-}
-
-$RequestJson = ConvertTo-Json $Request
-Write-Host "SCA request:`n$RequestJson"
-
-if ($PSCmdlet.ShouldProcess('source archival request', 'post')) {
- if (!$SourceCodeArchivalUri) {
- Write-Error "Unable to post request without -SourceCodeArchivalUri parameter."
- exit 1
- }
-
- $headers = @{
- 'Authorization' = "Bearer $AccessToken"
- }
-
- [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
-
- $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
- Write-Host "Ticket ID : " -NoNewline
- $responseContent = ConvertFrom-Json ($Response.Content)
- Write-Host $responseContent
- }
- else {
- Write-Host $Response.StatusCode -ForegroundColor Red
- try {
- $responseContent = ConvertFrom-Json $Response.Content
- Write-Host "Message : $($responseContent.message)"
- }
- catch {
- Write-Host "JSON Parse Error: $($_.Exception.Message)"
- Write-Host "Raw response content:"
- Write-Host $Response.Content
- }
-
- exit 2
- }
-} elseif ($SourceCodeArchivalUri) {
- Write-Host "Would have posted to $SourceCodeArchivalUri"
-}
diff --git a/azure-pipelines/Get-InsertionPRId.ps1 b/azure-pipelines/Get-InsertionPRId.ps1
deleted file mode 100644
index 62cb30cd..00000000
--- a/azure-pipelines/Get-InsertionPRId.ps1
+++ /dev/null
@@ -1,26 +0,0 @@
-<#
-.SYNOPSIS
- Look up the pull request URL of the insertion PR.
-#>
-$stagingFolder = $env:BUILD_STAGINGDIRECTORY
-if (!$stagingFolder) {
- $stagingFolder = $env:SYSTEM_DEFAULTWORKINGDIRECTORY
- if (!$stagingFolder) {
- Write-Error "This script must be run in an Azure Pipeline."
- exit 1
- }
-}
-$markdownFolder = Join-Path $stagingFolder (Join-Path 'MicroBuild' 'Output')
-$markdownFile = Join-Path $markdownFolder 'PullRequestUrl.md'
-if (!(Test-Path $markdownFile)) {
- Write-Error "This script should be run after the MicroBuildInsertVsPayload task."
- exit 2
-}
-
-$insertionPRUrl = Get-Content $markdownFile
-if (!($insertionPRUrl -match 'https:.+?/pullrequest/(\d+)')) {
- Write-Error "Failed to parse pull request URL: $insertionPRUrl"
- exit 3
-}
-
-$Matches[1]
diff --git a/azure-pipelines/OptProf.yml b/azure-pipelines/OptProf.yml
deleted file mode 100644
index 024c2865..00000000
--- a/azure-pipelines/OptProf.yml
+++ /dev/null
@@ -1,121 +0,0 @@
-trigger: none
-pr: none
-schedules:
-- cron: "0 3 * * Fri" # Thu @ 8 or 9 PM Mountain Time (depending on DST)
- displayName: Weekly OptProf run
- branches:
- include:
- - 'v*.*'
- - main
- always: true # we must keep data fresh since optimizationdata drops are purged after 30 days
-
-# Avoid errant CI builds: https://developercommunity.visualstudio.com/content/problem/1154409/azure-pipeline-is-triggering-due-to-events-that-ne.html
-#resources:
-# repositories:
-# - repository: scripts
-# type: git
-# name: DeploymentScripts
-# ref: refs/heads/test
-
-parameters:
- - name: ShouldSkipOptimize
- displayName: Skip OptProf optimization
- type: boolean
- default: false # Should usually be false so that optprof LKG can apply when tests fail, but may need to be set to true in a manually queued pipeline run if all drops have expired.
-
-variables:
-- template: GlobalVariables.yml
-- name: PublicRelease
- value: false # avoid using nice version since we're building a preliminary/unoptimized package
-- name: IsOptProf
- value: true
-- name: MicroBuild_NuPkgSigningEnabled
- value: false # test-signed nuget packages fail to restore in the VS insertion PR validations. Just don't sign them *at all*.
-
-stages:
-- stage: Library
- variables:
- - name: OptProf
- value: true
- - template: BuildStageVariables.yml
- jobs:
- - template: build.yml
- parameters:
- Is1ESPT: false
- RealSign: false
- windowsPool: VSEng-MicroBuildVSStable
- EnableMacOSBuild: false
- ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
- IsOptProf: true
- RunTests: false
- SkipCodesignVerify: true
-- stage: QueueVSBuild
- jobs:
- - job: QueueOptProf
- pool: VSEng-MicroBuildVSStable
- variables:
- InsertPayloadName: LibraryName
- InsertTopicBranch: team/VS-IDE/LibraryName-OptProf-run-$(Build.BuildId)
- steps:
- - checkout: none # We don't need source from our own repo
- clean: true
-
- # Pipeline YAML does not yet support checking out other repos. So we'll do it by hand.
-# - checkout: scripts # We DO need source from the DeploymentScripts repo
-# clean: true
-# path: $(Agent.TempDirectory)/DeploymentScripts
-# fetchDepth: 1
- - script: 'git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" clone https://devdiv.visualstudio.com/DevDiv/_git/DeploymentScripts --depth 1 --branch test "$(Agent.TempDirectory)/DeploymentScripts"'
- displayName: Download DeploymentScripts repo
-
- - task: DownloadBuildArtifacts@0
- displayName: Download insertion artifacts
- inputs:
- artifactName: VSInsertion-Windows
- downloadPath: $(Agent.TempDirectory)
- - task: DownloadBuildArtifacts@0
- displayName: Download variables artifacts
- inputs:
- artifactName: Variables-Windows
- downloadPath: $(Agent.TempDirectory)
- - task: PowerShell@2
- displayName: Set pipeline variables based on artifacts
- inputs:
- targetType: filePath
- filePath: $(Agent.TempDirectory)/Variables-Windows/_define.ps1
- - task: NuGetCommand@2
- displayName: Push VS-repo packages to VS feed
- inputs:
- command: push
- packagesToPush: $(Agent.TempDirectory)/VSInsertion-Windows/*.nupkg
- publishVstsFeed: 97a41293-2972-4f48-8c0e-05493ae82010 # VS feed
- allowPackageConflicts: true
- - task: MicroBuildInsertVsPayload@5
- displayName: Insert VS Payload
- inputs:
- TeamName: $(TeamName)
- TeamEmail: $(TeamEmail)
- SkipCreatePR: true
- CustomScriptExecutionCommand: src\VSSDK\NuGet\AllowUnstablePackages.ps1
- - task: benjhuser.tfs-extensions-build-tasks.trigger-build-task.TriggerBuild@3
- displayName: Trigger a new build of DD-CB-TestSignVS-devCI
- inputs:
- buildDefinition: DD-CB-TestSignVS-devCI
- useSameBranch: false
- branchToUse: $(InsertTopicBranch)
- storeInEnvironmentVariable: true
- queueBuildForUserThatTriggeredBuild: false
- authenticationMethod: OAuth Token
- password: $(System.AccessToken)
- - task: PowerShell@2
- displayName: Associate InsertionOutputs artifacts with CloudBuild
- inputs:
- targetType: filePath
- filePath: $(Agent.TempDirectory)/DeploymentScripts/Scripts/Insertion/WriteArtifact.ps1
- arguments: '-oldBuildID $(Build.BuildId) -newBuildID $(TriggeredBuildIds) -artifactName "InsertionOutputs" -accessToken $(System.AccessToken)'
- - task: PowerShell@2
- displayName: Tag the build with LibraryName-insertion
- inputs:
- targetType: filePath
- filePath: $(Agent.TempDirectory)/DeploymentScripts/Scripts/Insertion/TagBuild.ps1
- arguments: '-buildID $(TriggeredBuildIds) -tagName "LibraryName-insertion" -accessToken $(System.AccessToken)'
diff --git a/azure-pipelines/OptProf_part2.yml b/azure-pipelines/OptProf_part2.yml
deleted file mode 100644
index c59d6999..00000000
--- a/azure-pipelines/OptProf_part2.yml
+++ /dev/null
@@ -1,91 +0,0 @@
-trigger: none
-pr: none
-
-resources:
- pipelines:
- - pipeline: VisualStudioBuildUnderTest
- source: DD-CB-TestSignVS-devCI
- trigger:
- tags:
- - LibraryName-insertion
- - pipeline: DartLab
- source: DartLab
- branch: main
- - pipeline: DartLab.OptProf
- source: DartLab.OptProf
- branch: main
- tags:
- - production
- repositories:
- - repository: DartLabTemplates
- type: git
- name: DartLab.Templates
- ref: refs/heads/main
- - repository: DartLabOptProfTemplates
- type: git
- name: DartLab.OptProf
- ref: refs/tags/Production
-
-parameters:
-
-# The prefix naming of the OptimizationInputs drop
-- name: optimizationDropPrefix
- type: string
- default: OptimizationInputs/$(System.TeamProject)/$(Build.Repository.Name)
-
-stages:
-- template: \templates\stages\visual-studio\single-runsettings.yml@DartLabOptProfTemplates
- parameters:
- ##### Required #####
- runSettingsURI: $(Pipeline.Workspace)\VisualStudioBuildUnderTest\BuildArtifacts\runsettings\LibraryName.OptProf.runsettings
- visualStudioBootstrapperURI: https://vsdrop.corp.microsoft.com/file/v1/$(VisualStudio.BuildUnderTest.ProductsDropName);bootstrappers/Enterprise/vs_enterprise.exe
- ##### Optional #####
- name: OptProfProfilingWorkflow
- displayName: OptProf Profiling Workflow
- optOptimizationInputsDropName: $(OptimizationInputsDropName)
- previousOptimizationInputsDropName: $(PreviousOptimizationInputsDropName)
- testLabPoolName: VS-Platform
- ##### Step Hooks #####
- preTestMachineConfigurationStepList:
- - download: VisualStudioBuildUnderTest
- - task: PowerShell@2
- name: SetProductsDropName
- displayName: Set 'VisualStudio.BuildUnderTest.ProductsDropName'
- inputs:
- filePath: $(DartLab.Path)\Scripts\VisualStudio\Build\Get-VisualStudioDropName.ps1
- arguments: -DropNamePrefix 'Products' -VstsDropUrlsJson '$(Pipeline.Workspace)\VisualStudioBuildUnderTest\BuildArtifacts\VstsDropUrls.json' -OutVariableName 'VisualStudio.BuildUnderTest.ProductsDropName'
- preDeployAndRunTestsStepList:
- - download: VisualStudioBuildUnderTest
- prePublishOptimizationInputsDropStepList:
- # Set parameter for PreviousOptimizationInputsDropName, MicroBuildCommitID, and OptimizationInputsDropName
- - powershell: |
- try {
- $artifactName = 'InsertionOutputs'
- $BuildID = $(resources.pipeline.VisualStudioBuildUnderTest.runID)
- $artifact = Get-BuildArtifact -InstanceURL 'https://dev.azure.com/devdiv' -ProjectName 'DevDiv' -BuildID $BuildID -ArtifactName $artifactName -OAuthAccessToken (ConvertTo-SecureString '$(System.AccessToken)' -AsPlainText -Force)
- $containerName = $artifact.Resource.Data -Split '/' | Select-Object -Last 1
- $fileName = Join-Path $containerName 'Metadata.json'
- $jsonString = Read-BuildArtifactFile -InstanceURL 'https://dev.azure.com/devdiv' -ProjectName 'DevDiv' -BuildID $BuildID -ArtifactName $artifactName -FileName $fileName -OAuthAccessToken (ConvertTo-SecureString '$(System.AccessToken)' -AsPlainText -Force)
- $json = $jsonString | ConvertFrom-Json
-
- Write-Host "The content of the metadata.json file was $json"
-
- $dropname = $json.OptimizationData
- $commitID = $json.CommitID
- $OptimizationInputsDropName = "${{parameters.optimizationDropPrefix}}/$($commitID)/$(Build.BuildId)/$(System.StageId)/$(System.StageAttempt)"
-
- Write-Host "PreviousOptimizationInputsDropName: $dropname"
- Set-AzurePipelinesVariable 'PreviousOptimizationInputsDropName' $dropname
-
- Write-Host "MicroBuildCommitID: $commitID"
- Set-AzurePipelinesVariable 'MicroBuildCommitID' $commitID
-
- Write-Host "OptimizationInputsDropName: $OptimizationInputsDropName"
- Set-AzurePipelinesVariable 'OptimizationInputsDropName' $OptimizationInputsDropName
- }
- catch {
- Write-Host $_
- Write-Error "Failed to set OptimizationInputsDropName pipeline variable"
- throw
- }
- displayName: Set MicroBuildCommitID, PreviousOptimizationInputsDropName, and OptimizationInputsDropName
diff --git a/azure-pipelines/PostPRMessage.ps1 b/azure-pipelines/PostPRMessage.ps1
deleted file mode 100644
index 4075f392..00000000
--- a/azure-pipelines/PostPRMessage.ps1
+++ /dev/null
@@ -1,57 +0,0 @@
-[CmdletBinding(SupportsShouldProcess = $true)]
-param(
- [Parameter(Mandatory=$true)]
- $AccessToken,
- [Parameter(Mandatory=$true)]
- $Markdown,
- [ValidateSet('Active','ByDesign','Closed','Fixed','Pending','Unknown','WontFix')]
- $CommentState='Active'
-)
-
-# See https://learn.microsoft.com/dotnet/api/microsoft.teamfoundation.sourcecontrol.webapi.commentthreadstatus
-if ($CommentState -eq 'Active') {
- $StatusCode = 1
-} elseif ($CommentState -eq 'ByDesign') {
- $StatusCode = 5
-} elseif ($CommentState -eq 'Closed') {
- $StatusCode = 4
-} elseif ($CommentState -eq 'Fixed') {
- $StatusCode = 2
-} elseif ($CommentState -eq 'Pending') {
- $StatusCode = 6
-} elseif ($CommentState -eq 'Unknown') {
- $StatusCode = 0
-} elseif ($CommentState -eq 'WontFix') {
- $StatusCode = 3
-}
-
-# Build the JSON body up
-$body = ConvertTo-Json @{
- comments = @(@{
- parentCommentId = 0
- content = $Markdown
- commentType = 1
- })
- status = $StatusCode
-}
-
-Write-Verbose "Posting JSON payload: `n$Body"
-
-# Post the message to the Pull Request
-# https://learn.microsoft.com/rest/api/azure/devops/git/pull-request-threads
-$url = "$($env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)$env:SYSTEM_TEAMPROJECTID/_apis/git/repositories/$($env:BUILD_REPOSITORY_NAME)/pullRequests/$($env:SYSTEM_PULLREQUEST_PULLREQUESTID)/threads?api-version=5.1"
-if ($PSCmdlet.ShouldProcess($url, 'Post comment via REST call')) {
- try {
- if (!$env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI) {
- Write-Error "Posting to the pull request requires that the script is running in an Azure Pipelines context."
- exit 1
- }
- Write-Host "Posting PR comment to: $url"
- Invoke-RestMethod -Uri $url -Method POST -Headers @{Authorization = "Bearer $AccessToken"} -Body $Body -ContentType application/json
- }
- catch {
- Write-Error $_
- Write-Error $_.Exception.Message
- exit 2
- }
-}
diff --git a/azure-pipelines/archive-sourcecode.yml b/azure-pipelines/archive-sourcecode.yml
deleted file mode 100644
index d53f6711..00000000
--- a/azure-pipelines/archive-sourcecode.yml
+++ /dev/null
@@ -1,94 +0,0 @@
-trigger: none # We only want to trigger manually or based on resources
-pr: none
-
-# Source archival requirements come from a compliance tenet. Review a sample task here: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1550985
-# Source code should be archived within 30 days of the release date, and at least every quarter if your product is releasing more than once every 6 months.
-# If your sources on GitHub are public open source project, then using GitHub Public Archive is sufficient.
-schedules:
-- cron: "13 13 13 */3 *" # Every three months
- displayName: Periodic source archival
- branches:
- include:
- - main
-
-resources:
- repositories:
- - repository: MicroBuildTemplate
- type: git
- name: 1ESPipelineTemplates/MicroBuildTemplate
- ref: refs/tags/release
-
-parameters:
-- name: notes
- displayName: Notes to include in the SCA request
- type: string
- default: ' ' # optional parameters require a non-empty default.
-- name: whatif
- displayName: Only simulate the request
- type: boolean
- default: false
-
-variables:
-- group: VS Core team # Expected to provide ManagerAlias, SourceCodeArchivalUri
-- template: GlobalVariables.yml
-
-extends:
- template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
- parameters:
- settings:
- networkIsolationPolicy: Permissive,CFSClean
- sdl:
- sourceAnalysisPool: VSEng-MicroBuildVSStable
-
- stages:
- - stage: archive
- jobs:
- - job: archive
- pool:
- name: AzurePipelines-EO
- demands:
- - ImageOverride -equals 1ESPT-Ubuntu22.04
- os: Linux
-
- steps:
- - checkout: self
- clean: true
- fetchDepth: 0
- - task: UseDotNet@2
- displayName: โ Install .NET SDKs and runtimes
- inputs:
- packageType: sdk
- useGlobalJson: true
- workingDirectory: $(Build.SourcesDirectory)
- - task: NuGetAuthenticate@1
- displayName: ๐ Authenticate NuGet feeds
- inputs:
- forceReinstallCredentialProvider: true
- - script: dotnet tool restore --configfile azure-pipelines/nuget.config
- displayName: โ๏ธ Restore CLI tools
- - powershell: tools/variables/_define.ps1
- failOnStderr: true
- displayName: โ Set pipeline variables based on source
- - 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
- -ManagerAlias '$(ManagerAlias)'
- -TeamAlias $TeamAlias
- -BusinessGroupName '$(BusinessGroupName)'
- -ProductName '$(SymbolsFeatureName)'
- -ProductLanguage English
- -Notes '${{ parameters.notes }}'
- -AccessToken '$(scaToken)'
- -Verbose
- -WhatIf:$${{ parameters.whatif }}
- displayName: ๐๏ธ Submit archival request
diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml
index 92ce9ae8..705022d1 100644
--- a/azure-pipelines/build.yml
+++ b/azure-pipelines/build.yml
@@ -3,16 +3,6 @@ parameters:
##### but we use parameters because they support rich types and defaults.
##### Feel free to adjust their default value as needed.
-# Whether this repo uses OptProf to optimize the built binaries.
-# When enabling this, be sure to update these files:
-# - OptProf.targets: InstallationPath and match TestCase selection with what's in the VS repo.
-# - The project file(s) for the libraries to optimize must import OptProf.targets (for multi-targeted projects, only import it for ONE target).
-# - OptProf.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate.
-# - OptProf_part2.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate.
-# and create pipelines for OptProf.yml, OptProf_part2.yml
-- name: EnableOptProf
- type: boolean
- default: false
# Whether this repo is localized.
- name: EnableLocalization
type: boolean
@@ -71,12 +61,6 @@ parameters:
type: boolean
default: false
-# Whether this particular run is an OptProf profiling run.
-# This is used to skip unit tests and other non-essential work to improve reliability of the OptProf pipeline.
-- name: IsOptProf
- type: boolean
- default: false
-
- name: RunTests
type: boolean
default: true
@@ -94,13 +78,6 @@ parameters:
type: boolean
default: false
-# This parameter exists to provide a workaround to get a build out even when no OptProf profiling outputs can be found.
-# Entrypoint yaml files like official.yml should expose this as a queue-time setting when EnableOptProf is true in this file.
-# The OptProf.yml entrypoint sets this parameter to true so that collecting profile data isn't blocked by a prior lack of profile data.
-- name: ShouldSkipOptimize
- type: boolean
- default: false
-
# The pool parameters are set to defaults that work in the azure-public AzDO account.
# They are overridden by callers for the devdiv AzDO account to use 1ES compliant pools.
- name: windowsPool
@@ -140,20 +117,10 @@ jobs:
enabled: ${{ parameters.EnableLocalization }}
${{ if eq(variables['Build.Reason'], 'pullRequest') }}:
languages: ENU,JPN
- optprof:
- enabled: ${{ parameters.EnableOptProf }}
- ProfilingInputsDropName: $(ProfilingInputsDropName)
- OptimizationInputsLookupMethod: DropPrefix
- DropNamePrefix: OptimizationInputs/$(System.TeamProject)/$(Build.Repository.Name)
- ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
- AccessToken: $(System.AccessToken)
mbpresteps:
- checkout: self
fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
clean: true
- - ${{ if parameters.EnableOptProf }}:
- - powershell: Write-Host "##vso[task.setvariable variable=PROFILINGINPUTSDROPNAME]$(tools/variables/ProfilingInputsDropName.ps1)"
- displayName: โ Set ProfilingInputsDropName for optprof
sdl:
binskim:
analyzeTargetGlob: $(Build.ArtifactStagingDirectory)\symbols-Windows\**
@@ -188,10 +155,6 @@ jobs:
- checkout: self
fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
clean: true
- - ${{ if parameters.EnableOptProf }}:
- - powershell: Write-Host "##vso[task.setvariable variable=PROFILINGINPUTSDROPNAME]$(tools/variables/ProfilingInputsDropName.ps1)"
- displayName: โ Set ProfilingInputsDropName for optprof
-
- ${{ if eq(variables['Build.Reason'], 'Schedule') }}:
- template: schedule-only-steps.yml
@@ -204,16 +167,12 @@ jobs:
- ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
- template: microbuild.before.yml
parameters:
- EnableLocalization: ${{ parameters.EnableLocalization }}
- IsOptProf: ${{ parameters.IsOptProf }}
- ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
RealSign: ${{ parameters.RealSign }}
- template: dotnet.yml
parameters:
Is1ESPT: ${{ parameters.Is1ESPT }}
RunTests: ${{ parameters.RunTests }}
- IsOptProf: ${{ parameters.IsOptProf }}
- ${{ if and(parameters.EnableDotNetFormatCheck, not(parameters.EnableLinuxBuild)) }}:
- script: dotnet format --verify-no-changes
@@ -224,136 +183,134 @@ jobs:
- ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
- template: microbuild.after.yml
parameters:
- IsOptProf: ${{ parameters.IsOptProf }}
SkipCodesignVerify: ${{ parameters.SkipCodesignVerify }}
-- ${{ if not(parameters.IsOptProf) }}:
- - ${{ if parameters.EnableLinuxBuild }}:
- - job: Linux
- pool: ${{ parameters.linuxPool }}
- variables:
- TestFilter: "&WindowsOnly!=true"
- Platform: NonWindows
- ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
- templateContext:
- mb:
- ${{ if parameters.RealSign }}:
- signing:
- enabled: false # enable when building unique artifacts on this agent that must be signed
- signType: real
- signWithProd: true
- outputParentDirectory: $(Build.ArtifactStagingDirectory)
- outputs:
- - ${{ each artifact in parameters.artifact_names }}:
- - ${{ if or(ne(artifact.testOnly, 'true'), parameters.RunTests) }}:
- - output: pipelineArtifact
- displayName: ๐ข Publish ${{ artifact.name }}-Linux
- targetPath: $(Build.ArtifactStagingDirectory)/${{ artifact.name }}-Linux
- artifactName: ${{ artifact.name }}-Linux
- ${{ if and(parameters.Is1ESPTOfficial, eq(artifact.sbomEnabled, 'true')) }}:
- sbomEnabled: true
- condition: succeededOrFailed()
- steps:
- - checkout: self
- fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
- clean: true
- - template: install-dependencies.yml
- - template: dotnet.yml
- parameters:
- Is1ESPT: ${{ parameters.Is1ESPT }}
- RunTests: ${{ parameters.RunTests }}
- BuildRequiresAccessToken: ${{ parameters.RealSign }} # Real signing on non-Windows machines requires passing through access token to build steps that sign
- - ${{ if parameters.EnableDotNetFormatCheck }}:
- - script: dotnet format --verify-no-changes
- displayName: ๐
Verify formatted code
- env:
- dotnetformat: true # part of a workaround for https://github.com/dotnet/sdk/issues/44951
-
- - ${{ if parameters.EnableMacOSBuild }}:
- - job: macOS
- pool: ${{ parameters.macOSPool }}
- variables:
- TestFilter: "&WindowsOnly!=true"
- Platform: NonWindows
- ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
- templateContext:
- mb:
- ${{ if parameters.RealSign }}:
- signing:
- enabled: false # enable when building unique artifacts on this agent that must be signed
- signType: real
- signWithProd: true
- outputParentDirectory: $(Build.ArtifactStagingDirectory)
- outputs:
- - ${{ each artifact in parameters.artifact_names }}:
- - ${{ if or(ne(artifact.testOnly, 'true'), parameters.RunTests) }}:
- - output: pipelineArtifact
- displayName: ๐ข Publish ${{ artifact.name }}-macOS
- targetPath: $(Build.ArtifactStagingDirectory)/${{ artifact.name }}-macOS
- artifactName: ${{ artifact.name }}-macOS
- ${{ if and(parameters.Is1ESPTOfficial, eq(artifact.sbomEnabled, 'true')) }}:
- sbomEnabled: true
- condition: succeededOrFailed()
- steps:
- - checkout: self
- fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
- clean: true
- - template: install-dependencies.yml
- - template: dotnet.yml
- parameters:
- Is1ESPT: ${{ parameters.Is1ESPT }}
- RunTests: ${{ parameters.RunTests }}
- BuildRequiresAccessToken: ${{ parameters.RealSign }} # Real signing on non-Windows machines requires passing through access token to build steps that sign
+- ${{ if parameters.EnableLinuxBuild }}:
+ - job: Linux
+ pool: ${{ parameters.linuxPool }}
+ variables:
+ TestFilter: "&WindowsOnly!=true"
+ Platform: NonWindows
+ ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
+ templateContext:
+ mb:
+ ${{ if parameters.RealSign }}:
+ signing:
+ enabled: false # enable when building unique artifacts on this agent that must be signed
+ signType: real
+ signWithProd: true
+ outputParentDirectory: $(Build.ArtifactStagingDirectory)
+ outputs:
+ - ${{ each artifact in parameters.artifact_names }}:
+ - ${{ if or(ne(artifact.testOnly, 'true'), parameters.RunTests) }}:
+ - output: pipelineArtifact
+ displayName: ๐ข Publish ${{ artifact.name }}-Linux
+ targetPath: $(Build.ArtifactStagingDirectory)/${{ artifact.name }}-Linux
+ artifactName: ${{ artifact.name }}-Linux
+ ${{ if and(parameters.Is1ESPTOfficial, eq(artifact.sbomEnabled, 'true')) }}:
+ sbomEnabled: true
+ condition: succeededOrFailed()
+ steps:
+ - checkout: self
+ fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
+ clean: true
+ - template: install-dependencies.yml
+ - template: dotnet.yml
+ parameters:
+ Is1ESPT: ${{ parameters.Is1ESPT }}
+ RunTests: ${{ parameters.RunTests }}
+ BuildRequiresAccessToken: ${{ parameters.RealSign }} # Real signing on non-Windows machines requires passing through access token to build steps that sign
+ - ${{ if parameters.EnableDotNetFormatCheck }}:
+ - script: dotnet format --verify-no-changes
+ displayName: ๐
Verify formatted code
+ env:
+ dotnetformat: true # part of a workaround for https://github.com/dotnet/sdk/issues/44951
- - job: WrapUp
- dependsOn:
- - Windows
- - ${{ if parameters.EnableLinuxBuild }}:
- - Linux
- - ${{ if parameters.EnableMacOSBuild }}:
- - macOS
- pool: ${{ parameters.windowsPool }} # Use Windows agent because PublishSymbols task requires it (https://github.com/microsoft/azure-pipelines-tasks/issues/13821).
- condition: succeededOrFailed()
+- ${{ if parameters.EnableMacOSBuild }}:
+ - job: macOS
+ pool: ${{ parameters.macOSPool }}
variables:
- ONEES_ENFORCED_CODEQL_ENABLED: false # CodeQL runs on build jobs, we don't need it here
+ TestFilter: "&WindowsOnly!=true"
+ Platform: NonWindows
${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
templateContext:
- ${{ if not(parameters.RealSign) }}:
- mb:
- signing: # if the build is test-signed, install the signing plugin so that CSVTestSignPolicy.xml is available
- enabled: true
- zipSources: false
- signType: test
+ mb:
+ ${{ if parameters.RealSign }}:
+ signing:
+ enabled: false # enable when building unique artifacts on this agent that must be signed
+ signType: real
+ signWithProd: true
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
- - output: pipelineArtifact
- displayName: ๐ข Publish symbols-legacy
- targetPath: $(Build.ArtifactStagingDirectory)/symbols-legacy
- artifactName: symbols-legacy
- condition: succeededOrFailed()
+ - ${{ each artifact in parameters.artifact_names }}:
+ - ${{ if or(ne(artifact.testOnly, 'true'), parameters.RunTests) }}:
+ - output: pipelineArtifact
+ displayName: ๐ข Publish ${{ artifact.name }}-macOS
+ targetPath: $(Build.ArtifactStagingDirectory)/${{ artifact.name }}-macOS
+ artifactName: ${{ artifact.name }}-macOS
+ ${{ if and(parameters.Is1ESPTOfficial, eq(artifact.sbomEnabled, 'true')) }}:
+ sbomEnabled: true
+ condition: succeededOrFailed()
steps:
- checkout: self
fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
clean: true
- template: install-dependencies.yml
+ - template: dotnet.yml
parameters:
- restoreProjects: false
- - template: publish-symbols.yml
+ Is1ESPT: ${{ parameters.Is1ESPT }}
+ RunTests: ${{ parameters.RunTests }}
+ BuildRequiresAccessToken: ${{ parameters.RealSign }} # Real signing on non-Windows machines requires passing through access token to build steps that sign
+
+- job: WrapUp
+ dependsOn:
+ - Windows
+ - ${{ if parameters.EnableLinuxBuild }}:
+ - Linux
+ - ${{ if parameters.EnableMacOSBuild }}:
+ - macOS
+ pool: ${{ parameters.windowsPool }} # Use Windows agent because PublishSymbols task requires it (https://github.com/microsoft/azure-pipelines-tasks/issues/13821).
+ condition: succeededOrFailed()
+ variables:
+ ONEES_ENFORCED_CODEQL_ENABLED: false # CodeQL runs on build jobs, we don't need it here
+ ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
+ templateContext:
+ ${{ if not(parameters.RealSign) }}:
+ mb:
+ signing: # if the build is test-signed, install the signing plugin so that CSVTestSignPolicy.xml is available
+ enabled: true
+ zipSources: false
+ signType: test
+ outputParentDirectory: $(Build.ArtifactStagingDirectory)
+ outputs:
+ - output: pipelineArtifact
+ displayName: ๐ข Publish symbols-legacy
+ targetPath: $(Build.ArtifactStagingDirectory)/symbols-legacy
+ artifactName: symbols-legacy
+ condition: succeededOrFailed()
+ steps:
+ - checkout: self
+ fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
+ clean: true
+ - template: install-dependencies.yml
+ parameters:
+ restoreProjects: false
+ - template: publish-symbols.yml
+ parameters:
+ EnableLinuxBuild: ${{ parameters.EnableLinuxBuild }}
+ EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
+ - ${{ if and(parameters.RunTests, parameters.PublishCodeCoverage) }}:
+ - template: publish-codecoverage.yml
parameters:
EnableLinuxBuild: ${{ parameters.EnableLinuxBuild }}
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
- - ${{ if and(parameters.RunTests, parameters.PublishCodeCoverage) }}:
- - template: publish-codecoverage.yml
- parameters:
- EnableLinuxBuild: ${{ parameters.EnableLinuxBuild }}
- EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
- - ${{ if parameters.EnableAPIScan }}:
- - template: apiscan.yml
- parameters:
- windowsPool: ${{ parameters.windowsPool }}
- RealSign: ${{ parameters.RealSign }}
+- ${{ if parameters.EnableAPIScan }}:
+ - template: apiscan.yml
+ parameters:
+ windowsPool: ${{ parameters.windowsPool }}
+ RealSign: ${{ parameters.RealSign }}
- # Run the integration tests, but only on azure-public so we don't have to worry about multiple pools
- - ${{ if and(parameters.RunTests, not(parameters.Is1ESPT)) }}:
- - template: integration-test.yml
+# Run the integration tests, but only on azure-public so we don't have to worry about multiple pools
+- ${{ if and(parameters.RunTests, not(parameters.Is1ESPT)) }}:
+ - template: integration-test.yml
diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml
index 947cfc1a..26d9060b 100644
--- a/azure-pipelines/dotnet.yml
+++ b/azure-pipelines/dotnet.yml
@@ -1,8 +1,5 @@
parameters:
- name: RunTests
-- name: IsOptProf
- type: boolean
- default: false
- name: Is1ESPT
type: boolean
- name: BuildRequiresAccessToken
@@ -17,14 +14,9 @@ steps:
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
-- ${{ if not(parameters.IsOptProf) }}:
- - powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults
- displayName: ๐งช dotnet test
- condition: and(succeeded(), ${{ parameters.RunTests }})
-
-- ${{ if parameters.IsOptProf }}:
- - script: dotnet pack src\VSInsertionMetadata -c $(BuildConfiguration) -warnaserror /bl:"$(Build.ArtifactStagingDirectory)/build_logs/VSInsertion-Pack.binlog"
- displayName: ๐ง dotnet pack VSInsertionMetadata
+- powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults
+ displayName: ๐งช dotnet test
+ condition: and(succeeded(), ${{ parameters.RunTests }})
- powershell: tools/variables/_define.ps1
failOnStderr: true
diff --git a/azure-pipelines/microbuild.after.yml b/azure-pipelines/microbuild.after.yml
index 67ba9008..c0e1e7bd 100644
--- a/azure-pipelines/microbuild.after.yml
+++ b/azure-pipelines/microbuild.after.yml
@@ -1,7 +1,4 @@
parameters:
-- name: IsOptProf
- type: boolean
- default: false
- name: SkipCodesignVerify
type: boolean
@@ -15,21 +12,3 @@ steps:
TargetFolders: |
$(Build.SourcesDirectory)/bin/Packages/$(BuildConfiguration)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
-
-- ${{ if parameters.IsOptProf }}:
- - task: ms-vscs-artifact.build-tasks.artifactDropTask-1.artifactDropTask@0
- inputs:
- dropServiceURI: https://devdiv.artifacts.visualstudio.com
- buildNumber: $(ProfilingInputsDropName)
- sourcePath: $(Build.ArtifactStagingDirectory)\OptProf\ProfilingInputs
- toLowerCase: false
- usePat: true
- displayName: ๐ข Publish to Artifact Services - ProfilingInputs
- condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
-
- - task: PublishBuildArtifacts@1
- inputs:
- PathtoPublish: $(Build.ArtifactStagingDirectory)/InsertionOutputs
- ArtifactName: InsertionOutputs
- ArtifactType: Container
- displayName: ๐ข Publish InsertionOutputs as Azure DevOps artifacts
diff --git a/azure-pipelines/microbuild.before.yml b/azure-pipelines/microbuild.before.yml
index b169460c..4192b651 100644
--- a/azure-pipelines/microbuild.before.yml
+++ b/azure-pipelines/microbuild.before.yml
@@ -1,18 +1,9 @@
parameters:
-- name: EnableLocalization
- type: boolean
- default: false
-- name: IsOptProf
- type: boolean
- default: false
-- name: ShouldSkipOptimize
- type: boolean
- default: false
- name: RealSign
type: boolean
steps:
-- ${{ if and(not(parameters.IsOptProf), ne(variables['Build.Reason'], 'PullRequest')) }}:
+- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
# notice@0 requires CG detection to run first, and non-default branches don't inject it automatically.
# default branch injection (main) is happening too late for notice@0 to run successfully. Adding this as a workaround.
- task: ComponentGovernanceComponentDetection@0
@@ -25,26 +16,3 @@ steps:
outputformat: text
retryCountOnTaskFailure: 3 # fails when the cloud service is overloaded
continueOnError: ${{ not(parameters.RealSign) }} # Tolerate failures when we're not building something that may ship.
-
-- ${{ if parameters.IsOptProf }}:
- # We have to install these plugins ourselves for Optprof runs because those pipelines haven't migrated to 1ES PT yet.
- - task: MicroBuildOptProfPlugin@6
- inputs:
- ProfilingInputsDropName: $(ProfilingInputsDropName)
- OptimizationInputsLookupMethod: DropPrefix
- DropNamePrefix: OptimizationInputs/$(System.TeamProject)/$(Build.Repository.Name)
- ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
- AccessToken: $(System.AccessToken)
- displayName: ๐ง Install OptProf Plugin
-
- - task: MicroBuildSigningPlugin@4
- inputs:
- signType: Test
- zipSources: false
- displayName: ๐ง Install MicroBuild Signing Plugin
-
- - ${{ if parameters.EnableLocalization }}:
- - task: MicroBuildLocalizationPlugin@4
- inputs:
- languages: $(LocLanguages)
- displayName: ๐ง Install MicroBuild Localization Plugin
diff --git a/azure-pipelines/official.yml b/azure-pipelines/official.yml
index e71c142d..1176387a 100644
--- a/azure-pipelines/official.yml
+++ b/azure-pipelines/official.yml
@@ -11,10 +11,6 @@ parameters:
# As an entrypoint pipeline yml file, all parameters here show up in the Queue Run dialog.
# If any paramaters should NOT be queue-time options, they should be removed from here
# and references to them in this file replaced with hard-coded values.
-# - name: ShouldSkipOptimize # Uncomment this and references to it below when setting EnableOptProf to true in build.yml.
-# displayName: Skip OptProf optimization
-# type: boolean
-# default: false
- name: EnableMacOSBuild
displayName: Build on macOS
type: boolean
@@ -70,7 +66,6 @@ extends:
Is1ESPT: true
Is1ESPTOfficial: true
RealSign: true
- # ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
EnableAPIScan: ${{ parameters.EnableAPIScan }}
windowsPool: VSEng-MicroBuildVSStable
linuxPool:
diff --git a/azure-pipelines/unofficial.yml b/azure-pipelines/unofficial.yml
index 4009755b..3f24caca 100644
--- a/azure-pipelines/unofficial.yml
+++ b/azure-pipelines/unofficial.yml
@@ -18,10 +18,6 @@ parameters:
# As an entrypoint pipeline yml file, all parameters here show up in the Queue Run dialog.
# If any paramaters should NOT be queue-time options, they should be removed from here
# and references to them in this file replaced with hard-coded values.
-# - name: ShouldSkipOptimize # Uncomment this and references to it below when setting EnableOptProf to true in build.yml.
-# displayName: Skip OptProf optimization
-# type: boolean
-# default: false
- name: EnableMacOSBuild
displayName: Build on macOS
type: boolean
@@ -84,7 +80,6 @@ extends:
parameters:
Is1ESPT: true
RealSign: false
- # ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
EnableAPIScan: ${{ parameters.EnableAPIScan }}
windowsPool: VSEng-MicroBuildVSStable
linuxPool:
diff --git a/azure-pipelines/vs-validation.yml b/azure-pipelines/vs-validation.yml
deleted file mode 100644
index 7ff3ec0f..00000000
--- a/azure-pipelines/vs-validation.yml
+++ /dev/null
@@ -1,123 +0,0 @@
-# This is a top-level pipeline file, which is designed to be added as an optional PR build policy
-# so that a VS insertion and all the validation that entails can be done before ever merging the PR
-# in its original repo.
-
-trigger: none # We only want to trigger manually or based on resources
-pr: none
-
-# parameters:
-# - name: ShouldSkipOptimize # Uncomment this and references to it below when setting EnableOptProf to true in build.yml.
-# displayName: Skip OptProf optimization
-# type: boolean
-# default: false
-
-resources:
- repositories:
- - repository: MicroBuildTemplate
- type: git
- name: 1ESPipelineTemplates/MicroBuildTemplate
- ref: refs/tags/release
-
-variables:
-- template: GlobalVariables.yml
-- name: MicroBuild_NuPkgSigningEnabled
- value: false # test-signed nuget packages fail to restore in the VS insertion PR validations. Just don't sign them *at all*.
-
-extends:
- template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
- parameters:
- settings:
- networkIsolationPolicy: Permissive,CFSClean
- sdl:
- sourceAnalysisPool: VSEng-MicroBuildVSStable
- credscan:
- enabled: false
-
- stages:
- - stage: Build
- variables:
- - template: /azure-pipelines/BuildStageVariables.yml@self
- - name: SkipCodesignVerify
- value: true
-
- jobs:
- - template: /azure-pipelines/build.yml@self
- parameters:
- Is1ESPT: true
- RealSign: false
- # ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
- windowsPool: VSEng-MicroBuildVSStable
- linuxPool:
- name: AzurePipelines-EO
- demands:
- - ImageOverride -equals 1ESPT-Ubuntu22.04
- os: Linux
- macOSPool:
- name: Azure Pipelines
- vmImage: macOS-14
- os: macOS
- EnableMacOSBuild: false
- RunTests: false
- SkipCodesignVerify: true
-
- - template: /azure-pipelines/prepare-insertion-stages.yml@self
- parameters:
- ArchiveSymbols: false
- RealSign: false
-
- - stage: insertion
- displayName: VS insertion
- jobs:
- - job: insertion
- displayName: VS insertion
- pool: VSEng-MicroBuildVSStable
- steps:
- - checkout: self
- clean: true
- fetchDepth: 1
- - download: current
- artifact: Variables-Windows
- displayName: ๐ป Download Variables-Windows artifact
- - powershell: $(Pipeline.Workspace)/Variables-Windows/_define.ps1
- displayName: โ๏ธ Set pipeline variables based on artifacts
- - download: current
- artifact: VSInsertion-Windows
- displayName: ๐ป Download VSInsertion-Windows artifact
- - ${{ if eq(variables['ContainsVsix'], 'true') }}:
- - task: 1ES.MicroBuildVstsDrop@1
- displayName: ๐บ Upload VSTS Drop
- inputs:
- dropFolder: $(Pipeline.Workspace)/VSInsertion-windows/Vsix
- dropName: $(VstsDropNames)
- accessToken: $(System.AccessToken)
- - task: 1ES.PublishNuget@1
- displayName: ๐ฆ Push VS-repo packages to VS feed
- inputs:
- packagesToPush: '$(Pipeline.Workspace)/VSInsertion-Windows/*.nupkg'
- packageParentPath: $(Pipeline.Workspace)/VSInsertion-Windows
- allowPackageConflicts: true
- publishVstsFeed: VS
- - task: MicroBuildInsertVsPayload@5
- displayName: ๐ญ Insert VS Payload
- inputs:
- TeamName: $(TeamName)
- TeamEmail: $(TeamEmail)
- InsertionPayloadName: $(Build.Repository.Name) VALIDATION BUILD $(Build.BuildNumber) ($(Build.SourceBranch)) [Skip-SymbolCheck] [Skip-HashCheck] [Skip-SignCheck]
- InsertionDescription: |
- This PR is for **validation purposes only** for !$(System.PullRequest.PullRequestId). **Do not complete**.
- CustomScriptExecutionCommand: src/VSSDK/NuGet/AllowUnstablePackages.ps1
- InsertionBuildPolicies: Request Perf DDRITs
- InsertionReviewers: $(Build.RequestedFor)
- DraftPR: false # set to true and update InsertionBuildPolicy when we can specify all the validations we want to run (https://dev.azure.com/devdiv/DevDiv/_workitems/edit/2224288)
- AutoCompletePR: false
- ShallowClone: true
- - powershell: |
- $insertionPRId = azure-pipelines/Get-InsertionPRId.ps1
- $Markdown = @"
- Validation insertion pull request created: !$insertionPRId
- Please check status there before proceeding to merge this PR.
- Remember to Abandon and (if allowed) to Delete Source Branch on that insertion PR when validation is complete.
- "@
- azure-pipelines/PostPRMessage.ps1 -AccessToken '$(System.AccessToken)' -Markdown $Markdown -Verbose
- displayName: โ๏ธ Comment on pull request
- condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
diff --git a/src/OptProf.targets b/src/OptProf.targets
deleted file mode 100644
index d0167d7c..00000000
--- a/src/OptProf.targets
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- IBC
- Common7\IDE\PrivateAssemblies\$(TargetFileName)
- /ExeConfig:"%VisualStudio.InstallationUnderTest.Path%\Common7\IDE\vsn.exe"
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSInsertionMetadata/Library.VSInsertionMetadata.proj b/src/VSInsertionMetadata/Library.VSInsertionMetadata.proj
deleted file mode 100644
index 0caaedb9..00000000
--- a/src/VSInsertionMetadata/Library.VSInsertionMetadata.proj
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
- netstandard2.0
- true
- $(RepoRootPath)bin\Packages\$(Configuration)\VSRepo\
- false
- false
- Contains metadata for insertion into VS.
-
-
-
diff --git a/src/VSInsertionMetadata/ProfilingInputs.props b/src/VSInsertionMetadata/ProfilingInputs.props
deleted file mode 100644
index fb19d604..00000000
--- a/src/VSInsertionMetadata/ProfilingInputs.props
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/src/VSInsertionMetadata/VSInsertionMetadata.targets b/src/VSInsertionMetadata/VSInsertionMetadata.targets
deleted file mode 100644
index 84ebb5a8..00000000
--- a/src/VSInsertionMetadata/VSInsertionMetadata.targets
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(TargetsForTfmSpecificContentInPackage);
- SubstituteProfilingInputsMacro;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(PackageVersion).$(Build_BuildId)
-
-
-
-
-
-
diff --git a/tools/artifacts/VSInsertion.ps1 b/tools/artifacts/VSInsertion.ps1
index a5b940b5..3d96dd1a 100644
--- a/tools/artifacts/VSInsertion.ps1
+++ b/tools/artifacts/VSInsertion.ps1
@@ -5,7 +5,7 @@ Param (
)
if ($IsMacOS -or $IsLinux) {
- # We only package up for insertions on Windows agents since they are where optprof can happen.
+ # Visual Studio insertion packages are produced on Windows agents.
Write-Verbose "Skipping VSInsertion artifact since we're not on Windows."
return @{}
}
@@ -33,9 +33,4 @@ if (Test-Path $VsixPackages) {
$result["$PackagesRoot"] += Get-ChildItem $VsixPackages -Recurse
}
-if ($env:IsOptProf) {
- $VSRepoPackages = "$PackagesRoot/VSRepo"
- $result["$VSRepoPackages"] = (Get-ChildItem "$VSRepoPackages\*.VSInsertionMetadata.*.nupkg");
-}
-
$result
diff --git a/tools/variables/BusinessGroupName.ps1 b/tools/variables/BusinessGroupName.ps1
deleted file mode 100644
index 00824266..00000000
--- a/tools/variables/BusinessGroupName.ps1
+++ /dev/null
@@ -1 +0,0 @@
-'Visual Studio - VS Core'
diff --git a/tools/variables/ProfilingInputsDropName.ps1 b/tools/variables/ProfilingInputsDropName.ps1
deleted file mode 100644
index 88d21f69..00000000
--- a/tools/variables/ProfilingInputsDropName.ps1
+++ /dev/null
@@ -1,5 +0,0 @@
-if ($env:SYSTEM_TEAMPROJECT) {
- "ProfilingInputs/$env:SYSTEM_TEAMPROJECT/$env:BUILD_REPOSITORY_NAME/$env:BUILD_SOURCEBRANCHNAME/$env:BUILD_BUILDID"
-} else {
- Write-Warning "No Azure Pipelines build detected. No Azure Pipelines drop name will be computed."
-}
From 774d0e5369d60680b3092ed03e4c09764d324507 Mon Sep 17 00:00:00 2001
From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Date: Sun, 18 Oct 2026 00:32:58 +0900
Subject: [PATCH 5/5] Remove unused repo tooling and VS Code settings
---
.config/dotnet-tools.json | 7 ---
.github/actions/publish-artifacts/action.yaml | 60 -------------------
.github/workflows/build.yml | 1 -
.vscode/extensions.json | 20 -------
.vscode/launch.json | 14 -----
.vscode/settings.json | 24 --------
.vscode/tasks.json | 17 ------
azure-pipelines.yml | 1 -
azure-pipelines/unofficial.yml | 1 -
9 files changed, 145 deletions(-)
delete mode 100644 .github/actions/publish-artifacts/action.yaml
delete mode 100644 .vscode/extensions.json
delete mode 100644 .vscode/launch.json
delete mode 100644 .vscode/settings.json
delete mode 100644 .vscode/tasks.json
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 1d5a56f3..63241244 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -22,13 +22,6 @@
"docfx"
],
"rollForward": false
- },
- "nerdbank.dotnetrepotools": {
- "version": "1.5.42",
- "commands": [
- "repo"
- ],
- "rollForward": false
}
}
}
\ No newline at end of file
diff --git a/.github/actions/publish-artifacts/action.yaml b/.github/actions/publish-artifacts/action.yaml
deleted file mode 100644
index 87b2f9c0..00000000
--- a/.github/actions/publish-artifacts/action.yaml
+++ /dev/null
@@ -1,60 +0,0 @@
-name: Publish artifacts
-description: Publish artifacts
-
-runs:
- using: composite
- steps:
- - name: ๐ฅ Collect artifacts
- run: tools/artifacts/_stage_all.ps1
- shell: pwsh
- if: always()
-
-# TODO: replace this hard-coded list with a loop that utilizes the NPM package at
-# https://github.com/actions/toolkit/tree/main/packages/artifact (or similar) to push the artifacts.
-
- - name: ๐ข Upload project.assets.json files
- if: always()
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- with:
- name: projectAssetsJson-${{ runner.os }}
- path: ${{ runner.temp }}/_artifacts/projectAssetsJson
- continue-on-error: true
- - name: ๐ข Upload variables
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- with:
- name: variables-${{ runner.os }}
- path: ${{ runner.temp }}/_artifacts/Variables
- continue-on-error: true
- - name: ๐ข Upload build_logs
- if: always()
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- with:
- name: build_logs-${{ runner.os }}
- path: ${{ runner.temp }}/_artifacts/build_logs
- continue-on-error: true
- - name: ๐ข Upload testResults
- if: always()
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- with:
- name: testResults-${{ runner.os }}
- path: ${{ runner.temp }}/_artifacts/testResults
- continue-on-error: true
- - name: ๐ข Upload coverageResults
- if: always()
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- with:
- name: coverageResults-${{ runner.os }}
- path: ${{ runner.temp }}/_artifacts/coverageResults
- continue-on-error: true
- - name: ๐ข Upload symbols
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- with:
- name: symbols-${{ runner.os }}
- path: ${{ runner.temp }}/_artifacts/symbols
- continue-on-error: true
- - name: ๐ข Upload deployables
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- with:
- name: deployables-${{ runner.os }}
- path: ${{ runner.temp }}/_artifacts/deployables
- if: always()
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3f1e6939..22945bb3 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -10,7 +10,6 @@ on:
paths-ignore:
- doc/
- '*.md'
- - .vscode/
- azure-pipelines/release.yml
workflow_dispatch:
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
deleted file mode 100644
index acaf0213..00000000
--- a/.vscode/extensions.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
- // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
- // List of extensions which should be recommended for users of this workspace.
- "recommendations": [
- "ms-azure-devops.azure-pipelines",
- "ms-dotnettools.csharp",
- "k--kato.docomment",
- "editorconfig.editorconfig",
- "esbenp.prettier-vscode",
- "pflannery.vscode-versionlens",
- "davidanson.vscode-markdownlint",
- "dotjoshjohnson.xml",
- "ms-vscode-remote.remote-containers",
- "ms-azuretools.vscode-docker",
- "tintoy.msbuild-project-tools"
- ],
- // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
- "unwantedRecommendations": []
-}
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index a6e4859c..00000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- // Use IntelliSense to find out which attributes exist for C# debugging
- // Use hover for the description of the existing attributes
- // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
- "version": "0.2.0",
- "configurations": [
- {
- "name": ".NET Core Attach",
- "type": "coreclr",
- "request": "attach",
- "processId": "${command:pickProcess}"
- }
- ]
-}
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index aa4ef023..00000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "files.trimTrailingWhitespace": true,
- "files.insertFinalNewline": true,
- "files.trimFinalNewlines": true,
- "azure-pipelines.1ESPipelineTemplatesSchemaFile": true,
- "omnisharp.enableEditorConfigSupport": true,
- "omnisharp.enableRoslynAnalyzers": true,
- "dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true,
- "editor.formatOnSave": true,
- "[xml]": {
- "editor.wordWrap": "off"
- },
- // Treat these files as Azure Pipelines files
- "files.associations": {
- "**/azure-pipelines/**/*.yml": "azure-pipelines",
- "azure-pipelines.yml": "azure-pipelines"
- },
- // Use Prettier as the default formatter for Azure Pipelines files.
- // Needs to be explicitly configured: https://github.com/Microsoft/azure-pipelines-vscode#document-formatting
- "[azure-pipelines]": {
- "editor.defaultFormatter": "esbenp.prettier-vscode",
- "editor.formatOnSave": false // enable this when they conform
- },
-}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
deleted file mode 100644
index 67b06180..00000000
--- a/.vscode/tasks.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "version": "2.0.0",
- "tasks": [
- {
- "label": "build",
- "command": "dotnet",
- "type": "process",
- "args": [
- "build",
- "${workspaceFolder}",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- }
- ]
-}
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 5379ddd5..65cf7115 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -9,7 +9,6 @@ trigger:
exclude:
- doc/
- '*.md'
- - .vscode/
- .github/
- azure-pipelines/release.yml
diff --git a/azure-pipelines/unofficial.yml b/azure-pipelines/unofficial.yml
index 3f24caca..741f433d 100644
--- a/azure-pipelines/unofficial.yml
+++ b/azure-pipelines/unofficial.yml
@@ -10,7 +10,6 @@ trigger:
exclude:
- doc/
- '*.md'
- - .vscode/
- azure-pipelines/release.yml
- azure-pipelines/vs-insertion.yml