Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Developers List »

AW: Tiny patch to enable Recursion in Ant

Jan Materne

2008-05-28


Author LoginPost Reply
> 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@(protected)
For additional commands, e-mail: dev-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.