I am trying to exclude projects when executing the DotNetCoreCLI@2
task with build publish
command. I have some test projects (and others) that I don't want to run publish. I have tried file matching according to this and this, but I can't get to work. The documentation of the projects
property doesn't state exactly how to write exclusions and I have tried the different variants shown below.
Variant 1
projects: '**/*.csproj
!**/*.Test.csproj'
Variant 2
projects: '**/*.csproj
!**/*.Test.csproj'
Variant 3
projects: '**/*.csproj !**/*.Test.csproj'
But all the three reports ##[error]Project file(s) matching the specified pattern were not found.
If I remove the exclusion everything works as expected, but it builds publish of all projects.
Anyone have an advice on how to write it?
The following syntax works for me:
projects: |
**/*.csproj
!**/*Test.csproj
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With