16

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?

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Rune G
  • 1,447
  • 2
  • 12
  • 26

1 Answers1

35

The following syntax works for me:

projects: |
 **/*.csproj
 !**/*Test.csproj
Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114