Ant如何根据参数

时间:2017-01-18 08:18:08

标签: java ant

我有一个3 xml文件build.xml, build_1.xml, build_2.xmlbuild_1.xml, build_2.xml个文件的目标名称为“compress”。

如何配置build.xml文件,当我调用“ant compress 1”时,它会从build_1.xml文件运行压缩目标,并相应地从build_2.xml运行压缩目标ant compress 2“?

1 个答案:

答案 0 :(得分:4)

请参阅https://ant.apache.org/manual/Tasks/ant.html

根据我的理解你的问题,你需要在build.xml文件中使用以下两个目标:

<target name="ant compress 1">
    <ant antfile="build_1.xml" target="compress"/>
</target>

<target name="ant compress 2">
    <ant antfile="build_2.xml" target="compress"/>
</target>
相关问题