ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gintautas Grigelionis <g.grigelio...@gmail.com>
Subject Script task specification
Date Mon, 28 Oct 2019 13:24:56 GMT
The documentation of the script task states:

"All items (tasks, targets, etc) of the running project are accessible from
the script, using either their name or id attributes (as long as their
names are considered valid Java identifiers, that is). "

However, the following fails:

<?xml version="1.0"?>
<project name="test" default="main" basedir=".">
  <target name="sub">
    <echo id="foo">Executing a task</echo>
  </target>

  <!-- tests the script stuff -->
  <target name="main">
    <script language="javascript"><![CDATA[
        foo.setMessage("I'm a foo!")
        sub.execute()
    ]]></script>
  </target>
</project>

Surely there are more limitations? Besides, failure modes are different in
Rhino (unable to create engine) and Nashorn (reference not defined).

Regards,
Gintas

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message