Accessing ant task name when running a task

Discussion in 'Java' started by teggy, May 29, 2007.

  1. teggy

    teggy Guest

    Hi there,

    I am trying to figure out if it is possible in an ant task to get the
    name of the ant task (I want to create a directory with the name of
    the task) ...

    -------------8<-----------------------------------------------------------
    <project name="ReleaseGenerator" default="usage" basedir=".">
    <target name="usage">
    <echo>
    ${ant.project.name}
    ${target.name}
    </echo>
    </target>
    </project>
    -------------8<-----------------------------------------------------------

    The above target produces the following output:
    ReleaseGenerator
    ${target.name}

    Instead of getting in the output ${target.name}, i would like to have
    "usage" (which is the target name) ...

    Thanks the help,
    Cheers,
    Teggy
     
    teggy, May 29, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Bedford
    Replies:
    6
    Views:
    2,251
  2. Victor
    Replies:
    0
    Views:
    8,854
    Victor
    Sep 1, 2004
  3. john martin
    Replies:
    2
    Views:
    2,224
    john martin
    Apr 7, 2005
  4. krabhi
    Replies:
    1
    Views:
    9,338
    Marco Meschieri
    Aug 9, 2006
  5. Mo
    Replies:
    0
    Views:
    139
Loading...

Share This Page