Lusi
Lusi

Reputation: 401

Ant how call another xml file from build.xml depending parameter

I have a 3 xml files build.xml, build_1.xml, build_2.xml. The build_1.xml, build_2.xml files have target with name 'compress'.

How can I configure build.xml file that when I call 'ant compress 1' it run compress target from build_1.xml file and accordingly run compress target from build_2.xml in case of 'ant compress 2'?

Upvotes: 3

Views: 3966

Answers (1)

toongeorges
toongeorges

Reputation: 1966

See https://ant.apache.org/manual/Tasks/ant.html

as I understand your question you would need the following 2 targets in your build.xml file:

<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>

Upvotes: 6

Related Questions