Skip to content

Commit

Permalink
trying with java8 libs
Browse files Browse the repository at this point in the history
  • Loading branch information
edewit committed Jan 29, 2023
1 parent 0d0799e commit 8c3c89f
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 4 deletions.
6 changes: 4 additions & 2 deletions storeys/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Binary file added storeys/libs/graal-sdk.jar
Binary file not shown.
Binary file added storeys/libs/graaljs.jar
Binary file not shown.
Binary file added storeys/libs/tregex.jar
Binary file not shown.
Binary file added storeys/libs/truffle-api.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* ch.vorburger.minecraft.storeys
*
* Copyright (C) 2016 - 2018 Michael Vorburger.ch <[email protected]>
*
* 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 <http://www.gnu.org/licenses/>.
*/
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<ScriptEngineFactory> 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"));
}
}
2 changes: 0 additions & 2 deletions web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
Expand Down

0 comments on commit 8c3c89f

Please sign in to comment.