I have the following build pipeline task:
- task: NuGetCommand@2
displayName: 'Pack CodingStyles.nuspec'
inputs:
command: 'pack'
packagesToPack: 'src\CodingStyles\CodingStyles.nuspec'
packDestination: 'src\CodingStyles\bin'
versioningScheme: 'off'
buildProperties: '-NoDefaultExcludes -Version $(Build_Major).$(Build_Minor).$(Build_Patch)'
However, if the variable $IsPreRelease
is true, I want to add another build property as well:
buildProperties: '-NoDefaultExcludes -Version $(Build_Major).$(Build_Minor).$(Build_Patch) -Suffix beta'
A few thoughts on how to do this:
- I could have two different versions of this task, each with a
condition:
based on the variable. This would probably work, but it's quite redundant since everything else is the same. - Run a Powershell task instead of the NuGetCommand task, and build my command line dynamically.
Any options I'm missing?