ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <li...@bitfaeule.net>
Subject Re: AW: name of running target
Date Thu, 18 Nov 2004 18:44:01 GMT

Thank you. I cannot find any entries for scriptdef- or script-task. It
seems to be missing that information.

However, I have helped myself by writing myself a task in Java that uses
project.getOwningTarget() to set a user property:
project.setUserProperty("currenttarget",
this.getOwningTarget().toString());

This works fine for me and I don't need to upgrade my buildsystem to
ant-1.6.2 which the scriptdef-task requires (I'm assuming.)

Still using the project-object revealed another question:
"The field ProjectComponent.project is deprecated" says my compiler.
What should be used instead?

I couldn't find any documentation on this issue. Please comment if this
should be implemented differently.

-jacques

>Check: http://ant.apache.org/manual/install.html#librarydependencies
>for bsf and rhino (javascript) - note in particular that the required
>rhino version is *not* the most recent one.
>
>Peter
>
>lists@bitfaeule.net wrote:
>
>Thank you Jan,
>
>That looks very cool. But I have a problem running it:
>Some jars are missing in my path and I don't know which.
>
>Do you know whicch external jars the scriptdef-task depends on?
>
>thanks, jacques
>
>___
>
> 
>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>
>

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


Mime
View raw message