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.

passing paremeters to ANT

Thread view: 
rrothberg@gmail.com - 28 Jun 2005 16:59 GMT
i dont know anything about ANT and have been trying to work on a
solution by looking at our current build scripts and reading up on ANT
but haven't been able to find a solution yet.

basically I'm responsible for the CVS and BASH scripts for checking out
and compiling the code.  the developers deal with the ANT and build.xml
files generally.  what i want to is to pass the tag I've created with
CVS to the ANT script so that a developer can then take that tag and
build it into his java code so we know what particular CVS tag a
running application is based on.

however, i was asked to figure out how to modify the build.xml file
appropriately to at least assign to a variable the parameter i want to
pass from my BASH script.

the concept that BASH used of assigning parameters to variables (ie %1
%2, etc) doesn't appear to apply here.  It almost looks like I need to
pass a variable name (property?) along with the actual variable.

Could someone perhaps give me a quick example of how I might pass
something like a variable of App20050625 and assign it to a name
(property?) of CVStag within the build.xml file?

I really appreciate any help.  Thanks!
Raymond DeCampo - 28 Jun 2005 18:35 GMT
> i dont know anything about ANT and have been trying to work on a
> solution by looking at our current build scripts and reading up on ANT
[quoted text clipped - 18 lines]
> something like a variable of App20050625 and assign it to a name
> (property?) of CVStag within the build.xml file?

ant -DCVStag=App20050625 target1 target2 ...

Within the build.xml file, use ${CVStag} to get the value of the property.

Other possibilities include defining the property within the build.xml
file or in a properties file that ANT reads.  These may not be
appropriate for your use however, unless there is some way for CVS to
embed the value in a file upon checkout and then you would be golden.

HTH,
Ray

Signature

XML is the programmer's duct tape.

rrothberg@gmail.com - 28 Jun 2005 19:18 GMT
thanks, i have no idea how they would take that and embed it into an
app, but that's their problem :).  writing it out to a file is
extremely simple.  CVS doesn't do it, but it's easy enough to do with
BASH.


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.