|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Is recursive property evaluation supported?I was trying to present a list of choices for the user like an interactive textual menu. I produced the list of choices and set a property for each. The user inputs a number corresponding to the choice he wants, and I get the value corresponding to that choice via my properties I set. However, it doesn't work because I need to evaluate a recursive property expression:
${releaseName.${releaseName.selection}} where ${releaseName.selection} would evaluate to the number they typed in [1, 2, 3...] and then the outer property would be evaluated like ${releaseName.1} if they picked 1. Is this supported? I was able to mix parameter evaluation inside property evaluation and it worked fine: ${dllName.@{submodule}}<mailto:$%7bdllName.@%7bsubmodule%7d%7d> So I was surprised my recursive property evaluation didn't work. Any help presenting a list of choices to the user where they pick the number corresponding to their choice would also be helpful. --- Shawn Castrianni ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. |
|
|
Re: Is recursive property evaluation supported?-------- Original Message --------
Subject: Is recursive property evaluation supported? From: Shawn Castrianni <Shawn.Castrianni@...> To: 'Ant Users List' <user@...> Date: 15/04/2008 07:12 > I was trying to present a list of choices for the user like an interactive textual menu. I produced the list of choices and set a property for each. The user inputs a number corresponding to the choice he wants, and I get the value corresponding to that choice via my properties I set. However, it doesn't work because I need to evaluate a recursive property expression: > > ${releaseName.${releaseName.selection}} > > where ${releaseName.selection} would evaluate to the number they typed in [1, 2, 3...] and then the outer property would be evaluated like ${releaseName.1} if they picked 1. > > Is this supported? I was able to mix parameter evaluation inside property evaluation and it worked fine: > > ${dllName.@{submodule}}<mailto:$%7bdllName.@%7bsubmodule%7d%7d> > > So I was surprised my recursive property evaluation didn't work. > > Any help presenting a list of choices to the user where they pick the number corresponding to their choice would also be helpful. > > --- > Shawn Castrianni > > ---------------------------------------------------------------------- > This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. > works, is most likely due to the 2-time processing by the <macrodef> first, then by the main Ant property parser. If you want to achieve the same purpose as a nested ${ ${} }, I suggest you use <propertycopy> from ant-contrib, like this: <propertycopy property="newprop" from="releaseName.${releaseName.selection}" /> See ant-contrib documentation for more details. BR, Olivier --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: Is recursive property evaluation supported?On Mon, Apr 14, 2008 at 6:11 PM, Shawn Castrianni
<Shawn.Castrianni@...> wrote: > So I was surprised my recursive property evaluation didn't work. It's not. But there's a patch for it in BugZilla, and you may be able to add it to your SVN controlled copy of Ant via an AntLib thanks to the PropertyHelper hooks available in Ant Core. They may require you to "invent" a new syntax for the nested expansion and also forces to use a property prefix, but overall it's probably a doable hack. Would like something like ${lgc:outer%inner%} for example. (using ${inner} or @{inner} it too likely to create issues I believe). Using <propertycopy> or a custom task of your own is also an option, probably easier ;-) --DD --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: Is recursive property evaluation supported?--- Dominique Devienne <ddevienne@...> wrote: > On Mon, Apr 14, 2008 at 6:11 PM, Shawn Castrianni > <Shawn.Castrianni@...> wrote: > > So I was surprised my recursive property > evaluation didn't work. > > It's not. But there's a patch for it in BugZilla, > and you may be able > to add it to your SVN controlled copy of Ant via an > AntLib thanks to > the PropertyHelper hooks available in Ant Core. They > may require you > to "invent" a new syntax for the nested expansion > and also forces to > use a property prefix, but overall it's probably a > doable hack. Actually, to the best of my knowledge, the patch in BZ was made obsolete with the changes to PropertyHelper + the props sandbox antlib, which provides a NestedPropertyExpander. See http://ant.apache.org/antlibs/sandbox.html#Props%20-%20additional%20Property%20Resolver for more info. HTH, Matt > > Would like something like ${lgc:outer%inner%} for > example. (using > ${inner} or @{inner} it too likely to create issues > I believe). > > Using <propertycopy> or a custom task of your own is > also an option, > probably easier ;-) --DD > > > To unsubscribe, e-mail: > user-unsubscribe@... > For additional commands, e-mail: > user-help@... > > ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
| Free Forum Powered by Nabble | Forum Help |