ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: name of running target
Date Thu, 18 Nov 2004 11:58:56 GMT
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: lists@bitfaeule.net [mailto:lists@bitfaeule.net]
> Gesendet am: Donnerstag, 18. November 2004 12:46
> An: user@ant.apache.org
> 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: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message