3

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

1

1 Answer 1

6

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>
Sign up to request clarification or add additional context in comments.

2 Comments

any way to create a call for the "ant compress 1" from within another target on the build.xml?
I ended importing the file and using depends stackoverflow.com/a/25207678/1422630

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.