From f4206f476f1c3ddf1491763726a5ff3048e0dc16 Mon Sep 17 00:00:00 2001 From: Christian Humer Date: Tue, 28 May 2024 14:19:35 +0200 Subject: [PATCH 1/2] Update version. --- .github/workflows/main.yml | 4 ++-- README.md | 6 +++--- build.gradle.kts | 4 ++-- pom.xml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8baac6b..3446885 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 - uses: graalvm/setup-graalvm@v1 with: - java-version: '21.0.2' + java-version: '22.0.1' distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} native-image-job-reports: 'true' @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v4 - uses: graalvm/setup-graalvm@v1 with: - java-version: '21.0.2' + java-version: '22.0.1' distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} native-image-job-reports: 'true' diff --git a/README.md b/README.md index 291c1cd..88effc1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Polyglot Embedding Demo with GraalVM for JDK 21 -Demonstration repository showing polyglot embedding with GraalVM JDK 21 using Maven and Gradle. +# Polyglot Embedding Demo with GraalVM +Demonstration repository showing polyglot embedding with GraalVM using Maven and Gradle. It contains a simple Main and Test class to bootstrap a polyglot embedding project. -For demonstration showing polyglot native embedding with GraalVM JDK 21 using Maven, see +For demonstration showing polyglot native embedding with GraalVM using Maven, see the [Native embedding Maven project](native-embedding/README.md) located in the `native-embedding` subdirectory. For more details on polyglot embedding please see the docs: diff --git a/build.gradle.kts b/build.gradle.kts index 014d8f8..586dc11 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import java.nio.file.* plugins { id("java") id("application") - id("org.graalvm.buildtools.native") version "0.9.28" + id("org.graalvm.buildtools.native") version "0.10.2" } java { @@ -20,7 +20,7 @@ group = "org.example" version = "1.0-SNAPSHOT" description = "embedding" -var graalVMVersion: String = "23.1.2"; +var graalVMVersion: String = "24.0.1"; dependencies { implementation("org.graalvm.polyglot:polyglot:$graalVMVersion") implementation("org.graalvm.polyglot:js:$graalVMVersion") diff --git a/pom.xml b/pom.xml index 2df236a..ae68eb9 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ - 23.1.2 + 24.0.1 @@ -156,7 +156,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.28 + 0.10.2 true From caa96e2a9200122a020079b3cf65b0f0a7d7426b Mon Sep 17 00:00:00 2001 From: Christian Humer Date: Tue, 28 May 2024 14:06:51 +0200 Subject: [PATCH 2/2] Fix incompatibility in GraalWasm example. --- src/main/java/org/example/embedding/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/example/embedding/Main.java b/src/main/java/org/example/embedding/Main.java index db0534a..b8d91e6 100644 --- a/src/main/java/org/example/embedding/Main.java +++ b/src/main/java/org/example/embedding/Main.java @@ -71,7 +71,7 @@ public static void main(String[] args) throws IOException { break; case "wasm": // with wasm we compute factorial - context.eval(Source.newBuilder("wasm", Main.class.getResource("factorial.wasm")).build()); + context.eval(Source.newBuilder("wasm", Main.class.getResource("factorial.wasm")).name("main").build()); Value factorial = context.getBindings("wasm").getMember("main").getMember("fac"); System.out.println("wasm: factorial(20) = " + factorial.execute(20L)); break;