蚂蚁拉链;排除所有子目录和文件
从 ant 创建 zip 时,如何排除给定目录中的所有子目录和文件?
我已尝试以下操作,但似乎并没有阻止它们包含在 zip 中
<target name="zip">
<zip destfile="C:\Projects\example\builds\.zip"
excludes="C:\Projects\example\logs\**\*.*">
...
...
</zip>
</target>
阅读文档,并阅读 ant 权威指南 我会假设 **\
应该排除任何目录,而 *.*
将排除
我想要的 任何扩展名的任何文件包含 logs
目录,但其中没有任何内容。
When creating a zip from ant, how can I exclude all sub directories and files from a given directory?
I have tried the following but it doesn't seem to prevent them from being included in the zip
<target name="zip">
<zip destfile="C:\Projects\example\builds\.zip"
excludes="C:\Projects\example\logs\**\*.*">
...
...
</zip>
</target>
From reading the documentation, and from reading the ant definitive guide I would assume that **\
should exclude any directory, and *.*
would exclude any file of any extension
I want to include the logs
directory, but nothing inside it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议执行以下操作:
destfile
的名称更改为"C:\Projects\example\builds\logs.zip"
basedir
到"C:\Projects\example\"
excludes
值更改为"C:\Projects\example\logs\**\*"
code>(表示任何文件)另一个选择可能是使用
project
定义的basedir
,并将所有路径更改为相对的类 UNIX 值。I would recommend the following:
destfile
to"C:\Projects\example\builds\logs.zip"
basedir
to"C:\Projects\example\"
excludes
value to"C:\Projects\example\logs\**\*"
(that means any file)Another option might be to use the
project
-definedbasedir
, and change all your paths to relative UNIX-like values.