6

I am trying to exclude some projects from building in azure pipelines.

I tried the following options...

  • Trying to build only the projects under core?
- script: dotnet build **/Core/*.csproj --configuration $(buildConfiguration)

and

- script: dotnet build **/Core/**/*.csproj --configuration $(buildConfiguration)

But couldn't find a good example.

The projects I want to build are under different subfolders as in ../../Core/Domain/Domain.csproj and ../../Core/Presentation/Presentation.csproj

Is there something I'm missing, is it possible; or am I just plain doing something wrong.

Yves Schelpe
  • 3,343
  • 4
  • 36
  • 69

1 Answers1

10

You can just use the dotnetcore cli task with something like this:

- task: DotNetCoreCLI@2
  inputs:
  command: 'build'
  projects: |
      '**/*.csproj'
      '!**/*Mobile*.csproj' # This ignores projects with the occurrence of Mobile anywhere in the filename
HuntK24
  • 158
  • 2
  • 13
4c74356b41
  • 69,186
  • 6
  • 100
  • 141