You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Ja...@rzf.fin-nrw.de on 2008/11/03 08:53:11 UTC

AW: Dynamic property names

>Is it possible to resolve a property name like this
>
>${${prefix}.someproperty}
>
>making the prefix variable?


see
http://ant.apache.org/faq.html#propertyvalue-as-name-for-property


Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: AW: Dynamic property names

Posted by Matt Benson <gu...@yahoo.com>.
--- Remie Bolte <re...@backbase.com> wrote:

> Thanks for the input!
> 
> I found a different way to deal with the problem,
> without hacks :)
> Sometimes it is useful not to be able to find a
> solution, it allows you to
> look back a couple of steps.
> 
> However, I do still have the question why double
> expanding is not
> implemented. Is there a conceptual issue, are there
> strong arguments not to
> implement it, or is it just hard to do?
> 

It's a matter of preference:  the majority of Ant's
developers aren't keen on having the functionality. 
Further, while the syntax ${${foo}.bar} seems
straightforward, it is arguably ambiguous.  You can
choose to believe that this is a nested property
expression, but some might disagree and see things
differently.  In any event, Ant's property handling
API has been redesigned to accommodate this, and it is
available in the experimental props antlib, which
rather than being considered a hack, is a way to
support this use case at the user's discretion without
forcing it on all Ant users.

HTH,
Matt

> Cheers,
> 
> Remie
> 
> On Tue, Nov 4, 2008 at 9:32 PM, Gilbert Rebhan
> <an...@schillbaer.de> wrote:
> 
> > Jan.Materne@rzf.fin-nrw.de schrieb:
> > >> I saw the FAQ, but the workaround deals with
> making a new
> > >> property, which is
> > >> not something that is desirable in my
> situation.
> > >> Is there a reason that double expanding is not
> implemented?
> > >
> > > There is an implementation in the sandbox
> bundled as an AntLib.
> > > You could give it try:
> > >
> > >
> > > Root
> > >
>
http://svn.apache.org/viewvc/ant/sandbox/antlibs/props/trunk/
> > >
> > > Doc
> > >
>
http://svn.apache.org/viewvc/ant/sandbox/antlibs/props/trunk/docs/index.
> > > html?view=co
> >
> > There's also a hack via <var> task from
> antcontrib, see =
> > http://marc.info/?l=ant-user&m=121318477419672&w=2
> >
> > Regards, Gilbert
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> dev-help@ant.apache.org
> >
> >
> 



      

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: AW: Dynamic property names

Posted by Gilbert Rebhan <an...@schillbaer.de>.
Remie Bolte schrieb:
> Thanks for the input!
> 
> I found a different way to deal with the problem, without hacks :)
> Sometimes it is useful not to be able to find a solution, it allows you to
> look back a couple of steps.

hack != bad IMO
i use that term for a tricky solution or workaround when the standards
don't work as expected or lack a specific feature.

You are absolutely right, often you'll find a simple(r) solution after
taking a nap or another cup of coffee. Needing a hack is mostly an
indicator something went wrong before > Keep It Simple, Stupid (KISS)
But sometimes i need a hack to make it work.

> However, I do still have the question why double expanding is not
> implemented. Is there a conceptual issue, are there strong arguments not to
> implement it, or is it just hard to do?

One of the fundamentals in ant is the immutability of a property once set.
There are some collections of anttasks (antelope,antcontrib,antxtras)
that provide mutable properties, as there are requests by
ant users (btw. it's easy to overwrite properties with <script>
and use of the ant api).
So if others did it, i believe it wouldn't be that hard to implement
for ant core also, probable conceptual problems though !?

Of course the ant developers receive the user request for mutable
properties and so it appears as AntLib. Maybe that's the way to
keep the core ant 'clean', but nevertheless provide requested features.


Regards, Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: AW: Dynamic property names

Posted by Remie Bolte <re...@backbase.com>.
Thanks for the input!

I found a different way to deal with the problem, without hacks :)
Sometimes it is useful not to be able to find a solution, it allows you to
look back a couple of steps.

However, I do still have the question why double expanding is not
implemented. Is there a conceptual issue, are there strong arguments not to
implement it, or is it just hard to do?

Cheers,

Remie

On Tue, Nov 4, 2008 at 9:32 PM, Gilbert Rebhan <an...@schillbaer.de> wrote:

> Jan.Materne@rzf.fin-nrw.de schrieb:
> >> I saw the FAQ, but the workaround deals with making a new
> >> property, which is
> >> not something that is desirable in my situation.
> >> Is there a reason that double expanding is not implemented?
> >
> > There is an implementation in the sandbox bundled as an AntLib.
> > You could give it try:
> >
> >
> > Root
> > http://svn.apache.org/viewvc/ant/sandbox/antlibs/props/trunk/
> >
> > Doc
> > http://svn.apache.org/viewvc/ant/sandbox/antlibs/props/trunk/docs/index.
> > html?view=co
>
> There's also a hack via <var> task from antcontrib, see =
> http://marc.info/?l=ant-user&m=121318477419672&w=2
>
> Regards, Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Re: AW: Dynamic property names

Posted by Gilbert Rebhan <an...@schillbaer.de>.
Jan.Materne@rzf.fin-nrw.de schrieb:
>> I saw the FAQ, but the workaround deals with making a new 
>> property, which is
>> not something that is desirable in my situation.
>> Is there a reason that double expanding is not implemented?
> 
> There is an implementation in the sandbox bundled as an AntLib.
> You could give it try:
> 
> 
> Root
> http://svn.apache.org/viewvc/ant/sandbox/antlibs/props/trunk/
> 
> Doc
> http://svn.apache.org/viewvc/ant/sandbox/antlibs/props/trunk/docs/index.
> html?view=co

There's also a hack via <var> task from antcontrib, see =
http://marc.info/?l=ant-user&m=121318477419672&w=2

Regards, Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


AW: Dynamic property names

Posted by Ja...@rzf.fin-nrw.de.
>I saw the FAQ, but the workaround deals with making a new 
>property, which is
>not something that is desirable in my situation.
>Is there a reason that double expanding is not implemented?

There is an implementation in the sandbox bundled as an AntLib.
You could give it try:


Root
http://svn.apache.org/viewvc/ant/sandbox/antlibs/props/trunk/

Doc
http://svn.apache.org/viewvc/ant/sandbox/antlibs/props/trunk/docs/index.
html?view=co


Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Dynamic property names

Posted by Remie Bolte <re...@backbase.com>.
Hi,

I saw the FAQ, but the workaround deals with making a new property, which is
not something that is desirable in my situation.
Is there a reason that double expanding is not implemented?

Cheers,

Remie


On Mon, Nov 3, 2008 at 8:53 AM, <Ja...@rzf.fin-nrw.de> wrote:

> >Is it possible to resolve a property name like this
> >
> >${${prefix}.someproperty}
> >
> >making the prefix variable?
>
>
> see
> http://ant.apache.org/faq.html#propertyvalue-as-name-for-property
>
>
> Jan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>