Skip to content

Commit

Permalink
Resolved review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzezula committed Jun 13, 2024
1 parent 0f5eb4b commit ac5a353
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 15 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
* `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.
* `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
111 changes: 99 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
-->
<!-- Linux AMD64 -->
<profile>
<id>isolate-linux-amd64</id>
<id>isolated-linux-amd64</id>
<activation>
<os>
<family>unix</family>
Expand All @@ -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>
Expand All @@ -434,59 +434,146 @@
</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>
</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.
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>
</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>

0 comments on commit ac5a353

Please sign in to comment.