ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chaganthi, Madhusudan R." <m...@cdc.gov>
Subject RE: another request for help....
Date Tue, 08 Aug 2000 20:32:02 GMT
David

You dont have to create 20 different buildfiles BUT
You might have to call the same target 20 times with different values for
"first" and "second" properties. Try to isolate properties so that you can
call the same task with diff properties.


So your global build file would be like :


<property name="first" value="1">
<ant buildfile="unit.xml">

<property name="first" value="2">
<ant buildfile="unit.xml">


....
....

Hope you got what I'm getting at.

Let me know if you still have a question.

Madhu

-----Original Message-----
From: David Weller [mailto:dgweller@yahoo.com]
Sent: Tuesday, August 08, 2000 4:31 PM
To: ant-user@jakarta.apache.org
Subject: another request for help....


It's been a busy Ant-day for me :-)

I want to call multiple targets with different parameters (I guess you could
call it parameter passing).  The concept is that I want to set properties
like
this:
<property name="first" value="foo"/>
<property name="second" value="bar"/>

<property name="EJB_JAR" value="hc_ejb_${first}_${second}.jar"/>
<property name="outdir" value="com/baz/${first}/${second}";
<property name="EJB_TEMP" value="${ext.TEMP}/${outdir}"/>
<property name="EJB_CLIENT_CLASSES" 
	value="${ext.CLIENT_CLASSES}/${EJB_DIRECTORY}"/>

Where ${first} and ${second} vary depending on the target (yes, this is a
"real
world" example).  Since properties behave more like "final" variables in
Java,
how do I accomplish this?  Am I trying to do the wrong thing?  I really
don't
want to create 20 different buildfiles with the actual values of ${first}
and
${second} hardcoded into them :-(

So how do I do this?  Do I need to use something different from properties?


__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

Mime
View raw message