> -----Original Message----- > From: Diane Holt [mailto:[EMAIL PROTECTED] > Sent: Monday, May 21, 2001 7:43 PM > To: [EMAIL PROTECTED] > Subject: Re: Is this a desirable feature? > > > --- "Headley, Bryan" <[EMAIL PROTECTED]> wrote: > > Assume you can deploy to one of several environments. So > you set up a > > variable called 'build.for" that you can pass on the command line to > > ant. > > > > So, we're looking at, > > > > <property name="app.DEV.deployment.dir" > value="/opt/deployment/forDev" > > /> > > <property name="app.QA.deployment.dir" > value="/opt/deployment/forQa" /> > > <!-- fairly simplistic; I might actually use different > template files, > > etc > > --> > > ... > > <property name="app.deployment.dir" > > value="${app.${build.for}.deployment.dir}"/> > > > > Does anyone else see the benefit to a recursive propertyName parser? > > > > There's been talk about an IF command; would that be a more > acceptable > > approach? Or am I merely insane? > > It was requested but rejected for Ant2. > > In your case, since you're passing a property on the > command-line anyway, > if you define it as -Dbuild.for="Dev", couldn't you just do: > > <property name="app.deployment.dir" > value="/opt/deployment/for${build.for}"/> > > and eliminate those other two properties altogether? >
It presupposes that "Dev" is a true suffix, and not just a trivial example. You see, what I wanted to do is keep all the properties for all the environments together, so it's easier to proofread / keep their values in sync. I may have to work out a directory layout where what you suggest would work... > Diane > > ===== > ([EMAIL PROTECTED]) > > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Auctions - buy the things you want at great prices > http://auctions.yahoo.com/ >
