Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Azure DevOps Pipelines YAML template used to build, test, pack, and publish .NET
artifactNamePrefix | string | No | | Prefix for artifacts created by this pipeline.
dpi | object | No | | Settings relating to Dependency reports using DPI tool
toolRestore | bool | No | false | Flag to be able to dotnet restore tools before prebuild script in the build pipeline.
shouldBuild | bool | No | true | Flag to control whether the dotnet build step should be executed.


## Pre-Build
Expand Down Expand Up @@ -171,6 +172,7 @@ stages:
skipTests: true/false
projectSrc: projectSrc
toolRestore: true/false
shouldBuild: true/false
useDotNetSDK:
packageType: sdk/runtime
useGlobalJson: true/false
Expand Down
5 changes: 3 additions & 2 deletions dotnet/build_jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
parameters:
preBuildScript: ${{ parameters.preBuildScript }}

- script: dotnet build ${{ parameters.projectSrc }} /p:Version=$(Build.BuildNumber) ${{ join(' ', parameters.buildParameters) }}
displayName: 'DotNet Build'
- ${{ if eq(parameters.shouldBuild, true) }}:
- script: dotnet build ${{ parameters.projectSrc }} /p:Version=$(Build.BuildNumber) ${{ join(' ', parameters.buildParameters) }}
displayName: 'DotNet Build'

- template: ../dotnetcommon/dotnet_dpi.yml
parameters:
Expand Down
1 change: 1 addition & 0 deletions dotnet/build_stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ stages:
dpi: ${{ parameters.dpi }}
toolRestore: ${{ coalesce(parameters.toolRestore, false) }}
postBuildScript: ${{ parameters.postBuildScript }}
shouldBuild: ${{ coalesce(parameters.shouldBuild, true) }}