Dave
Dave

Reputation: 8897

Ant: How do I find out what target was invoked from the command line?

I'm using Ant 1.8.2. From within my build.xml file, how do I find out what targets were used on the command line when invoking Ant?

Thanks, - Dave

Upvotes: 8

Views: 1874

Answers (1)

Cata
Cata

Reputation: 498

Use the ant.project.invoked-targets property:

 <echo message="Targets: ${ant.project.invoked-targets}"/>

It's new since ant 1.8, I think. Some more Ant built-in properties.

Upvotes: 10

Related Questions