Is it possible to call an ant task that is in the same ant script from a javascript scripdef task?
Yes. In case you meant target, rather than a task, here are examples of both:
<target name="test">
<echo message="In test target" />
</target>
<scriptdef name="demo" language="javascript">
<![CDATA[
self.project.executeTarget( "test" );
var task = project.createTask( "echo" );
task.setMessage( "In demo task" );
task.perform( );
]]>
</scriptdef>
<demo />
When run, yields:
test:
[echo] In test target
[echo] In demo task
It may be useful to refer to the Ant API and docs for the script
task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With