Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run all the targets in an Ant buildfile?

Tags:

ant

I would like to execute all targets instead of specifying each one.

For example:

<?xml version="1.0"?>
<project name="Kte" default="all" basedir="/home/Kte">

    <target name="target1">
    </target>

    <target name="target2">
    </target>
</project>

Currently I have use:

$ ant target1
$ ant target2

I'd like to use:

$ ant

and have both targets get built (this is just an example. Reality I have a long ever changing Ant buildfile with sub-ant files so would be very handy to have an "all" feature.

like image 325
Rishad Avatar asked Jun 02 '11 12:06

Rishad


People also ask

How do I list all Ant targets?

To show every target associated with a build. xml file, you need to run ant -p -v Also, ant -p build.

How do Ant targets work?

An Ant target is a sequence of tasks to be executed to perform a part (or whole) of the build process. Ant targets are defined by the user of Ant. Thus, what tasks an Ant target contains depends on what the user of Ant is trying to do in the build script.


1 Answers

You could create an ant task all, which depends on all the specific targets that you have...

<target name="all" depends="target1, target2, ... ">
</target>

ant all
like image 102
Raghuram Avatar answered Oct 18 '22 08:10

Raghuram