diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index fb057632..42b8dea3 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,6 +15,13 @@ "dotnet-inspect" ], "rollForward": false + }, + "purview.build": { + "version": "0.5.3", + "commands": [ + "purview-build" + ], + "rollForward": false } } } \ No newline at end of file diff --git a/.config/purview-build.json b/.config/purview-build.json index e29fae1f..d6a2629a 100644 --- a/.config/purview-build.json +++ b/.config/purview-build.json @@ -6,6 +6,10 @@ "TestFilter": "/*/*/*/*" }, "PackValidation": { + // Explicit because Purview.Build 0.5.3 defaults RequiredCompilerFlags to empty. Earlier + // versions forced this check on and could not be configured off, so these packages have + // always been validated against it; declaring it keeps that behaviour. + "RequiredCompilerFlags": ["optimization=release"], "RequireSymbolPackage": false, "RequiredContent": { "purview.telemetry.sourcegenerator": [ @@ -20,4 +24,4 @@ "Release": { "Mode": "None" } -} \ No newline at end of file +} diff --git a/AGENTS.md b/AGENTS.md index 0f8804ae..773c0d93 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -64,8 +64,9 @@ conventional-commits check. | `just update-version` | Runs `.build/update-version.ts` to sync the version into docs/samples. | | `just pack` | Updates the version then packs the NuGet package into `artifacts/`. | -The version lives in `package.json`. **Current Version:** 5.0.2 — applied to `Version` / -`PackageVersion` via the SDK's package.json version detection. +The version lives in `package.json`. **Current Version:** `*` — read from `package.json` at build +time and applied to `Version` / `PackageVersion` via the SDK's package.json version detection. Run +`just version` to print the current value; it is deliberately not duplicated here. ### Pipelines (reusable `purview-build` tool) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6fa522a8..96661c3a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,8 +2,8 @@ true 5.9.0 - 1.67.0 - 1.0.0 + 1.74.0 + 1.1.0 10.0.12 10.10.0 1.18.0 diff --git a/Justfile b/Justfile index 075fed5b..939da973 100644 --- a/Justfile +++ b/Justfile @@ -5,8 +5,7 @@ solution_file := root_folder + "Telemetry.SourceGenerator.slnx" test_solution := solution_file build_configuration := "Debug" -pipeline_feed := "https://api.nuget.org/v3/index.json" -pipeline_tool := ".tools/purview-build/purview-build" +pipeline_tool := "dotnet purview-build" sample_solution_file := "./samples/SampleApp/SampleApp.slnx" multiproject_sample_solution_file := "./samples/SampleApp.MultiProject/SampleApp.MultiProject.slnx" @@ -20,33 +19,31 @@ benchmark_solution := "./benchmarks/Purview.Telemetry.Benchmarks/Purview.Telemet default: just --list -# Install the shared Purview.Build tool (authenticated to the Purview-Dev feed) if not present +# Restore the repository's .NET local tools (.config/dotnet-tools.json) [private] ensure-pipeline-tool: - if [ ! -x "{{ pipeline_tool }}" ]; then \ - dotnet tool install Purview.Build --tool-path .tools/purview-build --add-source "{{ pipeline_feed }}"; \ - fi + dotnet tool restore # Run the PR pipeline (restore, build, lint, tests) [group('Pipeline')] pipeline-pr *args: just ensure-pipeline-tool echo "Running PR pipeline..." - "{{ pipeline_tool }}" {{ args }} + {{ pipeline_tool }} {{ args }} # Run the build pipeline (restore, build, lint) [group('Pipeline')] pipeline-build *args: just ensure-pipeline-tool echo "Running build pipeline..." - "{{ pipeline_tool }}" --Build:RunTests=false --Release:Mode=None {{ args }} + {{ pipeline_tool }} --Build:RunTests=false --Release:Mode=None {{ args }} # Run the release pipeline (restore, build, lint, tests, pack, publish, GitHub release) [group('Pipeline')] pipeline-release *args: just ensure-pipeline-tool echo "Running release pipeline..." - "{{ pipeline_tool }}" --Release:Mode=NuGet {{ args }} + {{ pipeline_tool }} --Release:Mode=NuGet {{ args }} # Run the release pipeline (restore, build, lint, tests, pack, local nuget publish) # Note: `just` runs recipes through the shell, which strips backslashes from unquoted arguments. @@ -56,21 +53,21 @@ pipeline-release *args: pipeline-local-release *args: just ensure-pipeline-tool echo "Running local release pipeline..." - "{{ pipeline_tool }}" --Release:Mode=LocalNuGet {{ args }} + {{ pipeline_tool }} --Release:Mode=LocalNuGet {{ args }} # Run the pipeline with tests enabled [group('Pipeline')] pipeline-tests *args: just ensure-pipeline-tool echo "Running tests pipeline..." - "{{ pipeline_tool }}" --Build:RunTests=true --Release:Mode=None {{ args }} + {{ pipeline_tool }} --Build:RunTests=true --Release:Mode=None {{ args }} # Run the pipeline through pack + validate (restore, build, lint, tests, pack, validate pack contents) without publishing/releasing [group('Pipeline')] pipeline-pack-validate *args: just ensure-pipeline-tool echo "Running pack + validate pipeline..." - "{{ pipeline_tool }}" --Build:RunPack=true --Build:ValidatePack=true --Release:Mode=None {{ args }} + {{ pipeline_tool }} --Build:RunPack=true --Build:ValidatePack=true --Release:Mode=None {{ args }} # ----------------------------------------------------------------------------- # Build and Test diff --git a/docs/release-process.md b/docs/release-process.md index 34cce6f7..3e99e21b 100644 --- a/docs/release-process.md +++ b/docs/release-process.md @@ -23,7 +23,7 @@ Feature branch | ----------- | ------ | --------- | | PR gate | `.github/workflows/pr.yml` | Runs the reusable `purview-dev/build` `purview-build.yml` pipeline (restore, build, lint, tests) and builds/tests the sample solution | | CD pipeline | `.github/workflows/release.yml` | Runs the reusable `purview-dev/build` `purview-release.yml` pipeline on push to `main` | -| Local pipeline | `Justfile` `pipeline-*` recipes | Mirror the CI/CD pipelines locally via the `Purview.Build` tool (`.tools/purview-build`) | +| Local pipeline | `Justfile` `pipeline-*` recipes | Mirror the CI/CD pipelines locally via the `Purview.Build` local tool (`dotnet purview-build`) | ## Developer workflow @@ -70,7 +70,7 @@ Merging to `main` triggers `release.yml`, which runs the reusable `purview-relea ## Versioning -- The version lives in `package.json`. **Current Version:** 5.0.2 +- The version lives in `package.json`. **Current Version:** `*` (run `just version` to print it) - It is applied to `Version` / `PackageVersion` by `Purview.BuildSdk` via package.json version detection (`UsePackageJsonVersion`, default `true`). - `just version` prints the current version. diff --git a/docs/wiki/Release-Flow.md b/docs/wiki/Release-Flow.md index 98289bd1..078a04f8 100644 --- a/docs/wiki/Release-Flow.md +++ b/docs/wiki/Release-Flow.md @@ -15,7 +15,7 @@ Feature branch | --- | --- | --- | | PR gate | `.github/workflows/pr.yml` | Runs the reusable `purview-dev/build` `purview-build.yml` pipeline (restore, build, lint, tests) and builds/tests the sample solution. | | CD pipeline | `.github/workflows/release.yml` | Runs the reusable `purview-dev/build` `purview-release.yml` pipeline on push to `main`. | -| Local pipeline | `Justfile` `pipeline-*` recipes | Mirror the CI/CD pipelines locally via the `Purview.Build` tool (`.tools/purview-build`). | +| Local pipeline | `Justfile` `pipeline-*` recipes | Mirror the CI/CD pipelines locally via the `Purview.Build` local tool (`dotnet purview-build`). | ## Developer workflow @@ -27,7 +27,7 @@ Feature branch ## Versioning -- The version lives in `package.json`. **Current Version:** 5.0.0 +- The version lives in `package.json`. **Current Version:** `*` (run `just version` to print it) - It is applied to `Version`/`PackageVersion` by `Purview.BuildSdk` via package.json version detection. - `just version` prints the current version. - After bumping `package.json`, run `just update-version` to sync the version into docs/samples. diff --git a/global.json b/global.json index 9ece9928..5ad43180 100644 --- a/global.json +++ b/global.json @@ -3,7 +3,7 @@ "allowPrerelease": false }, "msbuild-sdks": { - "Purview.BuildSdk": "1.0.4" + "Purview.BuildSdk": "1.0.5" }, "test": { "runner": "Microsoft.Testing.Platform" diff --git a/package.json b/package.json index 5cd1cc09..a165d518 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "purview-telemetry-sourcegenerator", - "version": "5.0.2", + "name": "telemetry-sourcegenerator", + "version": "5.0.3", "description": "Generates [`ActivitySource`](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.activitysource), [`ILogger`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger), and [`Metrics`](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics) based on interface methods.", "license": "MIT", "readme": "README.md",