从另一个文件导入 Ant 类补丁
我正在探索 Ant 1.8.1 强大的导入功能。这是我的情况:我有一个顶级 Ant 文件 (project.xml),它反过来调用另一个 Ant 文件(例如,neato_project.xml)上的 ant,该文件实际上执行构建、清理或其他操作。
我有 12 个不同的项目文件可供该顶级 (project.xml) 文件调用,因此我想将一个公共类路径条目放入 project.xml 文件中,我可以将其传递给其他人以用作其各自的类路径。
我该怎么做?我一直在尝试玩导入任务,但我还没有弄清楚。如果 Ant 中有更好的方法来解决这个问题,我愿意接受另一种方法。
I'm exploring the awesomeness of Ant 1.8.1's import ability. Here's my situation: I have a top-level Ant file (project.xml) that turns around and calls ant on another Ant file (say, neato_project.xml) which actually does the build, or clean or whatever.
I have 12 different project files that this top-level (project.xml) file can call, so I want to put a common classpath entry into the project.xml file that I can pass to the others to use as their individual classpaths.
How do I do that? I've been trying to play with import task, but I haven't gotten that figured out. I'm open to another approach if there's a better way to approach this problem in Ant.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1.8 中没有引入导入;它在 1.8 中得到了增强。这很好,因为这意味着像我这样的人有几年的进口经验。
我所做的:
我使用这种方法是因为我希望 build.xml 传递常量。我只是将它们保存在一个单独的文件中以方便阅读。
Import wasn't introduced in 1.8; it was enhanced in 1.8. This is good because it means people like me have a couple years experience with import.
What I do:
I use this approach because I want build.xml to pass the constants. I only keep them in a separate file for readability.