如何排除蚂蚁文件集的目录,根据目录中的内容 [英] How to exclude a directory from ant fileset, based on directories contents

查看:162
本文介绍了如何排除蚂蚁文件集的目录,根据目录中的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何可以创建一个文件集蚂蚁不包括基于目录的内容?

How can I create an ant fileset which excludes certain directories based on the contents of the directory?

我用蚂蚁来创建一个单独的目录中,其中有些是不完整和不应该被释放的每个本地化分布罐子。

I use ant to create a distribution jar which has each localization in separate directories, some of which are incomplete and should not be released.

我想的东西添加到目录(例如一个名为 incomplete.flag ),使蚂蚁排除的目录。然后,我可以删除文件时,转换完成后,并将其包含在生成,而无需修改build.xml文件。

I would like to add something to the directory (for example a file named incomplete.flag) so that ant excludes the directory. Then I can delete the file when translation is complete, and include it in the build without modifying build.xml.

鉴于这种目录结构:

proj
+ locale
  + de-DE
  + en-US
  + fr-FR

本文件集中排除所有 incompelte.flag 文件,但我怎么能排除的包含整个目录的他们?

This fileset excludes all incompelte.flag files, but how can I exclude the entire directories that contain them?

  <fileset dir="${basedir}">
    <include name="locale/"/>
    <exclude name="locale/*/incomplete.flag">
  </fileset>

我可以写一个Ant任务如果需要的话,但我希望在文件集可以处理这个用例。

推荐答案

下面的方法对我的作品:

The following approach works for me:

<exclude name="**/dir_name_to_exclude/**" />

这篇关于如何排除蚂蚁文件集的目录,根据目录中的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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