ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Walker <r...@ascert.com>
Subject Re: <rant> inheritrefs just seems to plain not work </rant>
Date Mon, 25 Apr 2005 16:01:38 GMT

>If I followed correctly, it's not <subant> that alters scope, it's
><antcall> that opens a new scope. And since it does not inherit
>references by default, the reference <subant> passed in correctly is
>lost thru the use of <antcall>.
>  
>
Actually I think it may be some subtle interaction between these.

- if I have a global reference in my top-level script, <subant> will 
pass it down to a lower script but then <antcall> will only pass it to a 
target if I include an explicit "inheritrefs" on the antcall.

- if I declare a duplicate of the global reference in my lower-script 
(removing the "inheritref" from my <subant>), I don't then need an 
explicit inheritrefs in my <antcall> tasks.

So there's a subtle (and possibly inconsistent) behaviour of <antcall> 
here - global references within the local script don't need to be passed 
down to called targets with "inheritrefs" - but any global-scope 
references passed in from a calling top-level script will only be passed 
to a called target if there is an explict "inheritrefs" on the <antcall>.

So what it seems is that the references are being passed down, but not 
their "global scope" nature and hence - as you note - when  the 
<antcall> opens the new scope, the "passed down global references" 
aren't available to the <antcall> targets.

>Are you sure you need <antcall>? Can't you refactor your 'function'
>targets that you <antcall> into <macro>s? It's usually better/faster
>with macros.
>  
>
Possibly as a future we could, we'll certainly look into it.  That won't 
necessarily prevent others from tripping over this one though ;)

-- Rob


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


Mime
View raw message