TFS 删除,使用 minimatch 模式排除 obj 文件夹 [英] TFS drop, exclude obj folder using minimatch pattern

查看:38
本文介绍了TFS 删除,使用 minimatch 模式排除 obj 文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在本地设置 TFS 2015,但在我的最后一个构建步骤发布构建工件"中遇到了问题.出于某种原因,构建代理似乎正在归档旧的二进制文件,而我留下了一个巨大的文件路径:

I'm setting up TFS 2015 on-prem and I'm having an issue on my last build step, Publish Build Artifacts. For some reason, the build agent appears to be archiving old binaries and I'm left with a huge filepath:

E:\TFSBuildAgent\_work\1a4e9e55\workspace\application\Development\project\WCF\WCF\obj\Debug\Package\Archive\Content\E_C\TFSBuildAgent\_work\1a4e9e55\workspace\application\Development\project\WCF\WCF\obj\Debug\Package\PackageTmp\bin

我正在使用示例 minimatch 模式复制文件:

I'm copying the files using the example minimatch pattern to begin with:

**\bin

我目前只是在测试,所以这不是一个永久的解决方案,但是我如何复制 bin 文件夹中的所有二进制文件,但不是 obj 的后代>?

I'm only testing at the moment so this is not a permanent solution but how can I copy all binaries that are in a bin folder but not a descendant of obj?

从研究中我认为这应该有效,但它没有(它不匹配任何东西):

From research I think that this should work, but it doesn't (It doesn't match anything):

**!(obj)**\bin

我正在使用 www.globtester.com 进行测试.有什么建议?

I'm using www.globtester.com to test. Any suggestions?

另外,我稍后会研究归档问题,但如果有人对此有任何建议,请随时发表评论.谢谢

On a separate note, I'll look into the archiving issue later but if anyone has any pointers on it, feel free to comment. Thanks

推荐答案

在 VSTS 中,SDK 中内置的 URL 有两种模式匹配.现在大多数任务都使用 Matt 的回答中描述的 Minimatch 模式. 但是,有些任务使用 1 使用的模式.x 代理的 Powershell SDK.顺便说一下,该格式在 2.x Agent 的 Powershell SDK 中仍然可用.

In VSTS there are two kinds of pattern matching for URLs that are built-in to the SDKs. Most tasks nowadays use the Minimatch pattern as described in Matt's answer. However, some use the pattern that was used by the 1.x Agent's Powershell SDK. That format is still available in the 2.x Agent's Powershell SDK by the way.

所以这意味着有 5 种任务:

So that means there are 5 kinds of tasks:

  • 1.x 代理 - Powershell SDK
  • 2.x 代理 - 节点 SDK
  • 2.x 代理 - Powershell 1 向后兼容性
  • 2.x 代理 - Powershell 3 SDK - 使用 find-files
  • 2.x 代理 - Powershell 3 SDK - 使用 find-match

粗体不是 Minimatch,而是 VSTS-Task-SDK 的 find-files 方法.

The ones in bold don't Minimatch, but the format documented in the VSTS-Task-SDK's find-files method.

最初的问题是在 2015 年发布的,当时 2.x 代理还没有出现.在这种情况下,模式很可能是:

The original question was posted in 2015, at which point in time the 2.x agent wasn't yet around. In that case, the pattern would, in all likelihood, be:

 **\bin\$(BuildConfiguration)\**\*;-:**\obj\**

-: 从前面的项目中排除项目.

The -: excludes the items from the ones in front of it.

这篇关于TFS 删除,使用 minimatch 模式排除 obj 文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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