ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francis ANDRE" <francis.an...@e-xmlmedia.fr>
Subject Re: Reading target name
Date Mon, 22 Jul 2002 11:36:29 GMT
Diane

I am interested by your code. 

Thanks

Francis ANDRE
Responsable Industrialisation et Support
www.e-xmlmedia.fr
+33 1 45 36 41 33
----- Original Message ----- 
From: "Diane Holt" <holtdl@yahoo.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Saturday, July 20, 2002 5:03 AM
Subject: RE: Reading target name


> --- Dominique Devienne <DDevienne@lgc.com> wrote:
> > You'll need to drop js.jar and bsf.jar in ${ant.home}/lib for the
> > following to work.
> [snip script to get target name]
> 
> Or you can use my exceedingly naughty task, which gets the current
> target's name and sets a property to that name. (It's naughty because you
> can use the same property over and over again :) For example:
> 
>   <taskdef name="gettarget" classname="GetTarget"/>
>   <target name="main" depends="t1,t2">
>     <gettarget property="target"/>
>     <echo>target = ${target}</echo>
>   </target>
> 
>   <target name="t1">
>     <gettarget property="target"/>
>     <echo>target = ${target}</echo>
>   </target>
> 
>   <target name="t2">
>     <gettarget property="target"/>
>     <echo>target = ${target}</echo>
>   </target>
> 
> $ ant
> t1:
>      [echo] target = t1
> 
> t2:
>      [echo] target = t2
> 
> main:
>      [echo] target = main
> 
> Actually, I just made it even naughtier by hard-coding in "target" as a
> default name for the property if one's not specified :)
> 
> If you want the source (and/or jar), just let me know.
> 
> Diane
> 
> =====
> (holtdl@yahoo.com)
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message