生成除测试项目外的所有csproj文件 [英] Build all csproj files, except Test projects

查看:102
本文介绍了生成除测试项目外的所有csproj文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在DevOps中,您可以创建一个 dotnet构建任务,其中项目路径可以设置为 ** / *。csproj 来构建所有项目。

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

这很好用,但是(显然)它也可以构建我的 *。 .csproj 项目。

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

对于所有尝试,我都在DevOps日志中得到以下错误:

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


找不到与指定模式匹配的项目文件。

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

因此,如何创建 dotnet构建任务来构建我的所有项目除了 * .Test.csproj 项目?

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

推荐答案

她e是我用来运行所有测试(除了其中一些测试)的东西:

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


$ b据我了解,$ b

顺序很重要,所以这将不起作用:

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

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

这篇关于生成除测试项目外的所有csproj文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