https://bz.apache.org/bugzilla/show_bug.cgi?id=64469

--- Comment #3 from Stefan Bodewig <bode...@apache.org> ---
I am getting closer by using the Maven Ant tasks in Ant's own fetch.xml. I told
it to download the equivalent of

    <dependency>
      <groupId>org.graalvm.js</groupId>
      <artifactId>js</artifactId>
      <version>20.1.0</version>
    </dependency>  
    <dependency>
      <groupId>org.graalvm.js</groupId>
      <artifactId>js-scriptengine</artifactId>
      <version>20.1.0</version>
    </dependency>

which resulted in

Downloading: org/graalvm/js/js/20.1.0/js-20.1.0.pom from repository central at
https://repo1.maven.org/maven2/
Transferring 3K from central
Downloading: org/graalvm/regex/regex/20.1.0/regex-20.1.0.pom from repository
central at https://repo1.maven.org/maven2/
Transferring 1K from central
Downloading: org/graalvm/truffle/truffle-api/20.1.0/truffle-api-20.1.0.pom from
repository central at https://repo1.maven.org/maven2/
Transferring 1K from central
Downloading: org/graalvm/sdk/graal-sdk/20.1.0/graal-sdk-20.1.0.pom from
repository central at https://repo1.maven.org/maven2/
Transferring 1K from central
Downloading: com/ibm/icu/icu4j/66.1/icu4j-66.1.pom from repository central at
https://repo1.maven.org/maven2/
Transferring 5K from central
Downloading: org/graalvm/regex/regex/20.1.0/regex-20.1.0.jar from repository
central at https://repo1.maven.org/maven2/
Downloading: org/graalvm/sdk/graal-sdk/20.1.0/graal-sdk-20.1.0.jar from
repository central at https://repo1.maven.org/maven2/
Downloading: org/graalvm/js/js/20.1.0/js-20.1.0.jar from repository central at
https://repo1.maven.org/maven2/
Downloading: org/graalvm/truffle/truffle-api/20.1.0/truffle-api-20.1.0.jar from
repository central at https://repo1.maven.org/maven2/
Downloading: com/ibm/icu/icu4j/66.1/icu4j-66.1.jar from repository central at
https://repo1.maven.org/maven2/
Transferring 2502K from central
Transferring 12632K from central
Transferring 5331K from central
Transferring 524K from central
Transferring 16132K from central
Copying 10 files to /home/stefan/devel/ASF/ant/lib/optional
Downloading: org/graalvm/js/js-scriptengine/20.1.0/js-scriptengine-20.1.0.pom
from repository central at https://repo1.maven.org/maven2/
Transferring 1K from central
Downloading: org/graalvm/js/js-scriptengine/20.1.0/js-scriptengine-20.1.0.jar
from repository central at https://repo1.maven.org/maven2/
Transferring 57K from central
Copying 1 file to /home/stefan/devel/ASF/ant/lib/optional

with this I can create the engine but it looks as if exposing beans  to
graal.js needs something more than we've done for Nashorn. Bassed on Ant's
manual I created

<project name="squares" default="main" basedir=".">
  <target name="main">
    <script language="graal.js" manager="javax"> <![CDATA[
      for (i = 1; i <= 10; i++) {
        echo = squares.createTask("echo");
        echo.setMessage(i*i);
        echo.perform();
      }
    ]]> </script>
  </target>
</project>

and with this I get

BUILD FAILED
/tmp/js.xml:3: TypeError: invokeMember (createTask) on
org.apache.tools.ant.Project@3fc79729 failed due to: Unknown identifier:
createTask
        at <js> :program(<eval>:3:51-76)
        at org.graalvm.polyglot.Context.eval(Context.java:345)

so the engine has been loaded and has access to the Project instance but cannot
invoke the createTask method. I'll try to spend some more time with it at the
weekend, but maybe you can get a step further with the full list of
dependencies.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to