从我的主构建文件中,我想在多个其他构建文件中调用相同的目标。我目前的解决方案是分别调用它们,如下所示:
<ant antfile="${lib_src_dir}/mylib1/build.xml" target="build" inheritAll="false"/>
<ant antfile="${lib_src_dir}/mylib2/build.xml" target="build" inheritAll="false"/>我希望我的构建文件只调用${lib_src_dir}的所有子目录中的构建文件的构建目标。我知道我可以使用ant-contrib中的foreach任务,但如果可能的话,我不想使用外部库。
我尝试过以下几种方法,但都不起作用:
<ant antfile="${lib_src_dir}/*/build.xml" target="build" inheritAll="false"/>发布于 2010-06-07 22:44:41
下面是我使用subant任务得到的结果:
<subant target="clean">
<fileset dir="${lib_src_dir}" includes="*/build.xml" />
</subant>发布于 2010-06-07 22:06:57
您需要subant任务。
https://stackoverflow.com/questions/2989819
复制相似问题