Skip to content

Commit a257665

Browse files
committed
Merge branch 'release/0.5.6'
2 parents 585b1c1 + 6df0b8b commit a257665

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1221
-936
lines changed

.travis.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,28 @@ matrix:
2525
# jdk: oraclejdk9
2626
# - env: JDK='OpenJDK 9'
2727
# install: . ./install-jdk.sh -F 9
28-
# 10
29-
- env: JDK='Oracle JDK 10'
30-
jdk: oraclejdk10
31-
- env: JDK='OpenJDK 10'
32-
install: . ./install-jdk.sh -F 10 -L GPL
33-
# 11
34-
- env: JDK='Oracle JDK 11'
35-
install: . ./install-jdk.sh -F 11 -L BCL
28+
# JDK 10 is EOL
29+
# # 10
30+
# - env: JDK='Oracle JDK 10'
31+
# jdk: oraclejdk10
32+
# - env: JDK='OpenJDK 10'
33+
# install: . ./install-jdk.sh -F 10 -L GPL
34+
# # 11 (Oracle and OpenJDK are pretty similar)
35+
# - env: JDK='Oracle JDK 11'
36+
# install: . ./install-jdk.sh -F 11 -L BCL
3637
- env: JDK='OpenJDK 11'
3738
install: . ./install-jdk.sh -F 11 -L GPL
3839
# GraalVM
3940
- env: JDK='GraalVM 1.0.0'
40-
install: . ./install-jdk.sh --url https://github.com/oracle/graal/releases/download/vm-1.0.0-rc7/graalvm-ce-1.0.0-rc7-linux-amd64.tar.gz
41+
install: . ./install-jdk.sh --url https://github.com/oracle/graal/releases/download/vm-1.0.0-rc9/graalvm-ce-1.0.0-rc9-linux-amd64.tar.gz
42+
# OpenJ9
43+
- env: JDK='OpenJ9 13'
44+
install: . ./install-jdk.sh --url https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11-jdk_x64_linux_openj9_11.0.1_13.tar.gz
4145
allow_failures:
42-
# Non LTS releases are OK to fail
43-
- env: JDK='Oracle JDK 10'
44-
- env: JDK='OpenJDK 10'
46+
# # Non LTS releases are OK to fail
47+
# - env: JDK='OpenJDK 9'
48+
# - env: JDK='OpenJDK 10'
49+
- env: JDK='OpenJ9 13'
4550

4651
script:
4752
- echo PATH = ${PATH}
@@ -50,7 +55,8 @@ script:
5055
- mvn --settings settings.xml test -B
5156

