ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tzabari, Gili" <Gili.Tzab...@nuance.com>
Subject RE: Custom Task that exports a property
Date Wed, 09 Aug 2006 14:21:14 GMT

	Sorry but how do I invoke the <java> task from within my custom
task? You guys said to use <antcall> but I'm not clear on how to do this
using the programmatic API (as opposed to embedding code in the build.xml
file).

Thanks,
Gili
-----Original Message-----
From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de] 
Sent: Wednesday, August 09, 2006 2:32 AM
To: Ant Users List
Subject: RE: Custom Task that exports a property


Hi,

beside =
project.setNewProperty() for a really new property

there's also =
project.setProperty() - with that method you can reset/overwrite
an existing property if you need to

btw you can always use such methods with <script> task, you
don't always need a new task, f.e.

<property name="FOO" value="bla" />

    <target name="reset">
            
    <!-- groovy -->
    <groovy>
    ant.project.setProperty("FOO","blabla");
    </groovy>

    <echo>Reset $${FOO} Nr.1 via Groovy >>> ${FOO}</echo>

    <!-- javascript -->
    <script language="javascript">
    <![CDATA[
    // overwrite property
     reset.setProperty("FOO","blablabla");
    // new Property
    project.setNewProperty("MyNewProperty", "foobar");
     ]]>
    </script>

    <echo>Reset $${FOO} Nr.2 via JavaScript >>> ${FOO}</echo>
    <echo>$${MyNewProperty} >>> ${MyNewProperty}  </echo>


Regards, Gilbert
 

-----Original Message-----
From: Tzabari, Gili [mailto:Gili.Tzabari@nuance.com] 
Sent: Tuesday, August 08, 2006 9:13 PM
To: Ant Users List
Subject: RE: Custom Task that exports a property


	Actually I think I was looking for project.setNewProperty()
which I
just ran into now :) I guess one uses AntCallback for chaining calls?

Thanks,
Gili
-----Original Message-----
From: Chun Ji [mailto:CJi@pro-unlimited.com] 
Sent: Tuesday, August 08, 2006 3:10 PM
To: Ant Users List
Subject: RE: Custom Task that exports a property


google "antcallback"

-cji

-----Original Message-----
From: Tzabari, Gili [mailto:Gili.Tzabari@nuance.com]
Sent: Tuesday, August 08, 2006 11:56 AM
To: Ant Users List
Subject: Custom Task that exports a property
Importance: Low


Hi,

	I read the tutorial on how to create new Tasks but I am unsure
how
my custom task can define new properties in its execute() that would
then be
visible to the rest of the Ant script. Also, how can my Ant task invoke
other Ant tasks? If I could invoke <property> from inside my execute()
it
would solve my problem.

Thank you,
Gili

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

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

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


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

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


Mime
View raw message