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 Sat, 20 Jul 2002 01:48:58 GMT
You'll need to drop js.jar and bsf.jar in ${ant.home}/lib for the following
to work. See for
links on getting the two necessary jars. --DD

P:\org_apache\antx>C:\pro\ant1.5\bin\ant -buildfile targetname.xml
Buildfile: targetname.xml

     [echo] current target is 'test'

Total time: 1 second
P:\org_apache\antx>type targetname.xml
<?xml version="1.0"?>

<!-- ANT build file to test a specific feature or bug of ANT.
     Dominique Devienne <>        July 2002
<project name="targetname" default="test" basedir=".">

  <target name="test">
    <script language="javascript"><![CDATA[
      name = self.getOwningTarget().getName();
      self.getProject().setNewProperty("targetname", name);
    <echo message="current target is '${targetname}'" />



-----Original Message-----
From: Dan Baumbach [] 
Sent: Friday, July 19, 2002 1:35 PM
To: ''
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