5257
after_success:
53-
- bash <(curl -s https://codecov.io/bash)
58+
- '[[ "${JDK}" = "GraalVM 1.0.0" ]] &&
59+
bash <(curl -s https://codecov.io/bash) || true'
5460
- '[[ "${TRAVIS_BRANCH}" = "develop" ]] &&
5561
[[ "${TRAVIS_PULL_REQUEST}" = "false" ]] &&
5662
[[ "${JDK}" = "OpenJDK 11" ]] &&

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88

99
## [Unreleased]
10+
- Added a package command to package either fat jar or a JVMCI fat jar.
11+
- Fix issue preventing GraalJS running on OpenJ9
12+
- Allow specifying absolute path as start module
1013
- implemented module aliases
1114
- fixed node inspector paths for debugging
1215
- fixed runtime definitions

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,26 @@ suite.run();
5656

5757
Profit!
5858

59-
# Documentation
59+
## JDK11
60+
61+
If you don't want to run on GraalVM JDK but prefer [OpenJDK11](https://adoptopenjdk.net/index.html?variant=openjdk11&jvmVariant=hotspot),
62+
or even [OpenJ9](https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=openj9) all you need to do is **prefix**
63+
any `NPM` / `Maven` command with the variable `JVMCI=1`, e.g.:
64+
65+
```bash
66+
JVMCI=1 npm install
67+
JVMCI=1 npm start
68+
```
69+
70+
This will assume you're running on plain JDK11, if you don't want to type the variable all the time or set it to your
71+
environment, you can add it to your `package.json` as:
72+
73+
```json
74+
{
75+
"jvmci": true
76+
}
77+
```
78+
79+
## Documentation
6080

6181
For more documentation please see [docs](./docs).

docs/README.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ add the package [es4x-cli](https://www.npmjs.com/package/es4x-cli) to your
6464
"postinstall": "es4x postinstall",
6565
"test": "es4x launcher test",
6666
"start": "es4x launcher run",
67-
"shell": "es4x shell"
67+
"shell": "es4x shell",
68+
"package": "es4x package"
6869
},
6970
"license": "ISC",
7071
"private": true,
@@ -80,8 +81,8 @@ As of this moment you can follow the normal workflow. For example in order to cr
8081
```json
8182
{
8283
"dependencies": {
83-
"@vertx/core": "3.5.3",
84-
"@vertx/web": "3.5.3"
84+
"@vertx/core": "3.5.4",
85+
"@vertx/web": "3.5.4"
8586
}
8687
}
8788
```
@@ -163,7 +164,7 @@ It is common to package JVM applications as runnable `JAR` files, the `es4x-cli`
163164
`maven-shade-plugin` configured for this:
164165

165166
```sh
166-
mvn clean package
167+
npm run package
167168
```
168169

169170
And a new `JAR` file should be built in your `target` directory.
@@ -172,6 +173,34 @@ Packaging will re-arrange your application code to be moved to the directory `no
172173
it can be used from other JARs. In order for this to work correctly, the current `node_modules` are also
173174
bundled in the jar as well as all files listed under the `files` property of your `package.json`.
174175

176+
When running this script you will see also the output command you need to use to run your application e.g.:
177+
178+
```bash
179+
# Running on a GraalVM JVM
180+
Running: /home/plopes/Projects/reactiverse/es4x/examples/empty-project/mvnw ... package
181+
Run your application with:
182+
183+
java \
184+
-jar target/empty-project-1.0.0-bin.jar
185+
```
186+
187+
Note that if you run with the environment flag `JVMCI` then you can run your app on JDK11 too but the start command
188+
will be a little more complex, this is what the script tells you e.g.:
189+
190+
```bash
191+
Running: /home/plopes/Projects/reactiverse/es4x/examples/empty-project/mvnw ... package
192+
Run your application with:
193+
194+
java \
195+
--module-path=target/compiler \
196+
-XX:+UnlockExperimentalVMOptions \
197+
-XX:+EnableJVMCI \
198+
--upgrade-module-path=target/compiler/compiler.jar \
199+
-jar target/empty-project-1.0.0-bin-jvmci.jar
200+
```
201+
202+
In this case you need not just the binary jar, but also the directory `target/compiler`. With this you can run using
203+
the GraalJS engine on any JDK11.
175204

176205
### Shell/ REPL
177206

docs/graal/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GraalVM Support
22

3-
ES4X has **experimental** GraalVM support. The same code will run either on Nashorn (JS Engine in JDK>=8) or GraalJS
4-
(if run on GraalVM).
3+
ES4X has GraalVM support. The same code will run either on Nashorn (JS Engine in JDK>=8) or GraalJS
4+
(if run on GraalVM or a JVMCI enabled JVM).
55

66
There are benefits on using GraalJS namely the updated language support >=ES6 and support out of the box for generators,
77
promises, etc....

es4x-cli/.pom.xml

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,93 @@
2424
<maven.compiler.source>1.8</maven.compiler.source>
2525
<maven.compiler.testSource>1.8</maven.compiler.testSource>
2626
<maven.compiler.testTarget>1.8</maven.compiler.testTarget>
27+
<shade.classifier>bin</shade.classifier>
2728
</properties>
2829

30+
<profiles>
31+
<profile>
32+
<id>jvmci</id>
33+
<activation>
34+
<property>
35+
<name>env.JVMCI</name>
36+
</property>
37+
</activation>
38+
<properties>
39+
<shade.classifier>bin-jvmci</shade.classifier>
40+
</properties>
41+
<dependencies>
42+
<!-- GraalVM runtime -->
43+
<dependency>
44+
<groupId>org.graalvm.truffle</groupId>
45+
<artifactId>truffle-api</artifactId>
46+
<version>[{{graalVersion}},)</version>
47+
<scope>runtime</scope>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.graalvm.js</groupId>
51+
<artifactId>js</artifactId>
52+
<version>[{{graalVersion}},)</version>
53+
<scope>runtime</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.graalvm.tools</groupId>
57+
<artifactId>profiler</artifactId>
58+
<version>[{{graalVersion}},)</version>
59+
<scope>runtime</scope>
60+
</dependency>
61+
<dependency>
62+
<groupId>org.graalvm.tools</groupId>
63+
<artifactId>chromeinspector</artifactId>
64+
<version>[{{graalVersion}},)</version>
65+
<scope>runtime</scope>
66+
</dependency>
67+
</dependencies>
68+
<build>
69+
<plugins>
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-dependency-plugin</artifactId>
73+
<executions>
74+
<execution>
75+
<id>copy-graalvm-compiler</id>
76+
<phase>initialize</phase>
77+
<goals>
78+
<goal>copy</goal>
79+
</goals>
80+
<configuration>
81+
<artifactItems>
82+
<artifactItem>
83+
<groupId>org.graalvm.compiler</groupId>
84+
<artifactId>compiler</artifactId>
85+
<version>{{graalVersion}}</version>
86+
<type>jar</type>
87+
<destFileName>compiler.jar</destFileName>
88+
</artifactItem>
89+
<artifactItem>
90+
<groupId>org.graalvm.truffle</groupId>
91+
<artifactId>truffle-api</artifactId>
92+
<version>{{graalVersion}}</version>
93+
<type>jar</type>
94+
<destFileName>truffle-api.jar</destFileName>
95+
</artifactItem>
96+
<artifactItem>
97+
<groupId>org.graalvm.sdk</groupId>
98+
<artifactId>graal-sdk</artifactId>
99+
<version>{{graalVersion}}</version>
100+
<type>jar</type>
101+
<destFileName>graal-sdk.jar</destFileName>
102+
</artifactItem>
103+
</artifactItems>
104+
<outputDirectory>target/compiler</outputDirectory>
105+
</configuration>
106+
</execution>
107+
</executions>
108+
</plugin>
109+
</plugins>
110+
</build>
111+
</profile>
112+
</profiles>
113+
29114
<dependencies>
30115
{{#dependencies}}
31116
<dependency>
@@ -117,6 +202,7 @@
117202
<exclude>META-INF/*.SF</exclude>
118203
<exclude>META-INF/*.DSA</exclude>
119204
<exclude>META-INF/*.RSA</exclude>
205+
<exclude>**/module-info.class</exclude>
120206
</excludes>
121207
</filter>
122208
</filters>
@@ -133,7 +219,7 @@
133219
</transformers>
134220
<artifactSet>
135221
</artifactSet>
136-
<outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
222+
<outputFile>${project.build.directory}/${project.artifactId}-${project.version}-${shade.classifier}.jar</outputFile>
137223
</configuration>
138224
</execution>
139225
</executions>

0 commit comments

Comments
 (0)