-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
104 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 24.1, 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`. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
* `mvn test` to run the tests | ||
* `mvn exec:exec` to run the Main application | ||
* `mvn exec:exec` to run the Main application. Starting from GraalVM 24.1, you can use `mvn -Pisolated exec:exec` to utilize the native isolate version of a guest language. | ||
This comment has been minimized.
Sorry, something went wrong.
olyagpl
Member
|
||
* `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. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -411,7 +411,7 @@ | |
--> | ||
<!-- Linux AMD64 --> | ||
<profile> | ||
<id>isolate-linux-amd64</id> | ||
<id>isolated-linux-amd64</id> | ||
<activation> | ||
<os> | ||
<family>unix</family> | ||
|
@@ -420,12 +420,12 @@ | |
</os> | ||
</activation> | ||
<properties> | ||
<isolate.platform>linux-amd64</isolate.platform> | ||
<isolate.platform.suffix>-linux-amd64</isolate.platform.suffix> | ||
</properties> | ||
</profile> | ||
<!-- Linux AARCH64 --> | ||
<profile> | ||
<id>isolate-linux-aarch64</id> | ||
<id>isolated-linux-aarch64</id> | ||
<activation> | ||
<os> | ||
<family>unix</family> | ||
|
@@ -434,59 +434,149 @@ | |
</os> | ||
</activation> | ||
<properties> | ||
<isolate.platform>linux-aarch64</isolate.platform> | ||
<isolate.platform.suffix>-linux-aarch64</isolate.platform.suffix> | ||
</properties> | ||
</profile> | ||
<!-- macOS AMD64 --> | ||
<profile> | ||
<id>isolate-darwin-amd64</id> | ||
<id>isolated-darwin-amd64</id> | ||
<activation> | ||
<os> | ||
<family>mac</family> | ||
<arch>x86_64</arch> | ||
</os> | ||
</activation> | ||
<properties> | ||
<isolate.platform>darwin-amd64</isolate.platform> | ||
<isolate.platform.suffix>-darwin-amd64</isolate.platform.suffix> | ||
</properties> | ||
</profile> | ||
<!-- macOS AARCH64 --> | ||
<profile> | ||
<id>isolate-darwin-aarch64</id> | ||
<id>isolated-darwin-aarch64</id> | ||
<activation> | ||
<os> | ||
<family>mac</family> | ||
<arch>aarch64</arch> | ||
</os> | ||
</activation> | ||
<properties> | ||
<isolate.platform>darwin-aarch64</isolate.platform> | ||
<isolate.platform.suffix>-darwin-aarch64</isolate.platform.suffix> | ||
</properties> | ||
</profile> | ||
<!-- Windows AMD64 --> | ||
<profile> | ||
<id>isolate-windows-amd64</id> | ||
<id>isolated-windows-amd64</id> | ||
<activation> | ||
<os> | ||
<family>windows</family> | ||
<arch>x86_64</arch> | ||
</os> | ||
</activation> | ||
<properties> | ||
<isolate.platform>windows-amd64</isolate.platform> | ||
<isolate.platform.suffix>-windows-amd64</isolate.platform.suffix> | ||
</properties> | ||
</profile> | ||
<!-- | ||
Profile to package polyglot isolate libraries for all supported platforms. | ||
The profile is activated using `mvn -Pisolated -Disolated.all.platforms` | ||
--> | ||
<profile> | ||
<id>isolated-all-platforms</id> | ||
<activation> | ||
<property> | ||
<name>isolated.all.platforms</name> | ||
</property> | ||
</activation> | ||
<properties> | ||
<isolate.platform.suffix></isolate.platform.suffix> | ||
</properties> | ||
</profile> | ||
<!-- | ||
Profile for using isolated version of a guest language. | ||
The profile is activated by `mvn -Pisolated`. | ||
--> | ||
<profile> | ||
<id>isolated</id> | ||
<properties> | ||
<isolated.language.id>js</isolated.language.id> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.graalvm.polyglot</groupId> | ||
<artifactId>js-isolate-${isolate.platform}</artifactId> | ||
<artifactId>js-isolate${isolate.platform.suffix}</artifactId> | ||
<version>${graalvm.version}</version> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.graalvm.polyglot</groupId> | ||
<artifactId>js</artifactId> | ||
<version>${graalvm.version}</version> | ||
<type>pom</type> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>3.1.2</version> | ||
<configuration> | ||
<systemProperties combine.children="append"> | ||
<property> | ||
<name>-Dpolyglot.engine.SpawnIsolate</name> | ||
<value>${isolated.language.id}</value> | ||
</property> | ||
</systemProperties> | ||
<classpathDependencyExcludes> | ||
<classpathDependencyExclude>org.graalvm.polyglot:js</classpathDependencyExclude> | ||
</classpathDependencyExcludes> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>3.1.0</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>no-runtime-compilation</id> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>${java.home}/bin/java</executable> | ||
<arguments> | ||
<argument>-Dpolyglot.engine.SpawnIsolate=${isolated.language.id}</argument> | ||
<!-- We recommend running from the module-path by default. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
But you can also switch to the class-path here.--> | ||
This comment has been minimized.
Sorry, something went wrong.
olyagpl
Member
|
||
<argument>--module-path</argument> | ||
<modulepath/> | ||
<argument>-m</argument> | ||
<argument>embedding/org.example.embedding.Main</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<executable>${java.home}/bin/java</executable> | ||
<arguments> | ||
<argument>-Dpolyglot.engine.SpawnIsolate=${isolated.language.id}</argument> | ||
<!-- We recommend running from the module-path by default. | ||
But you can also switch to the class-path here.--> | ||
<argument>--module-path</argument> | ||
<modulepath/> | ||
<argument>-m</argument> | ||
<argument>embedding/org.example.embedding.Main</argument> | ||
</arguments> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
mvn package
build usingjavac
. Starting from GraalVM Polyglot API version 24.1.0, you can usemvn -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, usemvn -Pisolated -Disolated.all.platforms package
.