Build all csproj files, except Test projects

不羁的心 提交于 2019-12-25 01:38:25

问题


In DevOps you can create a dotnet build task where "Path to project(s)" can be set to **/*.csproj to build all the projects.

This works just fine, but it (obviously) also builds my *.Test.csproj projects.

I found some posts mentioning exclude patterns, so I tried doing the same as in those posts and tried the following combinations:

**/*.csproj;-**/*.Test.csproj
**/*.csproj;!**/*.Test.csproj

**/*.csproj;-:**/*.Test.csproj
**/*.csproj;!:**/*.Test.csproj

For all attempts I get the following error in the DevOps log:

Project file(s) matching the specified pattern were not found.

So, how can I create a dotnet build task to build all my projects except the *.Test.csproj projects?


回答1:


here's what I've been using to run all tests except for some of them:

  Test/**/*.csproj
  !**/*.Billing.Test.csproj
  !**/*.Queues.Test.csproj
  !**/*.WidgetDataProvider.Test.csproj

so by the same token you need to use:

  **/*.csproj
  !**/*.Test.csproj

as far as I understand, order matter, so this will not work:

  !**/*.Test.csproj
  **/*.csproj


来源:https://stackoverflow.com/questions/56614548/build-all-csproj-files-except-test-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!