If you check the archives, you'll find a pair of tasks called ForEach and PropertyCopy, posted by Matthew Inger 09/21/01. The latter task will do exactly what you're looking for, e.g.: Matt McHenry Software Developer Carnegie Learning www.carnegielearning.com > -----Original Message----- > From: Stefan Bodewig [mailto:bodewig@apache.org] > Sent: Wednesday, December 05, 2001 10:03 > To: ant-user@jakarta.apache.org > Subject: Re: nested arguments > > > On Wed, 5 Dec 2001, Melroy Rodrigues wrote: > > > can I use a variable > > ${appserver.${appserver.target}.home} in the build.xml > > file > > No - no recursive property expansion in Ant. > > > and if not what is the equivalent. > > I'm not sure what you are trying to do here, I assume you want to > define things like > > > > > and use the above construct. I also assume that you want to use more > than one property, otherwise and its nested > element are your friend. > > The cleanest solution probably is something like > > > > and have property files for your different targets that define things > like appserver.home. So you'd have two property files containing > > weblogic51.properties: > ====================== > appserver.home=foo > > and > > weblogic60.properties: > ====================== > appserver.home=bar > > > Another option involves a property setting target for each value > appserver.target can take: > > > > > > > > > ... > > > depends="check" > if="is.weblogic51"> > > > > depends="check" > if="is.weblogic60"> > > > > > depends="setup-properties-weblogic51,setup-properties-weblogic60" /> > > A pre-Ant 1.4 solution that works along the same line but doesn't need > a condition task (but is a lot more hacky IMHO) would replace > the check > target with > > > > > > I prefer the property file version, it may scatter your properties > into several files and it may be more difficult to keep them in sync > when you add new properties (as you have to remember to change all > files), but it makes the build file a lot easier to read. All IMHO, > of course. > > Stefan >