Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding projects when executing the DotNetCoreCLI@2 task

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?

like image 721
Rune G Avatar asked Nov 21 '19 13:11

Rune G


1 Answers

The following syntax works for me:

projects: |
 **/*.csproj
 !**/*Test.csproj
like image 61
Shayki Abramczyk Avatar answered Nov 08 '22 15:11

Shayki Abramczyk