Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GraalVM Version. Fix WASM incompatibility. #11

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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";
chumer marked this conversation as resolved.
Show resolved Hide resolved
dependencies {
implementation("org.graalvm.polyglot:polyglot:$graalVMVersion")
implementation("org.graalvm.polyglot:js:$graalVMVersion")
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<properties>
<!-- Select the GraalVM version to use. -->
<graalvm.version>23.1.2</graalvm.version>
<graalvm.version>24.0.1</graalvm.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -156,7 +156,7 @@
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.9.28</version>
<version>0.10.2</version>
<extensions>true</extensions>
<executions>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/example/embedding/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down