On Mon, Nov 2, 2009 at 12:12, Raja Nagendra Kumar
<nagendra.r...@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
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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

Reply via email to