ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: macro scoping as private
Date Mon, 02 Nov 2009 13:07:51 GMT
On Mon, Nov 2, 2009 at 12:12, Raja Nagendra Kumar
<Nagendra.Raja@tejasoft.com> wrote:
>
> Hi,
>
> Is it possible to make a macro private.. meaning, the macro could be called
> by other ant script with in the same xml file.. and not be called by any
> other script defined else where and imported using <import> task.
>
> I understand ant is close to C's functional approach..but not sure if there
> is a way in ant.
>

AFAIK, no, there's no way to do that. <import> includes the file "as
is" (except that you need a <project> declaration in the ant file).

If you call ant files via <ant>, there is a way: by default, <ant> is
called with inheritall="true" (meaning, all properties defined in the
calling file are defined in the callee) and inheritrefs="false"
(meaning, all references are not inherited, such as <fileset
id="whatever">, and that includes macros).

I haven't tested either whether macro definitions can be overriden
(either within a task or within a file).

-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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


Mime
View raw message