You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2020/05/27 06:11:19 UTC

[ant] branch graal.js created (now 624a0fc)

This is an automated email from the ASF dual-hosted git repository.

bodewig pushed a change to branch graal.js
in repository https://gitbox.apache.org/repos/asf/ant.git.


      at 624a0fc  run scriptdef test with graal.js instead of Nashorn

This branch includes the following new commits:

     new ef1065e  download graal.js so we can use it in tests
     new 624a0fc  run scriptdef test with graal.js instead of Nashorn

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[ant] 01/02: download graal.js so we can use it in tests

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bodewig pushed a commit to branch graal.js
in repository https://gitbox.apache.org/repos/asf/ant.git

commit ef1065ebac380d85fd8d98d4fe39c129c65ddc6d
Author: Stefan Bodewig <bo...@apache.org>
AuthorDate: Wed May 27 08:10:09 2020 +0200

    download graal.js so we can use it in tests
---
 fetch.xml                | 8 +++++++-
 lib/libraries.properties | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/fetch.xml b/fetch.xml
index 44230aa..24e8e6d 100644
--- a/fetch.xml
+++ b/fetch.xml
@@ -319,9 +319,15 @@ Set -Ddest=LOCATION on the command line
     <f2 project="org.mozilla" archive="rhino"/>
   </target>
 
+  <target name="graal.js"
+          description="load Graal.js">
+    <f2 project="org.graalvm.js" archive="js"/>
+    <f2 project="org.graalvm.js" archive="js-scriptengine"/>
+  </target>
+
   <target name="script"
           description="load script languages (except Jython)"
-          depends="bsf,jruby,beanshell,rhino"/>
+          depends="bsf,jruby,beanshell,rhino,graal.js"/>
 
   <target name="debugging"
     description="internal Ant debugging"
diff --git a/lib/libraries.properties b/lib/libraries.properties
index 87fe3cc..ae1a727 100644
--- a/lib/libraries.properties
+++ b/lib/libraries.properties
@@ -42,6 +42,8 @@ bsh.version=2.0b5
 commons-net.version=3.6
 commons-logging.version=1.1
 commons-logging-api.version=${commons-logging.version}
+js.version=20.1.0
+js-scriptengine.version=${js.version}
 hamcrest-core.version=1.3
 hamcrest-library.version=${hamcrest-core.version}
 jai-core.version=1.1.3


[ant] 02/02: run scriptdef test with graal.js instead of Nashorn

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bodewig pushed a commit to branch graal.js
in repository https://gitbox.apache.org/repos/asf/ant.git

commit 624a0fc224682dd0d2a272e07ad5bb830083aebb
Author: Stefan Bodewig <bo...@apache.org>
AuthorDate: Wed May 27 08:10:43 2020 +0200

    run scriptdef test with graal.js instead of Nashorn
---
 build.xml                                                             | 1 +
 src/etc/testcases/taskdefs/optional/script/scriptdef.xml              | 4 ++--
 .../org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java  | 4 ----
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/build.xml b/build.xml
index 4e157d6..829e829 100644
--- a/build.xml
+++ b/build.xml
@@ -1749,6 +1749,7 @@ ${antunit.reports}
                failureproperty="junit.failed"
                errorproperty="junit.failed"
                filtertrace="${junit.filtertrace}">
+          <sysproperty key="polyglot.js.nashorn-compat" value="true"/>
           <sysproperty key="ant.home" value="${ant.home}"/>
           <sysproperty key="build.classes.value" value="${build.classes.value}"/>
           <sysproperty key="build.tests.value" value="${build.tests.value}"/>
diff --git a/src/etc/testcases/taskdefs/optional/script/scriptdef.xml b/src/etc/testcases/taskdefs/optional/script/scriptdef.xml
index 37829c5..c991490 100644
--- a/src/etc/testcases/taskdefs/optional/script/scriptdef.xml
+++ b/src/etc/testcases/taskdefs/optional/script/scriptdef.xml
@@ -164,7 +164,7 @@
 
   <target name="useCompiled">
     <!-- Test with 'javax' manager, 'bsf' manager already compiles the script. -->
-    <scriptdef manager="javax" name="heavyscript" language="javascript" src="heavy-script.js" encoding="UTF-8" compiled="true"/>
+    <scriptdef manager="javax" name="heavyscript" language="graal.js" src="heavy-script.js" encoding="UTF-8" compiled="true"/>
 
     <heavyscript/>
     <heavyscript/>
@@ -189,7 +189,7 @@
   </target>
 
   <target name="useNotCompiled">
-    <scriptdef manager="javax" name="heavyscriptNotCompiled" language="javascript" src="heavy-script.js" encoding="UTF-8" compiled="false"/>
+    <scriptdef manager="javax" name="heavyscriptNotCompiled" language="graal.js" src="heavy-script.js" encoding="UTF-8" compiled="false"/>
 
     <heavyscriptNotCompiled/>
     <heavyscriptNotCompiled/>
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java
index 814b178..39d8729 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java
@@ -21,7 +21,6 @@ import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.BuildFileRule;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.util.JavaEnvUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -30,7 +29,6 @@ import org.junit.rules.ExpectedException;
 import java.io.File;
 
 import static org.hamcrest.Matchers.containsString;
-import static org.junit.Assume.assumeFalse;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
@@ -157,8 +155,6 @@ public class ScriptDefTest {
 
     @Test
     public void testUseCompiled() {
-        assumeFalse("Current system is Java 15 or newer", JavaEnvUtils.isAtLeastJavaVersion("15"));
-
         final long duration;
         {
             long start = System.nanoTime();