Sorry for the delay,
Your're right, the example was not very practical.
My real use-case is to build several libs using the ccp task
(net.sf.antcontrib.cpptask.CCTask).
For each lib I have to make one target, each lib has it's own name (of
course).
To avoid mistakes, e.g. via copy & paste, the target should be more
general:
Instead of:
<target name="base" depends="init">
<cc outfile="${obj}/base.lib" link="static" debug="true"
objdir="${obj}">
<compiler name="msvc">
<defineset define="WIN32, _DEBUG, _MBCS, _LIB"/>
</compiler>
....
</cc>
</target>
I would have:
<target name="base" depends="init">
<cc outfile="${obj}/${target.name}.lib" link="static" debug="true"
objdir="${obj}">
<compiler name="msvc">
<defineset define="WIN32, _DEBUG, _MBCS, _LIB"/>
</compiler>
....
</cc>
</target>
-----Urspr�ngliche Nachricht-----
Von: Stefan Bodewig [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 26. Februar 2002 11:45
An: [EMAIL PROTECTED]
Betreff: Re: Determine target's name
On Tue, 26 Feb 2002, Norbert Rieger <[EMAIL PROTECTED]> wrote:
> is it possible to get the target's name within the target, e.g.
No. Could you provide us with a real use-case, that shows, why you
need it? Your example isn't all that useful as you know the name of
the target when you write the delete task's invocation.
Stefan
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>