From 947dd03b74143a85a8461da21b098f6fa5d7ecfe Mon Sep 17 00:00:00 2001 From: Tomas Zezula Date: Thu, 13 Jun 2024 11:06:59 +0200 Subject: [PATCH] Resolved review comments. --- README.md | 5 +- pom.xml | 136 ++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 120 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index e56750b..94c5861 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,12 @@ https://www.graalvm.org/latest/reference-manual/embed-languages/ Download Maven or import as Maven project into your IDE. -* `mvn package` build using javac +* `mvn package` build using `javac`. Starting from GraalVM Polyglot API version 24.1.0, you can use `mvn -Pisolated package` to build with the native isolate version of a guest language. By default, only the native isolate library for the current platform is installed. To install native isolate libraries for all supported platforms, use `mvn -Pisolated -Disolated.all.platforms package`. * `mvn test` to run the tests -* `mvn exec:exec` to run the Main application +* `mvn exec:exec` to run the application. Starting from GraalVM Polyglot API version 24.1.0, you can use `mvn -Pisolated exec:exec` to embed the native isolate version of a guest language. * `mvn -Pnative package` to build a native-image * `mvn -Passembly package` to build an uber JAR containing all dependencies using the Maven Assembly Plugin. The resulting JAR can be executed using `java -jar embedding-1.0-SNAPSHOT-jar-with-dependencies.jar`. We do recommend not using shading whenever possible. * `mvn -Pshade package` to build an uber JAR containing all dependencies using the Maven Shade Plugin. The resulting JAR can be executed using `java -jar embedding-1.0-SNAPSHOT.jar`. We do recommend not using shading whenever possible. -* `mvn -Pisolated package` to install native isolate versions of languages for the current platform Please see the [pom.xml](./pom.xml) file for further details on the configuration. diff --git a/pom.xml b/pom.xml index 6ddbe63..4dcf779 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ Switch to community licenses by adding a `-community` suffix to the artefact id (e.g. `js-communtiy`). Switch to native isolate versions of languages by adding a `-isolate` suffix. (`js-isolate`). - Since Polyglot version 24.1, native isolate versions of languages for specific platforms are supported. + Starting from GraalVM Polyglot API version 24.1.0, native isolate versions of languages for specific platforms are supported. Refer to the `isolate` profiles for instructions on how to activate them. Any dependency in the org.graalvm.polyglot group is intended for use by polyglot embeddings. @@ -108,8 +108,10 @@ ${java.home}/bin/java - + --module-path -m @@ -121,8 +123,10 @@ ${java.home}/bin/java - + --module-path -m @@ -225,7 +229,7 @@ copy-dependencies @@ -411,7 +415,7 @@ --> - isolate-linux-amd64 + isolated-linux-amd64 unix @@ -420,12 +424,12 @@ - linux-amd64 + -linux-amd64 - isolate-linux-aarch64 + isolated-linux-aarch64 unix @@ -434,12 +438,12 @@ - linux-aarch64 + -linux-aarch64 - isolate-darwin-amd64 + isolated-darwin-amd64 mac @@ -447,12 +451,12 @@ - darwin-amd64 + -darwin-amd64 - isolate-darwin-aarch64 + isolated-darwin-aarch64 mac @@ -460,12 +464,12 @@ - darwin-aarch64 + -darwin-aarch64 - isolate-windows-amd64 + isolated-windows-amd64 windows @@ -473,20 +477,116 @@ - windows-amd64 + -windows-amd64 + + + isolated-all-platforms + + + isolated.all.platforms + + + + + + + isolated + + js + org.graalvm.polyglot - js-isolate-${isolate.platform} + js-isolate${isolate.platform.suffix} + ${graalvm.version} + pom + + + + org.graalvm.polyglot + js ${graalvm.version} pom + provided + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + ${isolated.language.id} + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + + exec + + + + no-runtime-compilation + + exec + + + ${java.home}/bin/java + + -Dpolyglot.engine.SpawnIsolate=${isolated.language.id} + + --module-path + + -m + embedding/org.example.embedding.Main + + + + + + ${java.home}/bin/java + + -Dpolyglot.engine.SpawnIsolate=${isolated.language.id} + + --module-path + + -m + embedding/org.example.embedding.Main + + + + + -