ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: <import> enhancement, it's done, but do you like how it works ?
Date Thu, 11 Jul 2002 16:37:00 GMT
You can have as many import levels as you want, and any file will be
imported only once (and cycle are taken care of too). So it's like all
imported files belong inside the importee. I'm not too sure how that plays
with Nicola Ken's newest super. Scheme ;-) I think it complicates things a
bit... Not sure yet how to do it better. --DD

-----Original Message-----
From: Jose Alberto Fernandez [mailto:j_a_fernandez@yahoo.com] 
Sent: Thursday, July 11, 2002 11:32 AM
To: Ant Developers List; nicolaken@apache.org
Subject: Re: <import> enhancement, it's done, but do you like how it works?

 --- 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?

> > 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" />
>    <!-- redefine mb2 here; dependencies are not
> inherited but called by 
> 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).

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

Jose Alberto


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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

--
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