ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: <import> enhancement, it's done, but do you like how it works?
Date Thu, 11 Jul 2002 20:29:29 GMT

Jose Alberto Fernandez wrote:
>  --- Nicola Ken Barozzi <nicolaken@apache.org> wrote:
> 
>>Jose Alberto Fernandez wrote:
>>...
>>
>>>The fact that it is NOT a string. If you use a string
>>>you will have to parse the data. What does it
>>>happen if you have something like:
>>>
>>>  <property name="parent" value="super.targetname"/>
>>
>>>  <antcall target="${parent}"/>
>>>
>>>How do you know "parent" needs to be rewritten?
>>
>>Rewritten? I don't understand...
>>
> 
> What does your code do if you have two levels of
> import?

Currently it just makes the last defined one the one with the targetname 
and the next to last the one called super.targetname

>>>By the way, the exact syntax of the property is not
>>>the point. The important points are:
>>>
>>>1) Make dificult to clash with current buildfiles:
>>>
>>>  "ant::"
>>
>>Instead of super I can use ant::super::targetname or
>>anything else, it's 
>>just an implementation issue.
> 
> The whole point is to have that as a property so you
> do not get confuse with regular text.
> 
> 
>>Try this, it works:
>>   <property name="mbextra" value="super.mb2" />
>>
>>   <target name="mb2" depends="super.mb2">
>>     <echo message="*Redefined* Sub2 build called /pre/ :-)"/>
>>     <antcall target="${mbextra}"/>
>>     <echo message="*Redefined* Sub2 build called /post/ :-)"/>
>>   </target>
>>
>>Could you please add snippets that fail to work with
>>current import 
>>proposed implementation, so that I can understand
>>you better right away 
>>and maybe propose a solution?
> 
> 
> Take the snipped above, and lets assume it is in file
> buildA.xml with its import in buildB.xml.
> 
> Define buildC.xml as:
> 
>   <import file="buildA.xml">
>   <target name="mb2" depends="super.mb2"/>
> 
> Now ${mbextra} should expand to "super.super.mb2" and
> not to "super.mb2" since the super is the target in
> "buildB.xml". But the above code will call the one in
> buildA.xml. (If I understood you translation
> correctly).

Yes, you are correct, now I understand, thanks :-)

> As for the solution, the translation scheme I proposed
> in my previous message will do.

Hmmm... (starting to read your next mail...)


-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


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


Mime
View raw message