Skip to content

Commit

Permalink
Added support for polyglot isolates for specific platform.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzezula committed Jun 10, 2024
1 parent dda1813 commit 0f5eb4b
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Download Maven or import as Maven project into your IDE.
* `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.

Expand Down
88 changes: 86 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
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.
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.
-->
Expand Down Expand Up @@ -401,8 +403,90 @@
</plugins>
</build>
</profile>
<!--
Profiles for using a native isolate versions of languages for a specific platform.
Native isolate versions of languages for a specific platforms are supported since
Polyglot version 24.1 for JavaScript (js) and Python (python).
These profiles may be removed if you are not using native isolate versions of languages.
-->
<!-- Linux AMD64 -->
<profile>
<id>isolate-linux-amd64</id>
<activation>
<os>
<family>unix</family>
<name>linux</name>
<arch>amd64</arch>
</os>
</activation>
<properties>
<isolate.platform>linux-amd64</isolate.platform>
</properties>
</profile>
<!-- Linux AARCH64 -->
<profile>
<id>isolate-linux-aarch64</id>
<activation>
<os>
<family>unix</family>
<name>linux</name>
<arch>aarch64</arch>
</os>
</activation>
<properties>
<isolate.platform>linux-aarch64</isolate.platform>
</properties>
</profile>
<!-- macOS AMD64 -->
<profile>
<id>isolate-darwin-amd64</id>
<activation>
<os>
<family>mac</family>
<arch>x86_64</arch>
</os>
</activation>
<properties>
<isolate.platform>darwin-amd64</isolate.platform>
</properties>
</profile>
<!-- macOS AARCH64 -->
<profile>
<id>isolate-darwin-aarch64</id>
<activation>
<os>
<family>mac</family>
<arch>aarch64</arch>
</os>
</activation>
<properties>
<isolate.platform>darwin-aarch64</isolate.platform>
</properties>
</profile>
<!-- Windows AMD64 -->
<profile>
<id>isolate-windows-amd64</id>
<activation>
<os>
<family>windows</family>
<arch>x86_64</arch>
</os>
</activation>
<properties>
<isolate.platform>windows-amd64</isolate.platform>
</properties>
</profile>
<profile>
<id>isolated</id>
<dependencies>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>js-isolate-${isolate.platform}</artifactId>
<version>${graalvm.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</profile>
</profiles>

</project>


0 comments on commit 0f5eb4b

Please sign in to comment.