Ant - 为所有子目录运行 Build.xml [英] Ant - Run a Build.xml for all subdirectories
问题描述
我有一个位于顶层的 build.xml,我希望脚本为每个子目录运行一个目标,并将子目录名称作为参数传递给 ANT 目标.
你能帮忙吗?/??
谢谢
查看subant 任务.从该页面:
<项目名称="subant" default="subant1"><property name="build.dir" value="subant.build"/><目标名称="subant1"><subant target=""><property name="build.dir" value="subant1.build"/><property name="not.overloaded" value="not.overloaded"/><文件集目录=."包括="*/build.xml"/></subant></目标></项目>
<块引用>
这个片段构建文件将在项目目录的每个子目录中运行 ant,其中可以找到一个名为 build.xml 的文件.在 subant 调用的 ant 项目中,属性 build.dir 的值为 subant1.build.
I have a build.xml sitting at the top level and I want the script to run a target for each subdirectory and pass in the subdirectory name as a parameter to the ANT target.
Can you help ?/??
Thanks
Take a look at the subant task. From that page:
<project name="subant" default="subant1">
<property name="build.dir" value="subant.build"/>
<target name="subant1">
<subant target="">
<property name="build.dir" value="subant1.build"/>
<property name="not.overloaded" value="not.overloaded"/>
<fileset dir="." includes="*/build.xml"/>
</subant>
</target>
</project>
this snippet build file will run ant in each subdirectory of the project directory, where a file called build.xml can be found. The property build.dir will have the value subant1.build in the ant projects called by subant.
这篇关于Ant - 为所有子目录运行 Build.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!