diff --git a/storeys/build.gradle b/storeys/build.gradle index 8e3cb74e..3166159d 100644 --- a/storeys/build.gradle +++ b/storeys/build.gradle @@ -8,8 +8,10 @@ dependencies { api project(':api-jvm-impl') api 'ch.vorburger.minecraft.osgi:api:1.0.0' implementation 'ch.vorburger:fswatch:1.3.0' - implementation 'org.graalvm.js:js-scriptengine:21.2.0' - runtimeOnly 'org.graalvm.js:js:21.2.0' + implementation files('libs/graal-sdk.jar') + implementation files('libs/graaljs.jar') + implementation files('libs/tregex.jar') + implementation files('libs/truffle-api.jar') implementation project(':example') testImplementation project(':test-utils') } diff --git a/storeys/libs/graal-sdk.jar b/storeys/libs/graal-sdk.jar new file mode 100644 index 00000000..77a4c1c0 Binary files /dev/null and b/storeys/libs/graal-sdk.jar differ diff --git a/storeys/libs/graaljs.jar b/storeys/libs/graaljs.jar new file mode 100644 index 00000000..ed8673a0 Binary files /dev/null and b/storeys/libs/graaljs.jar differ diff --git a/storeys/libs/tregex.jar b/storeys/libs/tregex.jar new file mode 100644 index 00000000..e543abab Binary files /dev/null and b/storeys/libs/tregex.jar differ diff --git a/storeys/libs/truffle-api.jar b/storeys/libs/truffle-api.jar new file mode 100644 index 00000000..79bd2e18 Binary files /dev/null and b/storeys/libs/truffle-api.jar differ diff --git a/storeys/src/test/java/ch/vorburger/minecraft/storeys/tests/GraalTest.java b/storeys/src/test/java/ch/vorburger/minecraft/storeys/tests/GraalTest.java new file mode 100644 index 00000000..bfaf1f8d --- /dev/null +++ b/storeys/src/test/java/ch/vorburger/minecraft/storeys/tests/GraalTest.java @@ -0,0 +1,39 @@ +/* + * ch.vorburger.minecraft.storeys + * + * Copyright (C) 2016 - 2018 Michael Vorburger.ch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package ch.vorburger.minecraft.storeys.tests; + +import java.util.List; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineFactory; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import org.junit.Test; + +public class GraalTest { + + @Test public void testJsEngine() throws ScriptException { + List engines = (new ScriptEngineManager()).getEngineFactories(); + for (ScriptEngineFactory f : engines) { + System.out.println(f.getLanguageName() + " " + f.getEngineName() + " " + f.getNames().toString()); + } + + final ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("graal.js"); + System.out.println(scriptEngine.eval("1+1")); + } +} diff --git a/web/build.gradle b/web/build.gradle index 8a41ddbf..ec30feea 100644 --- a/web/build.gradle +++ b/web/build.gradle @@ -81,8 +81,6 @@ shadowJar { include(dependency("io.netty:netty-codec-http")) include(dependency("io.netty:netty-codec-http2")) include(dependency("com.fasterxml.jackson.core:jackson-core")) - include(dependency("org.graalvm.js:js-scriptengine")) - include(dependency("org.graalvm.js:js")) exclude 'module-info.class' } }