ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Bacon <jba...@magmic.com>
Subject Re: recursive expansion of property names
Date Thu, 24 Jun 2004 22:34:10 GMT
well that's better.  It resolves the ${basedir} now but won't resolve 
properties defined as so:

   <property environment="env" />
   <property file="${basedir}/@{file}" />

--
Jeffrey Bacon
jbacon@magmic.com
Creative Developer
http://www.magmic.com


Wascally Wabbit wrote:
> At 06:08 PM 6/24/2004, you wrote:
> 
>> so what do I do with this?
>>
>>      private Object getProperty0(String ns, String name)
>>      {
>>          if (name==null) {
>>              return null;
>>          }
>>          Object o = m_allProperties.get(name);   /// <---- MINE
>>          if (o==null) {
>>              o = m_defImpl.getProperty(ns,name); /// <--- THE THING I 
>> REPLACED
>>          }
>>          return o;
>>      }
>>
>>
>> do I switch it to just:
>>
>>      private Object getProperty0(String ns, String name) {
>>        if (name == null) { return null; }
>>        return o = m_defImpl.getProperty(ns,name);
>>      }
>>
>> in which case I may as well just inline it.
> 
> 
> Correct. Drop the '0' fluff (I just cut-n-pasted my code w/o editing).
> Just inline the calls in your case. I got your original code working
> with just simple lines like:
> 
>     public Object getProperty(String ns, String name)
>     {
>         return defImpl.getProperty(ns,name);
>     }
> 
>     public Object getUserProperty(String ns, String name)
>     {
>         return defImpl.getUserProperty(ns,name);
>     }
>     ...
> Tedious but it seems to work (your uninstall will also work
> since any modifications will be applied against the original
> now-restored helper).
> 
>> -- 
>> Jeffrey Bacon
>> jbacon@magmic.com
>> Creative Developer
>> http://www.magmic.com
>>
>> Wascally Wabbit wrote:
>>
>>> Whoops...in my previous reply I should've mentioned
>>> that your helper does not need to keep any maps because you're
>>> only replacing the 'replaceProperties' algorithm. Just
>>> delegate to the replaced helper instead of using inheritance.
>>> At 03:33 PM 6/24/2004, you wrote:
>>>  >will that patch work on Ant's 1.6.1 source code it is it specific to
>>>  >1.7?  I tried implementing Wascally Wabbit's suggestion from the 
>>> other day
>>>  >and just took the replacePropertiesRecursively from the patch you
>>>  >submitted.  I don't really *understand* how the property helper 
>>> chaining
>>>  >stuff works but I THINK that either I'm not getting put in the 
>>> chain or
>>>  >the replacePropertiesRecursively method is not working on regular
>>>  >properties.  ${basedir} does not even get resolved -- though I suspect
>>>  >that something I'm doing is wrong as that should get resolved 
>>> BEFORE my
>>>  >PropertyHandler is even installed.
>>> [snip...]
>>> The Wabbit
> 
> 
> The Wabbit
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

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


Mime
View raw message