Skip to content

Commit ec11095

Browse files
committed
Resolved review comments.
1 parent 0f5eb4b commit ec11095

File tree

2 files changed

+98
-15
lines changed

2 files changed

+98
-15
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ https://www.graalvm.org/latest/reference-manual/embed-languages/
1616

1717
Download Maven or import as Maven project into your IDE.
1818

19-
* `mvn package` build using javac
19+
* `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`.
2020
* `mvn test` to run the tests
21-
* `mvn exec:exec` to run the Main application
21+
* `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.
2222
* `mvn -Pnative package` to build a native-image
2323
* `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.
2424
* `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.
25-
* `mvn -Pisolated package` to install native isolate versions of languages for the current platform
2625

2726
Please see the [pom.xml](./pom.xml) file for further details on the configuration.
2827

pom.xml

Lines changed: 96 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@
411411
-->
412412
<!-- Linux AMD64 -->
413413
<profile>
414-
<id>isolate-linux-amd64</id>
414+
<id>isolated-linux-amd64</id>
415415
<activation>
416416
<os>
417417
<family>unix</family>
@@ -420,12 +420,12 @@
420420
</os>
421421
</activation>
422422
<properties>
423-
<isolate.platform>linux-amd64</isolate.platform>
423+
<isolate.platform.suffix>-linux-amd64</isolate.platform.suffix>
424424
</properties>
425425
</profile>
426426
<!-- Linux AARCH64 -->
427427
<profile>
428-
<id>isolate-linux-aarch64</id>
428+
<id>isolated-linux-aarch64</id>
429429
<activation>
430430
<os>
431431
<family>unix</family>
@@ -434,59 +434,143 @@
434434
</os>
435435
</activation>
436436
<properties>
437-
<isolate.platform>linux-aarch64</isolate.platform>
437+
<isolate.platform.suffix>-linux-aarch64</isolate.platform.suffix>
438438
</properties>
439439
</profile>
440440
<!-- macOS AMD64 -->
441441
<profile>
442-
<id>isolate-darwin-amd64</id>
442+
<id>isolated-darwin-amd64</id>
443443
<activation>
444444
<os>
445445
<family>mac</family>
446446
<arch>x86_64</arch>
447447
</os>
448448
</activation>
449449
<properties>
450-
<isolate.platform>darwin-amd64</isolate.platform>
450+
<isolate.platform.suffix>-darwin-amd64</isolate.platform.suffix>
451451
</properties>
452452
</profile>
453453
<!-- macOS AARCH64 -->
454454
<profile>
455-
<id>isolate-darwin-aarch64</id>
455+
<id>isolated-darwin-aarch64</id>
456456
<activation>
457457
<os>
458458
<family>mac</family>
459459
<arch>aarch64</arch>
460460
</os>
461461
</activation>
462462
<properties>
463-
<isolate.platform>darwin-aarch64</isolate.platform>
463+
<isolate.platform.suffix>-darwin-aarch64</isolate.platform.suffix>
464464
</properties>
465465
</profile>
466466
<!-- Windows AMD64 -->
467467
<profile>
468-
<id>isolate-windows-amd64</id>
468+
<id>isolated-windows-amd64</id>
469469
<activation>
470470
<os>
471471
<family>windows</family>
472472
<arch>x86_64</arch>
473473
</os>
474474
</activation>
475475
<properties>
476-
<isolate.platform>windows-amd64</isolate.platform>
476+
<isolate.platform.suffix>-windows-amd64</isolate.platform.suffix>
477477
</properties>
478478
</profile>
479+
<!--
480+
Profile to package polyglot isolate libraries for all supported platforms.
481+
The profile is activated using `mvn -Pisolated -Disolated.all.platforms`
482+
-->
483+
<profile>
484+
<id>isolated-all-platforms</id>
485+
<activation>
486+
<property>
487+
<name>isolated.all.platforms</name>
488+
</property>
489+
</activation>
490+
<properties>
491+
<isolate.platform.suffix></isolate.platform.suffix>
492+
</properties>
493+
</profile>
494+
<!--
495+
Profile for using isolated version of a guest language.
496+
The profile is activated by `mvn -Pisolated`.
497+
-->
479498
<profile>
480499
<id>isolated</id>
500+
<properties>
501+
<isolated.language.id>js</isolated.language.id>
502+
</properties>
481503
<dependencies>
482504
<dependency>
483505
<groupId>org.graalvm.polyglot</groupId>
484-
<artifactId>js-isolate-${isolate.platform}</artifactId>
506+
<artifactId>js-isolate${isolate.platform.suffix}</artifactId>
507+
<version>${graalvm.version}</version>
508+
<type>pom</type>
509+
</dependency>
510+
<dependency>
511+
<groupId>org.graalvm.polyglot</groupId>
512+
<artifactId>js</artifactId>
485513
<version>${graalvm.version}</version>
486514
<type>pom</type>
515+
<scope>provided</scope>
487516
</dependency>
488517
</dependencies>
518+
<build>
519+
<plugins>
520+
<plugin>
521+
<groupId>org.apache.maven.plugins</groupId>
522+
<artifactId>maven-surefire-plugin</artifactId>
523+
<version>3.1.2</version>
524+
<configuration>
525+
<systemPropertyVariables>
526+
<polyglot.engine.SpawnIsolate>${isolated.language.id}</polyglot.engine.SpawnIsolate>
527+
</systemPropertyVariables>
528+
</configuration>
529+
</plugin>
530+
<plugin>
531+
<groupId>org.codehaus.mojo</groupId>
532+
<artifactId>exec-maven-plugin</artifactId>
533+
<version>3.1.0</version>
534+
<executions>
535+
<execution>
536+
<goals>
537+
<goal>exec</goal>
538+
</goals>
539+
</execution>
540+
<execution>
541+
<id>no-runtime-compilation</id>
542+
<goals>
543+
<goal>exec</goal>
544+
</goals>
545+
<configuration>
546+
<executable>${java.home}/bin/java</executable>
547+
<arguments>
548+
<argument>-Dpolyglot.engine.SpawnIsolate=${isolated.language.id}</argument>
549+
<!-- We recommend running from the module-path by default.
550+
But you can also switch to the class-path here.-->
551+
<argument>--module-path</argument>
552+
<modulepath/>
553+
<argument>-m</argument>
554+
<argument>embedding/org.example.embedding.Main</argument>
555+
</arguments>
556+
</configuration>
557+
</execution>
558+
</executions>
559+
<configuration>
560+
<executable>${java.home}/bin/java</executable>
561+
<arguments>
562+
<argument>-Dpolyglot.engine.SpawnIsolate=${isolated.language.id}</argument>
563+
<!-- We recommend running from the module-path by default.
564+
But you can also switch to the class-path here.-->
565+
<argument>--module-path</argument>
566+
<modulepath/>
567+
<argument>-m</argument>
568+
<argument>embedding/org.example.embedding.Main</argument>
569+
</arguments>
570+
</configuration>
571+
</plugin>
572+
</plugins>
573+
</build>
489574
</profile>
490575
</profiles>
491-
492576
</project>

0 commit comments

Comments
 (0)