蚂蚁模块间的依赖 [英] Intermodule dependency in ant
问题描述
我使用Ant 1.8
I am using Ant 1.8
我在IntelliJ IDEA的多个模块。每个模块都有一个build.xml,目前我需要浏览到该文件的build.xml文件,并为每个模块运行ant。
例如模块B的构建成功取决于模块A的构建是否成功。
I have multiple modules in intelliJ IDEA. Each module has a build.xml and currently i need to browse till build.xml of that file and run ant for every module. e.g. module B's build success depends on whether module A's build was successful.
现在,我想更新这个过程。如果存在一个选项,其中我可以写一个单一的构建过程中,将首先建立模块A的分布,然后同时建立分布B,它会检查是否建立模块A成功,这将是巨大的。
Now, i want to update this process. It will be great if an option exists wherein i can write a single build process which will first build distribution for module A and then while building distribution for B, it will be checked if build for module A is successful.
有没有使用当前的Ant机制的任何方式。我可以看到常春藤类似的东西,但我不能在我的项目中使用它。
Is there any way using current Ant mechanism. i could see something similar in ivy but i cant use it in my project.
请建议使用基本Ant特性的方法。
Please suggest an approach using basic Ant features.
推荐答案
借助 subant 一>在Ant任务调用一个多模块构建最灵活的方式,例如:
The subant task in ANT is the most flexible way to invoke a multi-module build, for example:
<project name="parent" default="build">
<target name="build">
<subant>
<filelist dir=".">
<file name="moduleA/build.xml"/>
<file name="moduleB/build.xml"/>
</filelist>
<target name="clean"/>
<target name="build"/>
</subant>
</target>
</project>
项目结构
|-- build.xml
|-- moduleA
| `-- build.xml
`-- moduleB
`-- build.xml
注意:
在我看来使用此任务最有力的方法是将其与的来自Apache常春藤buildlist 任务。让常春藤模块间的依赖声明自动判断模块生成顺序。
In my opinion the most powerful way to use this task is to combine it with the buildlist task from Apache ivy. Let the ivy inter-module dependency declarations automatically determine the module build order.
这篇关于蚂蚁模块间的依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!