NetBeans ANT:不包括隐藏文件吗?
在清理/构建结束时,我希望始终自动将项目文件夹复制到 zip 中以便于传输。因此,我将其添加到 build.xml
中的构建后
中:
<zip zipfile="../project-xyz.zip" basedir=".." includes="project-xyz/**" excludes="*/dir/lib/**"/>
这在 Windows 上效果很好,但在 Linux 上,它会删除任何 .hidden< /code> 文件夹及其所有子文件夹。我什至尝试过
<zip zipfile="../project-xyz.zip" basedir=".." includes="project-xyz/**,project-xyz/.hidden/**" excludes="*/dir/lib/**"/>
,但仍然不起作用。
我该怎么做才能将这些文件放入 zip 中?
我不反对检测非 Windows 环境并在 zip
命令上使用
,尽管我不确定如何做到这一点,而且我也不反对当然我真的很想,特别是如果有更好的方法的话!
At the end of my Clean/Build, I wanted to always automatically copy the project folder into a zip for easy transfer. So I added this to my post build <target>
in build.xml
:
<zip zipfile="../project-xyz.zip" basedir=".." includes="project-xyz/**" excludes="*/dir/lib/**"/>
This works great on Windows, but on Linux, it removes any .hidden
folders and all their children. I even tried
<zip zipfile="../project-xyz.zip" basedir=".." includes="project-xyz/**,project-xyz/.hidden/**" excludes="*/dir/lib/**"/>
and it still doesn't work.
What can I do to bring those files into the zip?
I am not opposed to detecting non-Windows environments and using <exec>
on the zip
command, though I am not sure how I would do that, and I am not sure I really want to, especially if there is a better way!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过在 ant 中添加以下行来查看默认情况下从 zip 中排除的内容
,然后使用
和
自定义默认情况下排除的内容。
参考:Ant 文档用于 DefaultExcludes
编辑
您也可以参考
:Zip 的 Ant 文档
You can see what gets excluded by default from the zip by adding the following line in ant
And then use
and
to customize what gets excluded by default.
Reference: Ant docs for DefaultExcludes
EDIT
You can also do
Reference: Ant docs for Zip