DotNetCoreCLI - 'pack' does not allow arguments to be passed
See original GitHub issueRequired Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Feature
Enter Task Name: DotNetCoreCLI - pack command should allow arguments to passed like the other commands do.
Environment
Azure Pipelines - Hosted Agent - windows-latest
Issue Description
Currently there is no way to addition arguments to the pack command e.g --no-build --no-restore
This is further limiting as one cannot pass MSBuild properties e.g /p:Property
Attempting the following:
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: 'src/My.Sample.Api/*.csproj'
packDirectory: '$(Build.ArtifactStagingDirectory)/application'
versioningScheme: 'off'
arguments: '/p:NuspecFile=My.Sample.Api.nuspec /p:IsPackable=true --no-build --no-restore'
Does not yield the expected results. The following command is run:
"C:\Program Files\dotnet\dotnet.exe" pack d:\a\1\s\src\My.Sample.Api\My.Sample.Api.csproj --output d:\a\1\a\application /p:Configuration=Release --verbosity Detailed
The arguments are ignored. This is inconsistent with the other commands in the DotNetCoreCLI task like build/restore/etc as mentioned in #9789
The expected result would be
"C:\Program Files\dotnet\dotnet.exe" pack d:\a\1\s\src\My.Sample.Api\My.Sample.Api.csproj --output d:\a\1\a\application /p:Configuration=Release /p:NuspecFile=My.Sample.Api.nuspec /p:IsPackable=true --no-build --no-restore --verbosity Detailed
Issue Analytics
- State:
- Created 4 years ago
- Reactions:22
- Comments:14 (1 by maintainers)
Top GitHub Comments
This is definitely annoying for us also, would like to keep using the glob pattern support for finding the projects, but going custom means there is no advantage whatsoever in using the Task anymore.
Thanks for the example @musmuris. Tweaked it to our requirements and that does work fine, which is as expected.