Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute an Ant script from other Ant script?

Tags:

scripting

ant

I have several Ant scripts, for example ant1.xml, ant2.xml, ant3.xml. And I want to execute ant1.xml and ant2.xml in ant3.xml, so that when I execute ant3.xml, ant1.xml and ant2.xml are executed.

Can anyone show me some ways, please?

like image 958
ipkiss Avatar asked Sep 10 '26 22:09

ipkiss


1 Answers

Import ant1.xml and ant2.xml in ant3.xml by using an import or include command

<import file="ant1.xml"/>

Set the intended targets in ant1 and ant2 as a default - example below

<project default="compile-ant1">

<project default="compile-ant2">

This will run from within ant3 as required.

See here for more details: http://ant.apache.org/manual/Tasks/import.html

like image 115
JoseK Avatar answered Sep 13 '26 23:09

JoseK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!