Well as nobody answered my question from the user's group, I don't know if
the following patch I've made is conceptually correct, and if yes may you
add it :) or give me a hint about another way to do the correction?
Thanks, Khiet.
org.apache.tools.ant.Target
private String parentTask;
...
public final void performTasks() {
try {
project.fireTargetStarted(this);
parentTask=project.getProperty("ant.target.current.name");
project.setProperty("ant.target.current.name",
name);
execute();
if(parentTask==null)
project.getProperties().remove("ant.target.current.name");
else
project.setProperty("ant.target.current.name",
parentTask);
project.fireTargetFinished(this, null);
}
catch(RuntimeException exc) {
project.fireTargetFinished(this, exc);
throw exc;
}
}
-----Original Message-----
From: Tran, Khiet [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 22, 2002 2:00 PM
To: '[email protected]'
Subject: Retrieving target name at runtime.
> Hi,
>
> We are using ant for defining dependencies between our components and as a
> matter, each target name happens to be a component name. The component
> name
> is also used for other purpose so we want to be able to retrieve the
> current running target name for processing. I've found no predefined
> variables of type ${ant.target.name}, is there something alike defined?
> Right now I've modified ant source code to incorporate such variable but
> such making sure it is not a bad idea.
>
> Thanks a lot, Khiet.
--
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]>