【发布时间】:2009-05-04 10:15:37
【问题描述】:
我有一个包含多个模块的项目,每个模块都在自己的目录中。每个模块都有自己的 ant 构建文件(build.xml)
在根目录中我设置了一个通用的构建文件,它以正确的顺序调用每个模块的构建文件。
<?xml version="1.0"?>
<project name="bridgedb" default="all" basedir=".">
<target name="all">
<ant dir="corelib"/>
<ant dir="tools"/>
<ant dir="makeGdb"/>
<ant dir="cytoscape-plugin"/>
</target>
</project>
现在每个模块也有一个“干净”的目标,所以我添加了这些行:
<target name="clean">
<ant dir="corelib" target="clean"/>
<ant dir="tools" target="clean"/>
<ant dir="makeGdb" target="clean"/>
<ant dir="cytoscape-plugin" target="clean"/>
</target>
还有更多这样的目标。有没有办法重写构建文件以避免这种重复?我一直在寻找包含活动目标的内置属性,但找不到。
【问题讨论】: