macro scoping as private

View: New views
3 Messages — Rating Filter:   Alert me  

macro scoping as private

by Raja Nagendra Kumar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

Regards,
Nagendra
C.T.O
www.tejasoft.com

Re: macro scoping as private

by Francis Galiegue-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

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


Re: macro scoping as private

by Raja Nagendra Kumar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

O.k Thank you.

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

I see macros can be overridden in the order they get loaded.

Regards,
Nagendra