diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index a333e70b..c21d04bd 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,32 +3,32 @@ "isRoot": true, "tools": { "powershell": { - "version": "7.4.6", + "version": "7.5.0", "commands": [ "pwsh" ], "rollForward": false }, "dotnet-coverage": { - "version": "17.12.6", + "version": "17.14.2", "commands": [ "dotnet-coverage" ], "rollForward": false }, "nbgv": { - "version": "3.6.146", + "version": "3.7.115", "commands": [ "nbgv" ], "rollForward": false }, "docfx": { - "version": "2.77.0", + "version": "2.78.3", "commands": [ "docfx" ], "rollForward": false } } -} \ No newline at end of file +} diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9626b31b..eaaf8fe1 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions -FROM mcr.microsoft.com/dotnet/sdk:8.0.402-jammy +FROM mcr.microsoft.com/dotnet/sdk:9.0.202-noble@sha256:332e0362dd210a10348d436a5fb7f87aeec28c2c53ac2c3c2659e57c22294d0e # Installing mono makes `dotnet test` work without errors even for net472. # But installing it takes a long time, so it's excluded by default. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f4e3b31a..1a3a0086 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,20 +1,25 @@ { "name": "Dev space", "dockerFile": "Dockerfile", - "settings": { - "terminal.integrated.shell.linux": "/usr/bin/pwsh" + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.shell.linux": "/usr/bin/pwsh" + }, + "extensions": [ + "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" + ] + } }, - "postCreateCommand": "./init.ps1 -InstallLocality machine", - "extensions": [ - "ms-azure-devops.azure-pipelines", - "ms-dotnettools.csharp", - "k--kato.docomment", - "editorconfig.editorconfig", - "pflannery.vscode-versionlens", - "davidanson.vscode-markdownlint", - "dotjoshjohnson.xml", - "ms-vscode-remote.remote-containers", - "ms-azuretools.vscode-docker", - "ms-vscode.powershell" - ] + "postCreateCommand": "./init.ps1 -InstallLocality machine" } diff --git a/.github/.editorconfig b/.github/.editorconfig new file mode 100644 index 00000000..2b7682ef --- /dev/null +++ b/.github/.editorconfig @@ -0,0 +1,2 @@ +[renovate.json*] +indent_style = tab diff --git a/.github/actions/publish-artifacts/action.yaml b/.github/actions/publish-artifacts/action.yaml new file mode 100644 index 00000000..1f345fe6 --- /dev/null +++ b/.github/actions/publish-artifacts/action.yaml @@ -0,0 +1,60 @@ +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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: projectAssetsJson-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/projectAssetsJson + continue-on-error: true + - name: ๐Ÿ“ข Upload variables + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: variables-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/Variables + continue-on-error: true + - name: ๐Ÿ“ข Upload build_logs + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + 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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: testResults-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/testResults + continue-on-error: true + - name: ๐Ÿ“ข Upload coverageResults + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: coverageResults-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/coverageResults + continue-on-error: true + - name: ๐Ÿ“ข Upload symbols + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: symbols-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/symbols + continue-on-error: true + - name: ๐Ÿ“ข Upload deployables + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: deployables-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/deployables + if: always() diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 63e3e890..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Please see the documentation for all configuration options: -# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - -version: 2 -updates: -- package-ecosystem: nuget - directory: / - schedule: - interval: weekly diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 00000000..4cd2b0cb --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>microsoft/vs-renovate-presets:microbuild", + "github>microsoft/vs-renovate-presets:vs_main_dependencies" + ], + "packageRules": [] +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ccf1187..f4f832e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,22 +39,22 @@ jobs: } shell: pwsh - name: โš™๏ธ Set pipeline variables based on source - run: azure-pipelines/variables/_pipelines.ps1 + run: tools/variables/_define.ps1 shell: pwsh - name: ๐Ÿ›  build run: dotnet build src -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog" - name: ๐Ÿงช test - run: azure-pipelines/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} + run: tools/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} shell: pwsh - name: ๐Ÿ’…๐Ÿป Verify formatted code run: dotnet format --verify-no-changes --no-restore shell: pwsh if: runner.os == 'Linux' - name: โš™ Update pipeline variables based on build outputs - run: azure-pipelines/variables/_pipelines.ps1 + run: tools/variables/_define.ps1 shell: pwsh - name: ๐Ÿ“ฅ Collect artifacts - run: azure-pipelines/artifacts/_stage_all.ps1 + run: tools/artifacts/_stage_all.ps1 shell: pwsh if: always() - name: ๐Ÿ“ข Upload project.assets.json files diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6e6e64a0..0a8f8215 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,6 +10,7 @@ permissions: actions: read pages: write id-token: write + contents: read # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. @@ -24,7 +25,9 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: โš™ Install prerequisites run: ./init.ps1 -UpgradePrerequisites @@ -32,10 +35,10 @@ jobs: name: ๐Ÿ“š Generate documentation - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 with: path: docfx/_site - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 diff --git a/.github/workflows/docs_validate.yml b/.github/workflows/docs_validate.yml new file mode 100644 index 00000000..2425d742 --- /dev/null +++ b/.github/workflows/docs_validate.yml @@ -0,0 +1,30 @@ +name: ๐Ÿ“ƒ Docfx Validate + +on: + pull_request: + workflow_dispatch: + push: + branches: + - main + - microbuild + +jobs: + build: + name: ๐Ÿ“š Doc validation + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. + - name: ๐Ÿ”— Markup Link Checker (mlc) + uses: becheran/mlc@v0.21.0 + 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* + - name: โš™ Install prerequisites + run: | + ./init.ps1 -UpgradePrerequisites + dotnet --info + shell: pwsh + - 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 index 0831ced6..7d0a67a0 100644 --- a/.github/workflows/libtemplate-update.yml +++ b/.github/workflows/libtemplate-update.yml @@ -1,4 +1,4 @@ -name: Library.Template update +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 @@ -17,7 +17,7 @@ jobs: contents: write pull-requests: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. @@ -25,7 +25,7 @@ jobs: id: merge shell: pwsh run: | - $LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated + $LibTemplateBranch = & ./tools/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } @@ -45,7 +45,7 @@ jobs: # 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 merged doesn't bring in any changes to these files, try the merge locally and push that + # 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. @@ -77,7 +77,7 @@ jobs: $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." + โš ๏ธ Do **not** squash this pull request when completing it. You must *merge* it.
Merge conflicts? @@ -91,7 +91,7 @@ jobs: git commit git push ``` -
+ " gh pr create -H auto/libtemplateUpdate -b $prBody -t $prTitle env: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43a47613..7c3a4d28 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,73 @@ https://cla.microsoft.com. ## Pull requests -When you submit a pull request, a CLA-bot will automatically determine whether you need -to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the -instructions provided by the bot. You will only need to do this once across all repositories using our CLA. +## Prerequisites + +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. + +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 + +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. + +## Building + +This repository can be built on Windows, Linux, and OSX. + +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.). + +[pwsh]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell?view=powershell-6 + +## Releases + +Use `nbgv tag` to create a tag for a particular commit that you mean to release. +[Learn more about `nbgv` and its `tag` and `prepare-release` commands](https://dotnet.github.io/Nerdbank.GitVersioning/docs/nbgv-cli.html). + +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. +Trigger the pipeline by adding the `auto-release` tag on a run of your main `azure-pipelines.yml` pipeline. + +## Tutorial and API documentation + +API and hand-written docs are found under the `docfx/` directory. and are built by [docfx](https://dotnet.github.io/docfx/). + +You can make changes and host the site locally to preview them by switching to that directory and running the `dotnet docfx --serve` command. +After making a change, you can rebuild the docs site while the localhost server is running by running `dotnet docfx` again from a separate terminal. + +The `.github/workflows/docs.yml` GitHub Actions workflow publishes the content of these docs to github.io if the workflow itself and [GitHub Pages is enabled for your repository](https://docs.github.com/en/pages/quickstart). + +## Updating dependencies + +This repo uses Renovate to keep dependencies current. +Configuration is in the `.github/renovate.json` file. +[Learn more about configuring Renovate](https://docs.renovatebot.com/configuration-options/). + +When changing the renovate.json file, follow [these validation steps](https://docs.renovatebot.com/config-validation/). + +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/Directory.Packages.props b/Directory.Packages.props index 62383d30..e5b0c8e1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -16,11 +16,14 @@ + + + - - + + - \ No newline at end of file + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 79f69c22..fb2b4992 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,6 +3,7 @@ trigger: branches: include: - main + - 'v*.*' - microbuild - 'validate/*' paths: diff --git a/azure-pipelines/Install-NuGetPackage.ps1 b/azure-pipelines/Install-NuGetPackage.ps1 index 9afde055..f1db577a 100644 --- a/azure-pipelines/Install-NuGetPackage.ps1 +++ b/azure-pipelines/Install-NuGetPackage.ps1 @@ -33,7 +33,7 @@ Param( [string]$Verbosity='normal' ) -$nugetPath = & "$PSScriptRoot\Get-NuGetTool.ps1" +$nugetPath = & "$PSScriptRoot\..\tools\Get-NuGetTool.ps1" try { Write-Verbose "Installing $PackageId..." diff --git a/azure-pipelines/Merge-CodeCoverage.ps1 b/azure-pipelines/Merge-CodeCoverage.ps1 index b126268c..32438237 100644 --- a/azure-pipelines/Merge-CodeCoverage.ps1 +++ b/azure-pipelines/Merge-CodeCoverage.ps1 @@ -28,7 +28,7 @@ try { if ($reports) { $reports |% { $_.FullName } |% { # In addition to replacing {reporoot}, we also normalize on one kind of slash so that the report aggregates data for a file whether data was collected on Windows or not. - $xml = [xml](Get-Content -Path $_) + $xml = [xml](Get-Content -LiteralPath $_) $xml.coverage.packages.package.classes.class |? { $_.filename} |% { $_.filename = $_.filename.Replace('{reporoot}', $RepoRoot).Replace([IO.Path]::AltDirectorySeparatorChar, [IO.Path]::DirectorySeparatorChar) } diff --git a/azure-pipelines/OptProf.yml b/azure-pipelines/OptProf.yml index 4e309418..a70b9362 100644 --- a/azure-pipelines/OptProf.yml +++ b/azure-pipelines/OptProf.yml @@ -82,7 +82,7 @@ stages: displayName: Set pipeline variables based on artifacts inputs: targetType: filePath - filePath: $(Agent.TempDirectory)/Variables-Windows/_pipelines.ps1 + filePath: $(Agent.TempDirectory)/Variables-Windows/_define.ps1 - task: NuGetCommand@2 displayName: Push VS-repo packages to VS feed inputs: @@ -90,7 +90,7 @@ stages: packagesToPush: $(Agent.TempDirectory)/VSInsertion-Windows/*.nupkg publishVstsFeed: 97a41293-2972-4f48-8c0e-05493ae82010 # VS feed allowPackageConflicts: true - - task: MicroBuildInsertVsPayload@4 + - task: MicroBuildInsertVsPayload@5 displayName: Insert VS Payload inputs: TeamName: $(TeamName) diff --git a/azure-pipelines/apiscan.yml b/azure-pipelines/apiscan.yml index af78f15c..c3c8aed1 100644 --- a/azure-pipelines/apiscan.yml +++ b/azure-pipelines/apiscan.yml @@ -1,6 +1,8 @@ parameters: - name: windowsPool type: object +- name: RealSign + type: boolean jobs: - job: apiscan @@ -9,6 +11,12 @@ jobs: pool: ${{ parameters.windowsPool }} timeoutInMinutes: 120 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 outputs: - output: pipelineArtifact displayName: ๐Ÿ“ข collect apiscan artifact diff --git a/azure-pipelines/archive-sourcecode.yml b/azure-pipelines/archive-sourcecode.yml index f5b4781e..77f243bc 100644 --- a/azure-pipelines/archive-sourcecode.yml +++ b/azure-pipelines/archive-sourcecode.yml @@ -60,7 +60,7 @@ extends: forceReinstallCredentialProvider: true - script: dotnet tool restore displayName: โš™๏ธ Restore CLI tools - - powershell: azure-pipelines/variables/_pipelines.ps1 + - powershell: tools/variables/_define.ps1 failOnStderr: true displayName: โš™ Set pipeline variables based on source - task: AzureCLI@2 diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index 375c422e..3eb3ebe4 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -23,7 +23,7 @@ parameters: type: boolean default: false # This lists the names of the artifacts that will be published *from every OS build agent*. -# Any new azure-pipelines/artifacts/*.ps1 script needs to be added to this list. +# Any new tools/artifacts/*.ps1 script needs to be added to this list. # If an artifact is only generated or collected on one OS, it should NOT be listed here, # but should be manually added to the `outputs:` field in the appropriate OS job. - name: artifact_names @@ -71,6 +71,10 @@ parameters: type: boolean default: true +- name: PublishCodeCoverage + type: boolean + default: true + # Whether this is a special one-off build for inserting into VS for a validation insertion PR (that will never be merged). - name: SkipCodesignVerify type: boolean @@ -134,7 +138,7 @@ jobs: fetchDepth: 0 # avoid shallow clone so nbgv can do its work. clean: true - ${{ if parameters.EnableOptProf }}: - - powershell: Write-Host "##vso[task.setvariable variable=PROFILINGINPUTSDROPNAME]$(azure-pipelines/variables/ProfilingInputsDropName.ps1)" + - powershell: Write-Host "##vso[task.setvariable variable=PROFILINGINPUTSDROPNAME]$(tools/variables/ProfilingInputsDropName.ps1)" displayName: โš™ Set ProfilingInputsDropName for optprof outputParentDirectory: $(Build.ArtifactStagingDirectory) @@ -166,7 +170,7 @@ jobs: fetchDepth: 0 # avoid shallow clone so nbgv can do its work. clean: true - ${{ if parameters.EnableOptProf }}: - - powershell: Write-Host "##vso[task.setvariable variable=PROFILINGINPUTSDROPNAME]$(azure-pipelines/variables/ProfilingInputsDropName.ps1)" + - powershell: Write-Host "##vso[task.setvariable variable=PROFILINGINPUTSDROPNAME]$(tools/variables/ProfilingInputsDropName.ps1)" displayName: โš™ Set ProfilingInputsDropName for optprof - ${{ if eq(variables['Build.Reason'], 'Schedule') }}: @@ -196,6 +200,8 @@ jobs: - ${{ if and(parameters.EnableDotNetFormatCheck, not(parameters.EnableLinuxBuild)) }}: - script: dotnet format --verify-no-changes --no-restore src displayName: ๐Ÿ’… Verify formatted code + env: + dotnetformat: true # part of a workaround for https://github.com/dotnet/sdk/issues/44951 - ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}: - template: microbuild.after.yml @@ -236,6 +242,8 @@ jobs: - ${{ if parameters.EnableDotNetFormatCheck }}: - script: dotnet format --verify-no-changes --no-restore src displayName: ๐Ÿ’… Verify formatted code + env: + dotnetformat: true # part of a workaround for https://github.com/dotnet/sdk/issues/44951 - ${{ if parameters.EnableMacOSBuild }}: - job: macOS @@ -295,7 +303,7 @@ jobs: parameters: EnableLinuxBuild: ${{ parameters.EnableLinuxBuild }} EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }} - - ${{ if parameters.RunTests }}: + - ${{ if and(parameters.RunTests, parameters.PublishCodeCoverage) }}: - template: publish-codecoverage.yml parameters: EnableLinuxBuild: ${{ parameters.EnableLinuxBuild }} @@ -305,3 +313,4 @@ jobs: - template: apiscan.yml parameters: windowsPool: ${{ parameters.windowsPool }} + RealSign: ${{ parameters.RealSign }} diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index 638170d1..d785120d 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -12,7 +12,7 @@ steps: displayName: ๐Ÿ›  dotnet build - ${{ if not(parameters.IsOptProf) }}: - - powershell: azure-pipelines/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults + - powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults displayName: ๐Ÿงช dotnet test condition: and(succeeded(), ${{ parameters.RunTests }}) @@ -20,27 +20,27 @@ steps: - script: dotnet pack src\VSInsertionMetadata -c $(BuildConfiguration) -warnaserror /bl:"$(Build.ArtifactStagingDirectory)/build_logs/VSInsertion-Pack.binlog" displayName: ๐Ÿ”ง dotnet pack VSInsertionMetadata -- powershell: azure-pipelines/variables/_pipelines.ps1 +- powershell: tools/variables/_define.ps1 failOnStderr: true displayName: โš™ Update pipeline variables based on build outputs condition: succeededOrFailed() - ${{ if parameters.Is1ESPT }}: - - powershell: azure-pipelines/artifacts/_pipelines.ps1 -StageOnly -AvoidSymbolicLinks -ArtifactNameSuffix "-$(Agent.JobName)" -Verbose + - powershell: azure-pipelines/publish_artifacts.ps1 -StageOnly -AvoidSymbolicLinks -ArtifactNameSuffix "-$(Agent.JobName)" -Verbose failOnStderr: true displayName: ๐Ÿ“ข Stage artifacts condition: succeededOrFailed() - ${{ else }}: - - powershell: azure-pipelines/artifacts/_pipelines.ps1 -ArtifactNameSuffix "-$(Agent.JobName)" -Verbose + - powershell: azure-pipelines/publish_artifacts.ps1 -ArtifactNameSuffix "-$(Agent.JobName)" -Verbose failOnStderr: true displayName: ๐Ÿ“ข Publish artifacts condition: succeededOrFailed() - ${{ if and(ne(variables['codecov_token'], ''), parameters.RunTests) }}: - powershell: | - $ArtifactStagingFolder = & "azure-pipelines/Get-ArtifactsStagingDirectory.ps1" + $ArtifactStagingFolder = & "tools/Get-ArtifactsStagingDirectory.ps1" $CoverageResultsFolder = Join-Path $ArtifactStagingFolder "coverageResults-$(Agent.JobName)" - azure-pipelines/publish-CodeCov.ps1 -CodeCovToken "$(codecov_token)" -PathToCodeCoverage "$CoverageResultsFolder" -Name "$(Agent.JobName) Coverage Results" -Flags "$(Agent.JobName)" + tools/publish-CodeCov.ps1 -CodeCovToken "$(codecov_token)" -PathToCodeCoverage "$CoverageResultsFolder" -Name "$(Agent.JobName) Coverage Results" -Flags "$(Agent.JobName)" displayName: ๐Ÿ“ข Publish code coverage results to codecov.io timeoutInMinutes: 3 continueOnError: true diff --git a/azure-pipelines/install-dependencies.yml b/azure-pipelines/install-dependencies.yml index e5d58f41..9835c3f8 100644 --- a/azure-pipelines/install-dependencies.yml +++ b/azure-pipelines/install-dependencies.yml @@ -30,7 +30,7 @@ steps: } displayName: โš™ Install prerequisites -- powershell: azure-pipelines/variables/_pipelines.ps1 +- powershell: tools/variables/_define.ps1 failOnStderr: true displayName: โš™ Set pipeline variables based on source name: SetPipelineVariables diff --git a/azure-pipelines/justnugetorg.nuget.config b/azure-pipelines/justnugetorg.nuget.config deleted file mode 100644 index 765346e5..00000000 --- a/azure-pipelines/justnugetorg.nuget.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/azure-pipelines/libtemplate-update.yml b/azure-pipelines/libtemplate-update.yml index a67a4ece..3d7fb7e3 100644 --- a/azure-pipelines/libtemplate-update.yml +++ b/azure-pipelines/libtemplate-update.yml @@ -50,7 +50,7 @@ extends: fetchDepth: 0 clean: true - pwsh: | - $LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated + $LibTemplateBranch = & ./tools/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/azure-pipelines/official.yml b/azure-pipelines/official.yml index e01575fa..6d7c0213 100644 --- a/azure-pipelines/official.yml +++ b/azure-pipelines/official.yml @@ -1,17 +1,5 @@ -trigger: - batch: true - branches: - include: - - main - - microbuild - - 'validate/*' - paths: - exclude: - - doc/ - - '*.md' - - .vscode/ - - azure-pipelines/release.yml - - azure-pipelines/vs-insertion.yml +trigger: none # We only want to trigger manually or based on a schedule +pr: none #schedules: #- cron: "0 3 * * *" # Daily @ 8 PM PST # displayName: Daily vs-insertion @@ -23,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: ForceOfficialBuild - displayName: Official build (sign, compliance, etc.) - type: boolean - default: false # this should remain false so PR builds using this pipeline are unofficial # - name: ShouldSkipOptimize # Uncomment this and references to it below when setting EnableOptProf to true in build.yml. # displayName: Skip OptProf optimization # type: boolean @@ -43,6 +27,10 @@ parameters: displayName: Include APIScan with compliance tools type: boolean default: false # enable in individual repos only AFTER updating TSAOptions.json with your own values +- name: PublishCodeCoverage + displayName: Publish code coverage + type: boolean + default: true resources: repositories: @@ -55,75 +43,45 @@ variables: - template: GlobalVariables.yml extends: - ${{ if or(parameters.ForceOfficialBuild, eq(variables['Build.Reason'],'Schedule')) }}: - template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate - parameters: - sdl: - sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES - codeSignValidation: - enabled: true - break: true - additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\** - policheck: - enabled: true - exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml - suppression: - suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress - sbom: - enabled: true - stages: - - stage: Build - variables: - - template: /azure-pipelines/BuildStageVariables.yml@self - jobs: - - template: /azure-pipelines/build.yml@self - parameters: - Is1ESPT: true - RealSign: true - # ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }} - EnableAPIScan: ${{ and(parameters.EnableAPIScan, ne(variables['Build.Reason'], 'pullRequest')) }} - windowsPool: VSEngSS-MicroBuild2022-1ES - linuxPool: - name: AzurePipelines-EO - demands: - - ImageOverride -equals 1ESPT-Ubuntu22.04 - os: Linux - macOSPool: - name: Azure Pipelines - vmImage: macOS-12 - os: macOS - EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }} - RunTests: ${{ parameters.RunTests }} - - template: /azure-pipelines/prepare-insertion-stages.yml@self + template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate + parameters: + sdl: + sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES + codeSignValidation: + enabled: true + break: true + additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|LocBin-*\**;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\** + policheck: + enabled: true + exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml + suppression: + suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress + sbom: + enabled: false # Skip 1ES SBOM because microbuild has our own sbom system + stages: + - stage: Build + variables: + - template: /azure-pipelines/BuildStageVariables.yml@self + jobs: + - template: /azure-pipelines/build.yml@self parameters: + Is1ESPT: true RealSign: true - ${{ else }}: - template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate - parameters: - sdl: - sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES - suppression: - suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress - stages: - - stage: Build - variables: - - template: /azure-pipelines/BuildStageVariables.yml@self - jobs: - - template: /azure-pipelines/build.yml@self - parameters: - Is1ESPT: true - RealSign: false - # ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }} - EnableAPIScan: false - windowsPool: VSEngSS-MicroBuild2022-1ES - linuxPool: - name: AzurePipelines-EO - demands: - - ImageOverride -equals 1ESPT-Ubuntu22.04 - os: Linux - macOSPool: - name: Azure Pipelines - vmImage: macOS-12 - os: macOS - EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }} - RunTests: ${{ parameters.RunTests }} + # ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }} + EnableAPIScan: ${{ parameters.EnableAPIScan }} + windowsPool: VSEngSS-MicroBuild2022-1ES + linuxPool: + name: AzurePipelines-EO + demands: + - ImageOverride -equals 1ESPT-Ubuntu22.04 + os: Linux + macOSPool: + name: Azure Pipelines + vmImage: macOS-14 + os: macOS + EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }} + RunTests: ${{ parameters.RunTests }} + PublishCodeCoverage: ${{ parameters.PublishCodeCoverage }} + - template: /azure-pipelines/prepare-insertion-stages.yml@self + parameters: + RealSign: true diff --git a/azure-pipelines/prepare-insertion-stages.yml b/azure-pipelines/prepare-insertion-stages.yml index e838b424..46033d67 100644 --- a/azure-pipelines/prepare-insertion-stages.yml +++ b/azure-pipelines/prepare-insertion-stages.yml @@ -23,7 +23,7 @@ stages: - download: current artifact: Variables-Windows displayName: ๐Ÿ”ป Download Variables-Windows artifact - - powershell: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1 + - powershell: $(Pipeline.Workspace)/Variables-Windows/_define.ps1 displayName: โš™๏ธ Set pipeline variables based on artifacts - download: current artifact: symbols-legacy @@ -66,7 +66,7 @@ stages: - download: current artifact: Variables-Windows displayName: ๐Ÿ”ป Download Variables-Windows artifact - - powershell: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1 + - powershell: $(Pipeline.Workspace)/Variables-Windows/_define.ps1 displayName: โš™๏ธ Set pipeline variables based on artifacts - download: current artifact: deployables-Windows diff --git a/azure-pipelines/publish-symbols.yml b/azure-pipelines/publish-symbols.yml index 9078ea25..e2ce081e 100644 --- a/azure-pipelines/publish-symbols.yml +++ b/azure-pipelines/publish-symbols.yml @@ -63,5 +63,5 @@ steps: SymbolServerType: TeamServices displayName: ๐Ÿ“ข Publish test symbols -- powershell: azure-pipelines/Prepare-Legacy-Symbols.ps1 -Path $(Pipeline.Workspace)/symbols/Windows +- powershell: tools/Prepare-Legacy-Symbols.ps1 -Path $(Pipeline.Workspace)/symbols/Windows displayName: โš™ Prepare symbols for symbol archival diff --git a/azure-pipelines/artifacts/_pipelines.ps1 b/azure-pipelines/publish_artifacts.ps1 similarity index 87% rename from azure-pipelines/artifacts/_pipelines.ps1 rename to azure-pipelines/publish_artifacts.ps1 index 47321ed5..3f35cc6e 100644 --- a/azure-pipelines/artifacts/_pipelines.ps1 +++ b/azure-pipelines/publish_artifacts.ps1 @@ -16,7 +16,7 @@ Function Set-PipelineVariable($name, $value) { return # already set } - #New-Item -Path "Env:\$name".ToUpper() -Value $value -Force | Out-Null + #New-Item -LiteralPath "Env:\$name".ToUpper() -Value $value -Force | Out-Null Write-Host "##vso[task.setvariable variable=$name]$value" } @@ -25,7 +25,7 @@ Function Test-ArtifactUploaded($artifactName) { Test-Path "env:$varName" } -& "$PSScriptRoot/_stage_all.ps1" -ArtifactNameSuffix $ArtifactNameSuffix -AvoidSymbolicLinks:$AvoidSymbolicLinks |% { +& "$PSScriptRoot/../tools/artifacts/_stage_all.ps1" -ArtifactNameSuffix $ArtifactNameSuffix -AvoidSymbolicLinks:$AvoidSymbolicLinks |% { # Set a variable which will out-live this script so that a subsequent attempt to collect and upload artifacts # will skip this one from a check in the _all.ps1 script. Set-PipelineVariable "ARTIFACTSTAGED_$($_.Name.ToUpper())" 'true' diff --git a/azure-pipelines/release-deployment-prep.yml b/azure-pipelines/release-deployment-prep.yml index d9a9ffd3..17008b59 100644 --- a/azure-pipelines/release-deployment-prep.yml +++ b/azure-pipelines/release-deployment-prep.yml @@ -2,5 +2,5 @@ steps: - download: CI artifact: Variables-Windows displayName: ๐Ÿ”ป Download Variables-Windows artifact -- powershell: $(Pipeline.Workspace)/CI/Variables-Windows/_pipelines.ps1 +- powershell: $(Pipeline.Workspace)/CI/Variables-Windows/_define.ps1 displayName: โš™๏ธ Set pipeline variables based on artifacts diff --git a/azure-pipelines/unofficial.yml b/azure-pipelines/unofficial.yml new file mode 100644 index 00000000..9ca100ea --- /dev/null +++ b/azure-pipelines/unofficial.yml @@ -0,0 +1,96 @@ +trigger: + batch: true + branches: + include: + - main + - microbuild + - 'validate/*' + paths: + exclude: + - doc/ + - '*.md' + - .vscode/ + - azure-pipelines/release.yml + - azure-pipelines/vs-insertion.yml + +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 + default: false # macOS is often bogged down in Azure Pipelines +- name: RunTests + displayName: Run tests + type: boolean + default: true +- name: EnableAPIScan + displayName: Include APIScan with compliance tools + type: boolean + default: false +- name: EnableProductionSDL + displayName: Enable Production SDL + type: boolean + default: false +- name: PublishCodeCoverage + displayName: Publish code coverage + type: boolean + default: true + +resources: + repositories: + - repository: MicroBuildTemplate + type: git + name: 1ESPipelineTemplates/MicroBuildTemplate + ref: refs/tags/release + +variables: +- template: GlobalVariables.yml + +extends: + template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate + parameters: + sdl: + sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES + suppression: + suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress + enableProductionSDL: ${{ parameters.EnableProductionSDL }} + codeSignValidation: + enabled: ${{ parameters.EnableProductionSDL }} + break: true + additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\** + policyFile: $(MBSIGN_APPFOLDER)\CSVTestSignPolicy.xml + policheck: + enabled: ${{ parameters.EnableProductionSDL }} + exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml + sbom: + enabled: false # Skip 1ES SBOM because microbuild has our own sbom system + stages: + - stage: Build + variables: + - template: /azure-pipelines/BuildStageVariables.yml@self + jobs: + - template: /azure-pipelines/build.yml@self + parameters: + Is1ESPT: true + RealSign: false + # ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }} + EnableAPIScan: ${{ parameters.EnableAPIScan }} + windowsPool: VSEngSS-MicroBuild2022-1ES + linuxPool: + name: AzurePipelines-EO + demands: + - ImageOverride -equals 1ESPT-Ubuntu22.04 + os: Linux + macOSPool: + name: Azure Pipelines + vmImage: macOS-14 + os: macOS + EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }} + RunTests: ${{ parameters.RunTests }} + PublishCodeCoverage: ${{ parameters.PublishCodeCoverage }} diff --git a/azure-pipelines/variables/DotNetSdkVersion.ps1 b/azure-pipelines/variables/DotNetSdkVersion.ps1 deleted file mode 100644 index b213fbc2..00000000 --- a/azure-pipelines/variables/DotNetSdkVersion.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -$globalJson = Get-Content -Path "$PSScriptRoot\..\..\global.json" | ConvertFrom-Json -$globalJson.sdk.version diff --git a/azure-pipelines/vs-insertion.yml b/azure-pipelines/vs-insertion.yml index add241f0..c19331d4 100644 --- a/azure-pipelines/vs-insertion.yml +++ b/azure-pipelines/vs-insertion.yml @@ -32,6 +32,8 @@ extends: - job: insertion displayName: VS insertion pool: VSEngSS-MicroBuild2022-1ES + templateContext: + outputParentDirectory: $(Pipeline.Workspace)/CI steps: - checkout: none - powershell: Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)" @@ -54,13 +56,13 @@ extends: packageParentPath: $(Pipeline.Workspace)/CI/VSInsertion-Windows allowPackageConflicts: true publishVstsFeed: VS - - task: MicroBuildInsertVsPayload@4 + - task: MicroBuildInsertVsPayload@5 displayName: ๐Ÿญ Insert VS Payload inputs: TeamName: $(TeamName) TeamEmail: $(TeamEmail) InsertionPayloadName: $(Build.Repository.Name) $(Build.BuildNumber) - InsertionBuildPolicy: Request Perf DDRITs + InsertionBuildPolicies: Request Perf DDRITs InsertionReviewers: $(Build.RequestedFor) # Append `,Your team name` (without quotes) AutoCompletePR: true AutoCompleteMergeStrategy: Squash diff --git a/azure-pipelines/vs-validation.yml b/azure-pipelines/vs-validation.yml index 1bb9f22e..1b415b22 100644 --- a/azure-pipelines/vs-validation.yml +++ b/azure-pipelines/vs-validation.yml @@ -5,6 +5,12 @@ 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 @@ -36,6 +42,7 @@ extends: parameters: Is1ESPT: true RealSign: false + # ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }} windowsPool: VSEngSS-MicroBuild2022-1ES linuxPool: name: AzurePipelines-EO @@ -44,7 +51,7 @@ extends: os: Linux macOSPool: name: Azure Pipelines - vmImage: macOS-12 + vmImage: macOS-14 os: macOS EnableMacOSBuild: false RunTests: false @@ -68,7 +75,7 @@ extends: - download: current artifact: Variables-Windows displayName: ๐Ÿ”ป Download Variables-Windows artifact - - powershell: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1 + - powershell: $(Pipeline.Workspace)/Variables-Windows/_define.ps1 displayName: โš™๏ธ Set pipeline variables based on artifacts - download: current artifact: VSInsertion-Windows @@ -87,7 +94,7 @@ extends: packageParentPath: $(Pipeline.Workspace)/VSInsertion-Windows allowPackageConflicts: true publishVstsFeed: VS - - task: MicroBuildInsertVsPayload@4 + - task: MicroBuildInsertVsPayload@5 displayName: ๐Ÿญ Insert VS Payload inputs: TeamName: $(TeamName) @@ -96,7 +103,7 @@ extends: InsertionDescription: | This PR is for **validation purposes only** for !$(System.PullRequest.PullRequestId). **Do not complete**. CustomScriptExecutionCommand: src/VSSDK/NuGet/AllowUnstablePackages.ps1 - InsertionBuildPolicy: Request Perf DDRITs + 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 diff --git a/docfx/.gitignore b/docfx/.gitignore new file mode 100644 index 00000000..d5bcab17 --- /dev/null +++ b/docfx/.gitignore @@ -0,0 +1,2 @@ +_site/ +api/ diff --git a/docfx/docfx.json b/docfx/docfx.json new file mode 100644 index 00000000..0b551e91 --- /dev/null +++ b/docfx/docfx.json @@ -0,0 +1,48 @@ +{ + "metadata": [ + { + "src": [ + { + "src": "../src", + "files": [ + "**/*.csproj" + ] + } + ], + "dest": "api" + } + ], + "build": { + "content": [ + { + "files": [ + "**/*.{md,yml}" + ], + "exclude": [ + "_site/**" + ] + } + ], + "resource": [ + { + "files": [ + "images/**" + ] + } + ], + "xref": [ + "https://learn.microsoft.com/en-us/dotnet/.xrefmap.json" + ], + "output": "_site", + "template": [ + "default", + "modern" + ], + "globalMetadata": { + "_appName": "Library", + "_appTitle": "Library", + "_enableSearch": true, + "pdf": false + } + } +} diff --git a/docfx/docs/features.md b/docfx/docs/features.md new file mode 100644 index 00000000..eb3fbeb0 --- /dev/null +++ b/docfx/docs/features.md @@ -0,0 +1,3 @@ +# Features + +TODO diff --git a/docfx/docs/getting-started.md b/docfx/docs/getting-started.md new file mode 100644 index 00000000..eff2c2fb --- /dev/null +++ b/docfx/docs/getting-started.md @@ -0,0 +1,12 @@ +# Getting Started + +## Installation + +Consume this library via its NuGet Package. +Click on the badge to find its latest version and the instructions for consuming it that best apply to your project. + +[![NuGet package](https://img.shields.io/nuget/v/Library.svg)](https://nuget.org/packages/Library) + +## Usage + +TODO diff --git a/docfx/docs/toc.yml b/docfx/docs/toc.yml new file mode 100644 index 00000000..518ffadd --- /dev/null +++ b/docfx/docs/toc.yml @@ -0,0 +1,5 @@ +items: +- name: Features + href: features.md +- name: Getting Started + href: getting-started.md diff --git a/docfx/index.md b/docfx/index.md new file mode 100644 index 00000000..391ee6ec --- /dev/null +++ b/docfx/index.md @@ -0,0 +1,9 @@ +--- +_layout: landing +--- + +# Overview + +This is your docfx landing page. + +Click "Docs" across the top to get started. diff --git a/docfx/toc.yml b/docfx/toc.yml new file mode 100644 index 00000000..8e9a6700 --- /dev/null +++ b/docfx/toc.yml @@ -0,0 +1,5 @@ +items: +- name: Docs + href: docs/ +- name: API + href: api/ diff --git a/global.json b/global.json index 9b900542..23d6c1b3 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.100", + "version": "9.0.202", "rollForward": "patch", "allowPrerelease": false }, diff --git a/init.ps1 b/init.ps1 index 5a31bea7..cac6b68d 100644 --- a/init.ps1 +++ b/init.ps1 @@ -94,7 +94,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\azure-pipelines\Get-ProcDump.ps1" + $EnvVars['PROCDUMP_PATH'] = & "$PSScriptRoot\tools\Get-ProcDump.ps1" } } diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index a6e0f4ac..9f32cd06 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -1,4 +1,8 @@ + + + + diff --git a/test/Microsoft.VisualStudio.Jdt.Tests/xunit.runner.json b/test/Microsoft.VisualStudio.Jdt.Tests/xunit.runner.json new file mode 100644 index 00000000..8465a454 --- /dev/null +++ b/test/Microsoft.VisualStudio.Jdt.Tests/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "shadowCopy": false +} diff --git a/azure-pipelines/Convert-PDB.ps1 b/tools/Convert-PDB.ps1 similarity index 100% rename from azure-pipelines/Convert-PDB.ps1 rename to tools/Convert-PDB.ps1 diff --git a/azure-pipelines/Get-ArtifactsStagingDirectory.ps1 b/tools/Get-ArtifactsStagingDirectory.ps1 similarity index 86% rename from azure-pipelines/Get-ArtifactsStagingDirectory.ps1 rename to tools/Get-ArtifactsStagingDirectory.ps1 index 391e5713..18967f4c 100644 --- a/azure-pipelines/Get-ArtifactsStagingDirectory.ps1 +++ b/tools/Get-ArtifactsStagingDirectory.ps1 @@ -4,7 +4,7 @@ Param( if ($env:BUILD_ARTIFACTSTAGINGDIRECTORY) { $ArtifactStagingFolder = $env:BUILD_ARTIFACTSTAGINGDIRECTORY } elseif ($env:RUNNER_TEMP) { - $ArtifactStagingFolder = "$env:RUNNER_TEMP\_artifacts" + $ArtifactStagingFolder = Join-Path $env:RUNNER_TEMP _artifacts } else { $ArtifactStagingFolder = [System.IO.Path]::GetFullPath("$PSScriptRoot/../obj/_artifacts") if ($CleanIfLocal -and (Test-Path $ArtifactStagingFolder)) { diff --git a/azure-pipelines/Get-CodeCovTool.ps1 b/tools/Get-CodeCovTool.ps1 similarity index 97% rename from azure-pipelines/Get-CodeCovTool.ps1 rename to tools/Get-CodeCovTool.ps1 index ca580b4d..734ee607 100644 --- a/azure-pipelines/Get-CodeCovTool.ps1 +++ b/tools/Get-CodeCovTool.ps1 @@ -68,7 +68,7 @@ if (!(Test-Path $finalToolPath)) { } Write-Host "Verifying hash on downloaded tool" -ForegroundColor Yellow - $actualHash = (Get-FileHash -Path $tool -Algorithm SHA256).Hash + $actualHash = (Get-FileHash -LiteralPath $tool -Algorithm SHA256).Hash $expectedHash = (Get-Content $sha).Split()[0] if ($actualHash -ne $expectedHash) { # Validation failed. Delete the tool so we can't execute it. diff --git a/azure-pipelines/Get-LibTemplateBasis.ps1 b/tools/Get-LibTemplateBasis.ps1 similarity index 100% rename from azure-pipelines/Get-LibTemplateBasis.ps1 rename to tools/Get-LibTemplateBasis.ps1 diff --git a/azure-pipelines/Get-NuGetTool.ps1 b/tools/Get-NuGetTool.ps1 similarity index 95% rename from azure-pipelines/Get-NuGetTool.ps1 rename to tools/Get-NuGetTool.ps1 index 3097c873..8a3b9eed 100644 --- a/azure-pipelines/Get-NuGetTool.ps1 +++ b/tools/Get-NuGetTool.ps1 @@ -6,7 +6,7 @@ #> Param( [Parameter()] - [string]$NuGetVersion='6.4.0' + [string]$NuGetVersion='6.12.2' ) $toolsPath = & "$PSScriptRoot\Get-TempToolsPath.ps1" diff --git a/azure-pipelines/Get-ProcDump.ps1 b/tools/Get-ProcDump.ps1 similarity index 100% rename from azure-pipelines/Get-ProcDump.ps1 rename to tools/Get-ProcDump.ps1 diff --git a/azure-pipelines/Get-SymbolFiles.ps1 b/tools/Get-SymbolFiles.ps1 similarity index 100% rename from azure-pipelines/Get-SymbolFiles.ps1 rename to tools/Get-SymbolFiles.ps1 diff --git a/azure-pipelines/Get-TempToolsPath.ps1 b/tools/Get-TempToolsPath.ps1 similarity index 100% rename from azure-pipelines/Get-TempToolsPath.ps1 rename to tools/Get-TempToolsPath.ps1 diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index e190fcfb..e08571bc 100644 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -36,7 +36,7 @@ if (!(Test-Path $DotNetInstallScriptRoot)) { New-Item -ItemType Directory -Path $DotNetInstallScriptRoot = Resolve-Path $DotNetInstallScriptRoot # Look up actual required .NET SDK version from global.json -$sdkVersion = & "$PSScriptRoot/../azure-pipelines/variables/DotNetSdkVersion.ps1" +$sdkVersion = & "$PSScriptRoot/variables/DotNetSdkVersion.ps1" If ($IncludeX86 -and ($IsMacOS -or $IsLinux)) { Write-Verbose "Ignoring -IncludeX86 switch because 32-bit runtimes are only supported on Windows." @@ -55,8 +55,8 @@ $runtimeVersions = @() $windowsDesktopRuntimeVersions = @() $aspnetRuntimeVersions = @() if (!$SdkOnly) { - Get-ChildItem "$PSScriptRoot\..\src\*.*proj","$PSScriptRoot\..\test\*.*proj","$PSScriptRoot\..\Directory.Build.props" -Recurse |% { - $projXml = [xml](Get-Content -Path $_) + Get-ChildItem "$PSScriptRoot\..\src\*.*proj", "$PSScriptRoot\..\test\*.*proj", "$PSScriptRoot\..\Directory.Build.props" -Recurse | % { + $projXml = [xml](Get-Content -LiteralPath $_) $pg = $projXml.Project.PropertyGroup if ($pg) { $targetFrameworks = @() diff --git a/tools/Install-NuGetCredProvider.ps1 b/tools/Install-NuGetCredProvider.ps1 index 857324b6..b776f56d 100644 --- a/tools/Install-NuGetCredProvider.ps1 +++ b/tools/Install-NuGetCredProvider.ps1 @@ -21,7 +21,7 @@ Param ( $envVars = @{} -$toolsPath = & "$PSScriptRoot\..\azure-pipelines\Get-TempToolsPath.ps1" +$toolsPath = & "$PSScriptRoot\Get-TempToolsPath.ps1" if ($IsMacOS -or $IsLinux) { $installerScript = "installcredprovider.sh" @@ -50,7 +50,7 @@ if ($AccessToken) { $endpointURIs = @() Get-ChildItem "$PSScriptRoot\..\nuget.config" -Recurse |% { - $nugetConfig = [xml](Get-Content -Path $_) + $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) { diff --git a/tools/MergeFrom-Template.ps1 b/tools/MergeFrom-Template.ps1 index 3f721c6a..240a5709 100644 --- a/tools/MergeFrom-Template.ps1 +++ b/tools/MergeFrom-Template.ps1 @@ -36,7 +36,7 @@ Function Spawn-Tool($command, $commandArgs, $workingDirectory, $allowFailures) { } } -$remoteBranch = & $PSScriptRoot\..\azure-pipelines\Get-LibTemplateBasis.ps1 -ErrorIfNotRelated +$remoteBranch = & $PSScriptRoot\Get-LibTemplateBasis.ps1 -ErrorIfNotRelated if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/azure-pipelines/Prepare-Legacy-Symbols.ps1 b/tools/Prepare-Legacy-Symbols.ps1 similarity index 100% rename from azure-pipelines/Prepare-Legacy-Symbols.ps1 rename to tools/Prepare-Legacy-Symbols.ps1 diff --git a/tools/Set-EnvVars.ps1 b/tools/Set-EnvVars.ps1 index 3f6f86ba..2bd3ca4d 100644 --- a/tools/Set-EnvVars.ps1 +++ b/tools/Set-EnvVars.ps1 @@ -45,14 +45,14 @@ if ($env:GITHUB_ACTIONS) { $CmdEnvScript = '' $Variables.GetEnumerator() |% { - Set-Item -Path env:$($_.Key) -Value $_.Value + 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 -Path $env:GITHUB_ENV -Value "$($_.Key)=$($_.Value)" + Add-Content -LiteralPath $env:GITHUB_ENV -Value "$($_.Key)=$($_.Value)" } if ($cmdInstructions) { @@ -70,7 +70,7 @@ if ($IsMacOS -or $IsLinux) { if ($PrependPath) { $PrependPath |% { $newPathValue = "$_$pathDelimiter$env:PATH" - Set-Item -Path env:PATH -Value $newPathValue + Set-Item -LiteralPath env:PATH -Value $newPathValue if ($cmdInstructions) { Write-Host "SET PATH=$newPathValue" } @@ -79,7 +79,7 @@ if ($PrependPath) { Write-Host "##vso[task.prependpath]$_" } if ($env:GITHUB_ACTIONS) { - Add-Content -Path $env:GITHUB_PATH -Value $_ + Add-Content -LiteralPath $env:GITHUB_PATH -Value $_ } $CmdEnvScript += "SET PATH=$_$pathDelimiter%PATH%" @@ -88,10 +88,10 @@ if ($PrependPath) { if ($env:CmdEnvScriptPath) { if (Test-Path $env:CmdEnvScriptPath) { - $CmdEnvScript = (Get-Content -Path $env:CmdEnvScriptPath) + $CmdEnvScript + $CmdEnvScript = (Get-Content -LiteralPath $env:CmdEnvScriptPath) + $CmdEnvScript } - Set-Content -Path $env:CmdEnvScriptPath -Value $CmdEnvScript + Set-Content -LiteralPath $env:CmdEnvScriptPath -Value $CmdEnvScript } return !$cmdInstructions diff --git a/azure-pipelines/artifacts/APIScanInputs.ps1 b/tools/artifacts/APIScanInputs.ps1 similarity index 100% rename from azure-pipelines/artifacts/APIScanInputs.ps1 rename to tools/artifacts/APIScanInputs.ps1 diff --git a/azure-pipelines/artifacts/LocBin.ps1 b/tools/artifacts/LocBin.ps1 similarity index 100% rename from azure-pipelines/artifacts/LocBin.ps1 rename to tools/artifacts/LocBin.ps1 diff --git a/azure-pipelines/artifacts/VSInsertion.ps1 b/tools/artifacts/VSInsertion.ps1 similarity index 100% rename from azure-pipelines/artifacts/VSInsertion.ps1 rename to tools/artifacts/VSInsertion.ps1 diff --git a/azure-pipelines/artifacts/Variables.ps1 b/tools/artifacts/Variables.ps1 similarity index 92% rename from azure-pipelines/artifacts/Variables.ps1 rename to tools/artifacts/Variables.ps1 index 4bc6d216..7a320c7e 100644 --- a/azure-pipelines/artifacts/Variables.ps1 +++ b/tools/artifacts/Variables.ps1 @@ -32,10 +32,10 @@ Get-ChildItem "$PSScriptRoot/../variables" |% { # If that didn't get us anything, just copy the script itself if (-not $value) { - $value = Get-Content -Path $_.FullName + $value = Get-Content -LiteralPath $_.FullName } - Set-Content -Path "$VariablesArtifactPath/$($_.Name)" -Value $value + Set-Content -LiteralPath "$VariablesArtifactPath/$($_.Name)" -Value $value } @{ diff --git a/azure-pipelines/artifacts/_all.ps1 b/tools/artifacts/_all.ps1 similarity index 100% rename from azure-pipelines/artifacts/_all.ps1 rename to tools/artifacts/_all.ps1 diff --git a/azure-pipelines/artifacts/_stage_all.ps1 b/tools/artifacts/_stage_all.ps1 similarity index 97% rename from azure-pipelines/artifacts/_stage_all.ps1 rename to tools/artifacts/_stage_all.ps1 index 74d7a38d..bf961ce5 100644 --- a/azure-pipelines/artifacts/_stage_all.ps1 +++ b/tools/artifacts/_stage_all.ps1 @@ -51,7 +51,7 @@ $Artifacts |% { if (Test-Path -PathType Leaf $_.Source) { # skip folders $TargetPath = Join-Path $DestinationFolder $Name if ($AvoidSymbolicLinks) { - Copy-Item -Path $_.Source -Destination $TargetPath + Copy-Item -LiteralPath $_.Source -Destination $TargetPath } else { Create-SymbolicLink -Link $TargetPath -Target $_.Source } diff --git a/azure-pipelines/artifacts/build_logs.ps1 b/tools/artifacts/build_logs.ps1 similarity index 100% rename from azure-pipelines/artifacts/build_logs.ps1 rename to tools/artifacts/build_logs.ps1 diff --git a/azure-pipelines/artifacts/coverageResults.ps1 b/tools/artifacts/coverageResults.ps1 similarity index 52% rename from azure-pipelines/artifacts/coverageResults.ps1 rename to tools/artifacts/coverageResults.ps1 index 280ff9ae..8c68216e 100644 --- a/azure-pipelines/artifacts/coverageResults.ps1 +++ b/tools/artifacts/coverageResults.ps1 @@ -3,14 +3,16 @@ $RepoRoot = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\..") $coverageFiles = @(Get-ChildItem "$RepoRoot/test/*.cobertura.xml" -Recurse | Where {$_.FullName -notlike "*/In/*" -and $_.FullName -notlike "*\In\*" }) # Prepare code coverage reports for merging on another machine -if ($env:SYSTEM_DEFAULTWORKINGDIRECTORY) { - Write-Host "Substituting $env:SYSTEM_DEFAULTWORKINGDIRECTORY with `"{reporoot}`"" +$repoRoot = $env:SYSTEM_DEFAULTWORKINGDIRECTORY +if (!$repoRoot) { $repoRoot = $env:GITHUB_WORKSPACE } +if ($repoRoot) { + Write-Host "Substituting $repoRoot with `"{reporoot}`"" $coverageFiles |% { - $content = Get-Content -Path $_ |% { $_ -Replace [regex]::Escape($env:SYSTEM_DEFAULTWORKINGDIRECTORY), "{reporoot}" } - Set-Content -Path $_ -Value $content -Encoding UTF8 + $content = Get-Content -LiteralPath $_ |% { $_ -Replace [regex]::Escape($repoRoot), "{reporoot}" } + Set-Content -LiteralPath $_ -Value $content -Encoding UTF8 } } else { - Write-Warning "coverageResults: Azure Pipelines not detected. Machine-neutral token replacement skipped." + Write-Warning "coverageResults: Cloud build not detected. Machine-neutral token replacement skipped." } if (!((Test-Path $RepoRoot\bin) -and (Test-Path $RepoRoot\obj))) { return } diff --git a/azure-pipelines/artifacts/deployables.ps1 b/tools/artifacts/deployables.ps1 similarity index 100% rename from azure-pipelines/artifacts/deployables.ps1 rename to tools/artifacts/deployables.ps1 diff --git a/azure-pipelines/artifacts/projectAssetsJson.ps1 b/tools/artifacts/projectAssetsJson.ps1 similarity index 100% rename from azure-pipelines/artifacts/projectAssetsJson.ps1 rename to tools/artifacts/projectAssetsJson.ps1 diff --git a/azure-pipelines/artifacts/symbols.ps1 b/tools/artifacts/symbols.ps1 similarity index 100% rename from azure-pipelines/artifacts/symbols.ps1 rename to tools/artifacts/symbols.ps1 diff --git a/azure-pipelines/artifacts/testResults.ps1 b/tools/artifacts/testResults.ps1 similarity index 56% rename from azure-pipelines/artifacts/testResults.ps1 rename to tools/artifacts/testResults.ps1 index 301a4376..5310fb52 100644 --- a/azure-pipelines/artifacts/testResults.ps1 +++ b/tools/artifacts/testResults.ps1 @@ -7,9 +7,10 @@ $result = @{} $testRoot = Resolve-Path "$PSScriptRoot\..\..\test" $result[$testRoot] = (Get-ChildItem "$testRoot\TestResults" -Recurse -Directory | Get-ChildItem -Recurse -File) -$testlogsPath = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\test_logs" +$artifactStaging = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1" +$testlogsPath = Join-Path $artifactStaging "test_logs" if (Test-Path $testlogsPath) { - $result[$testlogsPath] = Get-ChildItem "$testlogsPath\*"; + $result[$testlogsPath] = Get-ChildItem $testlogsPath -Recurse; } $result diff --git a/azure-pipelines/artifacts/test_symbols.ps1 b/tools/artifacts/test_symbols.ps1 similarity index 100% rename from azure-pipelines/artifacts/test_symbols.ps1 rename to tools/artifacts/test_symbols.ps1 diff --git a/azure-pipelines/dotnet-test-cloud.ps1 b/tools/dotnet-test-cloud.ps1 similarity index 89% rename from azure-pipelines/dotnet-test-cloud.ps1 rename to tools/dotnet-test-cloud.ps1 index 56b019e9..74e2ea1d 100644 --- a/azure-pipelines/dotnet-test-cloud.ps1 +++ b/tools/dotnet-test-cloud.ps1 @@ -46,6 +46,9 @@ if ($x86) { } } +$testBinLog = Join-Path $ArtifactStagingFolder (Join-Path build_logs test.binlog) +$testDiagLog = Join-Path $ArtifactStagingFolder (Join-Path test_logs diag.log) + & $dotnet test "$RepoRoot\test\Microsoft.VisualStudio.Jdt.Tests"` --no-build ` -c $Configuration ` @@ -54,8 +57,8 @@ if ($x86) { --settings "$PSScriptRoot/test.runsettings" ` --blame-hang-timeout 60s ` --blame-crash ` - -bl:"$ArtifactStagingFolder/build_logs/test.binlog" ` - --diag "$ArtifactStagingFolder/test_logs/diag.log;TraceLevel=info" ` + -bl:"$testBinLog" ` + --diag "$testDiagLog;TraceLevel=info" ` --logger trx ` $unknownCounter = 0 @@ -63,11 +66,11 @@ Get-ChildItem -Recurse -Path $RepoRoot\test\*.trx | % { Copy-Item $_ -Destination $ArtifactStagingFolder/test_logs/ if ($PublishResults) { - $x = [xml](Get-Content -Path $_) + $x = [xml](Get-Content -LiteralPath $_) $runTitle = $null if ($x.TestRun.TestDefinitions -and $x.TestRun.TestDefinitions.GetElementsByTagName('UnitTest')) { $storage = $x.TestRun.TestDefinitions.GetElementsByTagName('UnitTest')[0].storage -replace '\\', '/' - if ($storage -match '/(?net[^/]+)/(?:(?[^/]+)/)?(?[^/]+)\.dll$') { + if ($storage -match '/(?net[^/]+)/(?:(?[^/]+)/)?(?[^/]+)\.(dll|exe)$') { if ($matches.rid) { $runTitle = "$($matches.lib) ($($matches.tfm), $($matches.rid), $Agent)" } diff --git a/azure-pipelines/publish-CodeCov.ps1 b/tools/publish-CodeCov.ps1 similarity index 89% rename from azure-pipelines/publish-CodeCov.ps1 rename to tools/publish-CodeCov.ps1 index 9926f018..1d736511 100644 --- a/azure-pipelines/publish-CodeCov.ps1 +++ b/tools/publish-CodeCov.ps1 @@ -22,7 +22,7 @@ Param ( $RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path -Get-ChildItem -Recurse -Path $PathToCodeCoverage -Filter "*.cobertura.xml" | % { +Get-ChildItem -Recurse -LiteralPath $PathToCodeCoverage -Filter "*.cobertura.xml" | % { $relativeFilePath = Resolve-Path -relative $_.FullName Write-Host "Uploading: $relativeFilePath" -ForegroundColor Yellow diff --git a/azure-pipelines/test.runsettings b/tools/test.runsettings similarity index 100% rename from azure-pipelines/test.runsettings rename to tools/test.runsettings diff --git a/azure-pipelines/variables/BusinessGroupName.ps1 b/tools/variables/BusinessGroupName.ps1 similarity index 100% rename from azure-pipelines/variables/BusinessGroupName.ps1 rename to tools/variables/BusinessGroupName.ps1 diff --git a/tools/variables/DotNetSdkVersion.ps1 b/tools/variables/DotNetSdkVersion.ps1 new file mode 100644 index 00000000..722cc584 --- /dev/null +++ b/tools/variables/DotNetSdkVersion.ps1 @@ -0,0 +1,2 @@ +$globalJson = Get-Content -LiteralPath "$PSScriptRoot\..\..\global.json" | ConvertFrom-Json +$globalJson.sdk.version diff --git a/azure-pipelines/variables/InsertJsonValues.ps1 b/tools/variables/InsertJsonValues.ps1 similarity index 81% rename from azure-pipelines/variables/InsertJsonValues.ps1 rename to tools/variables/InsertJsonValues.ps1 index 807ca1cb..7aa8d30c 100644 --- a/azure-pipelines/variables/InsertJsonValues.ps1 +++ b/tools/variables/InsertJsonValues.ps1 @@ -11,7 +11,7 @@ if (Test-Path $BasePath) { Get-ChildItem $BasePath *.vsman -Recurse -File |% { $version = (Get-Content $_.FullName | ConvertFrom-Json).info.buildVersion $fn = $_.Name - $vsmanFiles += "LibraryName.vsman{$version}=https://vsdrop.corp.microsoft.com/file/v1/$vstsDropNames;$fn" + $vsmanFiles += "$fn{$version}=https://vsdrop.corp.microsoft.com/file/v1/$vstsDropNames;$fn" } [string]::join(',',$vsmanFiles) diff --git a/azure-pipelines/variables/InsertPropsValues.ps1 b/tools/variables/InsertPropsValues.ps1 similarity index 100% rename from azure-pipelines/variables/InsertPropsValues.ps1 rename to tools/variables/InsertPropsValues.ps1 diff --git a/azure-pipelines/variables/InsertTargetBranch.ps1 b/tools/variables/InsertTargetBranch.ps1 similarity index 100% rename from azure-pipelines/variables/InsertTargetBranch.ps1 rename to tools/variables/InsertTargetBranch.ps1 diff --git a/azure-pipelines/variables/InsertVersionsValues.ps1 b/tools/variables/InsertVersionsValues.ps1 similarity index 100% rename from azure-pipelines/variables/InsertVersionsValues.ps1 rename to tools/variables/InsertVersionsValues.ps1 diff --git a/azure-pipelines/variables/LocLanguages.ps1 b/tools/variables/LocLanguages.ps1 similarity index 100% rename from azure-pipelines/variables/LocLanguages.ps1 rename to tools/variables/LocLanguages.ps1 diff --git a/azure-pipelines/variables/ProfilingInputsDropName.ps1 b/tools/variables/ProfilingInputsDropName.ps1 similarity index 100% rename from azure-pipelines/variables/ProfilingInputsDropName.ps1 rename to tools/variables/ProfilingInputsDropName.ps1 diff --git a/azure-pipelines/variables/SymbolsFeatureName.ps1 b/tools/variables/SymbolsFeatureName.ps1 similarity index 100% rename from azure-pipelines/variables/SymbolsFeatureName.ps1 rename to tools/variables/SymbolsFeatureName.ps1 diff --git a/azure-pipelines/variables/VstsDropNames.ps1 b/tools/variables/VstsDropNames.ps1 similarity index 100% rename from azure-pipelines/variables/VstsDropNames.ps1 rename to tools/variables/VstsDropNames.ps1 diff --git a/azure-pipelines/variables/_all.ps1 b/tools/variables/_all.ps1 similarity index 100% rename from azure-pipelines/variables/_all.ps1 rename to tools/variables/_all.ps1 diff --git a/azure-pipelines/variables/_pipelines.ps1 b/tools/variables/_define.ps1 similarity index 90% rename from azure-pipelines/variables/_pipelines.ps1 rename to tools/variables/_define.ps1 index 11748b81..d40e5cf1 100644 --- a/azure-pipelines/variables/_pipelines.ps1 +++ b/tools/variables/_define.ps1 @@ -24,8 +24,8 @@ param ( # and the second that works across jobs and stages but must be fully qualified when referenced. Write-Host "##vso[task.setvariable variable=$keyCaps;isOutput=true]$($_.Value)" } elseif ($env:GITHUB_ACTIONS) { - Add-Content -Path $env:GITHUB_ENV -Value "$keyCaps=$($_.Value)" + Add-Content -LiteralPath $env:GITHUB_ENV -Value "$keyCaps=$($_.Value)" } - Set-Item -Path "env:$keyCaps" -Value $_.Value + Set-Item -LiteralPath "env:$keyCaps" -Value $_.Value } }