You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by jt...@apache.org on 2020/12/26 14:39:57 UTC
[netbeans-html4j] 02/25: Include graal-js as a subsitute for
missing Nashorn on JDK15
This is an automated email from the ASF dual-hosted git repository.
jtulach pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans-html4j.git
commit e6b099d099537e378156d1e1e4a131758b814f08
Author: Jaroslav Tulach <ja...@apidesign.org>
AuthorDate: Mon Dec 7 07:49:38 2020 +0100
Include graal-js as a subsitute for missing Nashorn on JDK15
---
boot-script/pom.xml | 8 ++++++++
.../test/java/net/java/html/boot/script/KOCase.java | 2 +-
.../net/java/html/boot/script/KnockoutEnvJSTest.java | 4 +++-
boot/pom.xml | 8 ++++++++
generic/pom.xml | 8 ++++++++
json/pom.xml | 8 ++++++++
json/src/test/java/net/java/html/json/TypesTest.java | 1 +
pom.xml | 19 +++++++++++++++++--
sound/pom.xml | 8 ++++++++
9 files changed, 62 insertions(+), 4 deletions(-)
diff --git a/boot-script/pom.xml b/boot-script/pom.xml
index 40378ca..91f62fc 100644
--- a/boot-script/pom.xml
+++ b/boot-script/pom.xml
@@ -122,5 +122,13 @@
<scope>test</scope>
<type>jar</type>
</dependency>
+ <dependency>
+ <groupId>org.graalvm.js</groupId>
+ <artifactId>js</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.graalvm.js</groupId>
+ <artifactId>js-scriptengine</artifactId>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/boot-script/src/test/java/net/java/html/boot/script/KOCase.java b/boot-script/src/test/java/net/java/html/boot/script/KOCase.java
index c565de9..7a74fc9 100644
--- a/boot-script/src/test/java/net/java/html/boot/script/KOCase.java
+++ b/boot-script/src/test/java/net/java/html/boot/script/KOCase.java
@@ -50,7 +50,7 @@ public final class KOCase implements ITest, Runnable {
@Override
public String getTestName() {
- return m.getName();
+ return m != null ? m.getName() : skipMsg;
}
@Test
diff --git a/boot-script/src/test/java/net/java/html/boot/script/KnockoutEnvJSTest.java b/boot-script/src/test/java/net/java/html/boot/script/KnockoutEnvJSTest.java
index 6316f10..92b7088 100644
--- a/boot-script/src/test/java/net/java/html/boot/script/KnockoutEnvJSTest.java
+++ b/boot-script/src/test/java/net/java/html/boot/script/KnockoutEnvJSTest.java
@@ -70,7 +70,9 @@ public final class KnockoutEnvJSTest extends KnockoutTCK {
@Factory public static Object[] compatibilityTests() throws Exception {
ScriptEngine eng = new ScriptEngineManager().getEngineByName("nashorn");
if (eng == null) {
- throw new SkipException("Nashorn engine not found. Skipping!");
+ return new Object[] {
+ new KOCase(null, null, "Nashorn engine not found. Skipping!")
+ };
}
Class[] arr = testClasses();
diff --git a/boot/pom.xml b/boot/pom.xml
index 59fc227..19968a5 100644
--- a/boot/pom.xml
+++ b/boot/pom.xml
@@ -84,6 +84,14 @@
<scope>test</scope>
<type>jar</type>
</dependency>
+ <dependency>
+ <groupId>org.graalvm.js</groupId>
+ <artifactId>js</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.graalvm.js</groupId>
+ <artifactId>js-scriptengine</artifactId>
+ </dependency>
</dependencies>
<description>Builder to launch your Java/HTML based application.</description>
</project>
diff --git a/generic/pom.xml b/generic/pom.xml
index 0008110..1669f11 100644
--- a/generic/pom.xml
+++ b/generic/pom.xml
@@ -61,6 +61,14 @@
<groupId>com.dukescript.api</groupId>
<artifactId>strings</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.graalvm.js</groupId>
+ <artifactId>js</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.graalvm.js</groupId>
+ <artifactId>js-scriptengine</artifactId>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/json/pom.xml b/json/pom.xml
index 0c84eac..31c5a96 100644
--- a/json/pom.xml
+++ b/json/pom.xml
@@ -82,6 +82,14 @@
<artifactId>net.java.html</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.graalvm.js</groupId>
+ <artifactId>js</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.graalvm.js</groupId>
+ <artifactId>js-scriptengine</artifactId>
+ </dependency>
</dependencies>
<description>API for smooth representation of JSON objects in Java. Write your
application in Java and
diff --git a/json/src/test/java/net/java/html/json/TypesTest.java b/json/src/test/java/net/java/html/json/TypesTest.java
index 465c752..2185bd3 100644
--- a/json/src/test/java/net/java/html/json/TypesTest.java
+++ b/json/src/test/java/net/java/html/json/TypesTest.java
@@ -111,6 +111,7 @@ public class TypesTest {
private static void assertValidJSON(String text) {
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine eng = sem.getEngineByMimeType("text/javascript");
+ assertNotNull(eng, "JavaScript engine found");
try {
eng.eval("var obj = " + text + ";");
} catch (ScriptException ex) {
diff --git a/pom.xml b/pom.xml
index ed859f3..6e875e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,8 @@
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <netbeans.version>RELEASE110</netbeans.version>
+ <netbeans.version>RELEASE121</netbeans.version>
+ <graalvm.version>20.3.0</graalvm.version>
<grizzly.version>2.3.8</grizzly.version>
<license>COPYING</license>
<publicPackages />
@@ -280,7 +281,7 @@ org.netbeans.html.boot.impl:org.netbeans.html.boot.fx:org.netbeans.html.context.
<dependency>
<artifactId>compiler-maven-plugin</artifactId>
<groupId>org.frgaal</groupId>
- <version>14.0.1</version>
+ <version>15.0.0</version>
</dependency>
</dependencies>
<configuration>
@@ -535,6 +536,20 @@ org.netbeans.html.boot.impl:org.netbeans.html.boot.fx:org.netbeans.html.context.
<type>jar</type>
<version>${netbeans.version}</version>
</dependency>
+ <dependency>
+ <artifactId>js</artifactId>
+ <groupId>org.graalvm.js</groupId>
+ <type>jar</type>
+ <scope>test</scope>
+ <version>${graalvm.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>js-scriptengine</artifactId>
+ <groupId>org.graalvm.js</groupId>
+ <type>jar</type>
+ <scope>test</scope>
+ <version>${graalvm.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<profiles>
diff --git a/sound/pom.xml b/sound/pom.xml
index f8a8637..e6ce1ad 100644
--- a/sound/pom.xml
+++ b/sound/pom.xml
@@ -97,5 +97,13 @@
<artifactId>org-openide-util-lookup</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.graalvm.js</groupId>
+ <artifactId>js</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.graalvm.js</groupId>
+ <artifactId>js-scriptengine</artifactId>
+ </dependency>
</dependencies>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists