diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index b977945..5706419 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -4,8 +4,17 @@ "tools": { "csharpier": { "version": "1.3.0", - "commands": ["csharpier"], + "commands": [ + "csharpier" + ], "rollForward": true + }, + "purview.build": { + "version": "0.5.3", + "commands": [ + "purview-build" + ], + "rollForward": false } } } diff --git a/Directory.Packages.props b/Directory.Packages.props index 563ff91..63357c6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ 10.10.0 - 5.0.1 + 5.0.3 1.72.4 diff --git a/Justfile b/Justfile index 1d0f766..accea12 100644 --- a/Justfile +++ b/Justfile @@ -10,8 +10,7 @@ solution_file := root_folder + "EngineeringPlaybook.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" # Displays the list of available commands @@ -19,33 +18,31 @@ pipeline_tool := ".tools/purview-build/purview-build" 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 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 }} # ----------------------------------------------------------------------------- # Build and Test diff --git a/docs/wiki/Getting-Started.md b/docs/wiki/Getting-Started.md index 0786709..5b20778 100644 --- a/docs/wiki/Getting-Started.md +++ b/docs/wiki/Getting-Started.md @@ -368,11 +368,20 @@ installed globally per machine: "version": "1.3.0", "commands": ["csharpier"], "rollForward": true + }, + "purview.build": { + "version": "0.5.2", + "commands": ["purview-build"], + "rollForward": false } } } ``` +`Purview.Build` belongs here too, for the same reason CSharpier does: the manifest pins the version, and +`dotnet tool restore` is the one command that installs it. A repository should never hand-roll +`dotnet tool install --tool-path` for it. + Run `dotnet tool restore` once after adding it. `Justfile` at the repository root is the list of supported commands. The point of it is that every @@ -383,7 +392,7 @@ set quiet solution_file := "./src/Acme.slnx" build_configuration := "Debug" -pipeline_tool := ".tools/purview-build/purview-build" +pipeline_tool := "dotnet purview-build" # Builds the solution build *args: @@ -404,11 +413,8 @@ lint-fix: # Runs the PR pipeline (restore, build, lint, tests) through the shared tool pipeline-pr *args: - if [ ! -x "{{ pipeline_tool }}" ]; then \ - dotnet tool install Purview.Build --tool-path .tools/purview-build \ - --add-source "https://api.nuget.org/v3/index.json"; \ - fi - "{{ pipeline_tool }}" {{ args }} + dotnet tool restore + {{ pipeline_tool }} {{ args }} ``` There is deliberately no `Justfile` in `templates/`: the recipes are the list of things *your* repository diff --git a/global.json b/global.json index 7c48b98..ff3df1e 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/templates/Directory.Packages.props b/templates/Directory.Packages.props index 7eb5486..7992c84 100644 --- a/templates/Directory.Packages.props +++ b/templates/Directory.Packages.props @@ -35,7 +35,7 @@ 10.10.0 - 5.0.1 + 5.0.3