Run Ant script from another Ant script?

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

Can someone show me some ways please?

+3
source share
1 answer

Import the ant1.xml and ant2.xml files into the ant3.xml file using the import or include command

<import file="ant1.xml"/>

Define targets in ant1 and ant2 files as default example below

<project default="compile-ant1">

<project default="compile-ant2">

This will be executed from ant3 as needed.

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

+5
source

Source: https://habr.com/ru/post/1744445/


All Articles