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 in example. #10

Closed
wants to merge 3 commits into from
Closed
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
25 changes: 23 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 @@ -147,6 +147,10 @@
This profile may be removed if no native-image builds are needed.
-->
<id>native</id>
<properties>
<image.name>${project.artifactId}</image.name>
<image.path>${project.build.directory}/${image.name}</image.path>
</properties>
<build>
<plugins>
<plugin>
Expand All @@ -164,14 +168,31 @@
</execution>
</executions>
<configuration>
<imageName>${project.artifactId}</imageName>
<imageName>${image.name}</imageName>
<mainClass>org.example.embedding.Main</mainClass>
<buildArgs>
<buildArg>--no-fallback</buildArg>
<buildArg>-J-Xmx20g</buildArg>
</buildArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${image.path}</executable>
<arguments/>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
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