Ant zip 任务默认排除哪些文件? [英] What files are excluded by default from Ant zip task?

查看:27
本文介绍了Ant zip 任务默认排除哪些文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Ant zip 任务以压缩 Unix 系统上目录的全部内容:

I'm running an Ant zip task to zip the whole contents of a directory on Unix systems:

<zip destfile="${deploy}/test.zip">
    <zipfileset dir="/home/mydir" />
</zip>

在创建 zip 并检查内容后,我可以看到一些配置文件、Visual Studio 特定文件和其他文件(如 Mac OS .DS_STORE 文件)被排除在 zip 之外.

After the zip is created, and checking the contents, I can see that some config files, Visual Studio specific files and others like the Mac OS .DS_STORE file are left out the zip.

蚂蚁是否遵循任何规则来决定不包含哪些文件?

Is there any rule ant follows to decide what files will not be included?

我需要提前知道,因为我需要在压缩之前在该目录上创建现有文件的列表(目前使用 Java).现在我排除了所有目录和隐藏文件(使用 File.isHidden() 和 isDirectory() 方法),但列表中仍然有一些 Ant 遗漏的文件(例如 vssver.scc

I need to know in advance since I need to create a list of existing files on that directory before zipping (currently using Java). Right now I'm excluding all directories and hidden files (using File.isHidden() and isDirectory() methods) , but the list is still getting some of the file Ant lefts out (for example, vssver.scc

推荐答案

试试这个:

<defaultexcludes echo="true"/>

http://ant.apache.org/manual/Tasks/defaultexcludes.html

请注意,这适用于所有使用文件集的 Ant 任务,而不仅仅是 zip 任务.

Note that this is used across all Ant taks that use filesets, not just the zip task.

这篇关于Ant zip 任务默认排除哪些文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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