ANT Parameters

R

Rod

I have an ant script which requires at least two targets
to be specified.

Is there a way with core ant tasks or ant-contrib tasks to validate the
number of targets specified when the ant script is invoked ?

Thanks.
 
S

SMC

I have an ant script which requires at least two targets to be
specified.

Is there a way with core ant tasks or ant-contrib tasks to validate the
number of targets specified when the ant script is invoked ?

Thanks.

Without knowing clearly why you need to invoke two targets in this manner,
would it not be better to have the 2nd one have a dependency on the 1st
one? That way if someone invoked the 2nd without the first, you're
covered anyway.

<target name="1st">
<echo message="1st target invoked"/>
</target>

<target name="2nd" depends="1st">
<echo message="2nd target invoked"/>
</target>

[sean@se2 sean]$ ant
Buildfile: build.xml

1st:
[echo] 1st target invoked

2nd:
[echo] 2nd target invoked


But perhaps your build is more complicated than that. Using dependency is
the ant style though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Langton's Ant 0
ant inheritance 2
Ant targets 3
specifying multiple targets 1
using ant inside glassfish app 0
Ant - How do you use it? 1
Two questions about Ant 2
A real math problem. 5

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top