Would that be ok?

<project default="main">

    <scriptdef name="whereAmI" language="javascript"><![CDATA[
        selfAsTarget    = self;
        currentTarget   = selfAsTarget.getOwningTarget();
        currentLocation = selfAsTarget.getLocation();
        project.log(currentLocation + "Target '" + currentTarget + "'");
    ]]></scriptdef>

    <target name="one">
        <whereAmI/>
    </target>

    <target name="two">
        <whereAmI/>
    </target>

    <target name="main" depends="one,two">
        <whereAmI/>
    </target>

</project>


Jan

> -----Urspr�ngliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Gesendet am: Donnerstag, 18. November 2004 12:46
> An: [EMAIL PROTECTED]
> Betreff: name of running target
> 
> 
> Hello everybody,
> 
> Is there a dynamic property for the name of the current target?
> 
> I would like to notify another process of the state my build 
> is in.  So
> What I'm looking for is something like:
> 
> <target name="someTarget"/>
> ...
>     <echo message="currently Running: ${magic.CurrentTarget}"/>
> ...
> </target>
> 
> If possible I want to avoid to introduce a static string in 
> every target
> that need to notify something in the outsideworld.
> 
> Can I do that without a listener?
> 
> Thanks Jacques
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Reply via email to