ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Tiny patch to enable Recursion in Ant
Date Wed, 28 May 2008 13:19:22 GMT
> I could imagine a task to set a property to the current target
> 
> <location target="targetproperty" buildfile="fileproperty" />
> 
> ...maybe even something for a complete stack trace/list of 
> imports that 
> is live


I found an old implementation of getting the information.
Enhancing with setting the property shouldnt be difficult ;-)

Jan


<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>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message