ANT模式匹配 - *主场迎战** [英] ANT Pattern Matching - * vs. **

查看:166
本文介绍了ANT模式匹配 - *主场迎战**的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用的TeamCity产生 *。nupkg 这是我们不希望的文物进行清理。 TeamCity的提供了一个字段,您可以用于指示哪些文件或不希望被清理指定ANT风格的图案。假设一秒钟,我们有我们不希望被清理以下文件:

We are using TeamCity to produce *.nupkg artifacts which we don't want to be cleaned up. TeamCity provides a field where you can specify an ANT-style pattern for indicating which files you do or don't want to be cleaned up. Let's assume for a second that we have the following files which we do not want to be cleaned up:

/a.nupkg
/dir1/b.nupkg
/dir1/dir2/c.nupkg

无论是否在根目录下的 *。nupkg 模式匹配 .nupkg 文件和所有子目录或做需要使用 **。* nupkg 来遍历所有目录?

Does the *.nupkg pattern match .nupkg files both in the root directory AND all child directories or do need to use **.*nupkg to traverse all directories?

我读了下面的文件,但这仍然是模糊的对我说:的http://蚂蚁.apache.org /手动/ dirtasks.html#模式

I read the following documentation but this is still ambiguous to me: http://ant.apache.org/manual/dirtasks.html#patterns

如果有一个ANT-图案测试仪(类似于 http://regexpal.com/ 的),这将是太神奇了。

If there is an ANT-Pattern tester (similar to http://regexpal.com/) that would be amazing.

推荐答案

要匹配所有的文件,所有目录中(从基本目录和更深)

To match all files, in all directories (from the base directory and deeper)

**/*.nupkg

将匹配

sample.nupkg
sample-2.nupkg
tmp/sample.nupkg
tmp/other.nupkg
other/new/sample.nupkg

PS:有没有蚂蚁格式测试

PS: There is no Ant Pattern Tester.

这篇关于ANT模式匹配 - *主场迎战**的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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