ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Reading target name
Date Fri, 19 Jul 2002 22:57:50 GMT
Just replace getDescription() by getName() ;-)  --DD

-----Original Message-----
From: Diane Holt [] 
Sent: Tuesday, June 11, 2002 12:32 PM
To: Ant Users List
Subject: Re: access to task description?

--- "Hertel, Oliver" <> wrote:
> is there a way to access the target description [...]?

You can either add the following to every target you want to have the
description printed out for:
    <script language="javascript"><![CDATA[
      desc = self.getOwningTarget().getDescription();
      if( desc != null ) {

Or compile, jar, and taskdef the following:

  public class PrintDesc extends Task {

      // The method executing the task
      // @param None Executes the task
      public void execute() throws BuildException {
          String desc = getOwningTarget().getDescription();
          if( desc != null ) {

and include a <printdesc/> in any target you want the description printed
out for.

(Maybe there's some more clever way, but it's the best I can come up with
while waiting for my coffee to brew :)


-----Original Message-----
From: Dan Baumbach [] 
Sent: Friday, July 19, 2002 3:43 PM
Subject: Reading target name

Is there a way to read the target name?
<target name="Account">
    <ant antfile="buildEJB.xml">
      <property name="EJB" value="Account"/>
In the property element, I would like to simply refer to the target name
instead of having to type "Account" in again.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message