Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

ANT Parameters

Thread view: 
Rod - 26 Jun 2005 04:28 GMT
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.
SMC - 28 Jun 2005 04:38 GMT
> I have an ant script which requires at least two targets to be
> specified.
[quoted text clipped - 3 lines]
>
> 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.

Signature

Sean

There's no place like 127.0.0.1



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.