Skip to content

Commit

Permalink
Merge branch 'release/0.5.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
pmlopes committed Nov 7, 2018
2 parents 585b1c1 + 6df0b8b commit a257665
Show file tree
Hide file tree
Showing 48 changed files with 1,221 additions and 936 deletions.
32 changes: 19 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,28 @@ matrix:
# jdk: oraclejdk9
# - env: JDK='OpenJDK 9'
# install: . ./install-jdk.sh -F 9
# 10
- env: JDK='Oracle JDK 10'
jdk: oraclejdk10
- env: JDK='OpenJDK 10'
install: . ./install-jdk.sh -F 10 -L GPL
# 11
- env: JDK='Oracle JDK 11'
install: . ./install-jdk.sh -F 11 -L BCL
# JDK 10 is EOL
# # 10
# - env: JDK='Oracle JDK 10'
# jdk: oraclejdk10
# - env: JDK='OpenJDK 10'
# install: . ./install-jdk.sh -F 10 -L GPL
# # 11 (Oracle and OpenJDK are pretty similar)
# - env: JDK='Oracle JDK 11'
# install: . ./install-jdk.sh -F 11 -L BCL
- env: JDK='OpenJDK 11'
install: . ./install-jdk.sh -F 11 -L GPL
# GraalVM
- env: JDK='GraalVM 1.0.0'
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
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
# OpenJ9
- env: JDK='OpenJ9 13'
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
allow_failures:
# Non LTS releases are OK to fail
- env: JDK='Oracle JDK 10'
- env: JDK='OpenJDK 10'
# # Non LTS releases are OK to fail
# - env: JDK='OpenJDK 9'
# - env: JDK='OpenJDK 10'
- env: JDK='OpenJ9 13'

script:
- echo PATH = ${PATH}
Expand All @@ -50,7 +55,8 @@ script:
- mvn --settings settings.xml test -B

after_success:
- bash <(curl -s https://codecov.io/bash)
- '[[ "${JDK}" = "GraalVM 1.0.0" ]] &&
bash <(curl -s https://codecov.io/bash) || true'
- '[[ "${TRAVIS_BRANCH}" = "develop" ]] &&
[[ "${TRAVIS_PULL_REQUEST}" = "false" ]] &&
[[ "${JDK}" = "OpenJDK 11" ]] &&
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.


## [Unreleased]
- Added a package command to package either fat jar or a JVMCI fat jar.
- Fix issue preventing GraalJS running on OpenJ9
- Allow specifying absolute path as start module
- implemented module aliases
- fixed node inspector paths for debugging
- fixed runtime definitions
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ suite.run();

Profit!

# Documentation
## JDK11

If you don't want to run on GraalVM JDK but prefer [OpenJDK11](https://adoptopenjdk.net/index.html?variant=openjdk11&jvmVariant=hotspot),
or even [OpenJ9](https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=openj9) all you need to do is **prefix**
any `NPM` / `Maven` command with the variable `JVMCI=1`, e.g.:

```bash
JVMCI=1 npm install
JVMCI=1 npm start
```

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
environment, you can add it to your `package.json` as:

```json
{
"jvmci": true
}
```

## Documentation

For more documentation please see [docs](./docs).
37 changes: 33 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ add the package [es4x-cli](https://www.npmjs.com/package/es4x-cli) to your
"postinstall": "es4x postinstall",
"test": "es4x launcher test",
"start": "es4x launcher run",
"shell": "es4x shell"
"shell": "es4x shell",
"package": "es4x package"
},
"license": "ISC",
"private": true,
Expand All @@ -80,8 +81,8 @@ As of this moment you can follow the normal workflow. For example in order to cr
```json
{
"dependencies": {
"@vertx/core": "3.5.3",
"@vertx/web": "3.5.3"
"@vertx/core": "3.5.4",
"@vertx/web": "3.5.4"
}
}
```
Expand Down Expand Up @@ -163,7 +164,7 @@ It is common to package JVM applications as runnable `JAR` files, the `es4x-cli`
`maven-shade-plugin` configured for this:

```sh
mvn clean package
npm run package
```

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

When running this script you will see also the output command you need to use to run your application e.g.:

```bash
# Running on a GraalVM JVM
Running: /home/plopes/Projects/reactiverse/es4x/examples/empty-project/mvnw ... package
Run your application with:

java \
-jar target/empty-project-1.0.0-bin.jar
```

Note that if you run with the environment flag `JVMCI` then you can run your app on JDK11 too but the start command
will be a little more complex, this is what the script tells you e.g.:

```bash
Running: /home/plopes/Projects/reactiverse/es4x/examples/empty-project/mvnw ... package
Run your application with:

java \
--module-path=target/compiler \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
--upgrade-module-path=target/compiler/compiler.jar \
-jar target/empty-project-1.0.0-bin-jvmci.jar
```

In this case you need not just the binary jar, but also the directory `target/compiler`. With this you can run using
the GraalJS engine on any JDK11.

### Shell/ REPL

Expand Down
4 changes: 2 additions & 2 deletions docs/graal/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GraalVM Support

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

There are benefits on using GraalJS namely the updated language support >=ES6 and support out of the box for generators,
promises, etc....
Expand Down
88 changes: 87 additions & 1 deletion es4x-cli/.pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,93 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.testSource>1.8</maven.compiler.testSource>
<maven.compiler.testTarget>1.8</maven.compiler.testTarget>
<shade.classifier>bin</shade.classifier>
</properties>

<profiles>
<profile>
<id>jvmci</id>
<activation>
<property>
<name>env.JVMCI</name>
</property>
</activation>
<properties>
<shade.classifier>bin-jvmci</shade.classifier>
</properties>
<dependencies>
<!-- GraalVM runtime -->
<dependency>
<groupId>org.graalvm.truffle</groupId>
<artifactId>truffle-api</artifactId>
<version>[{{graalVersion}},)</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<version>[{{graalVersion}},)</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.graalvm.tools</groupId>
<artifactId>profiler</artifactId>
<version>[{{graalVersion}},)</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.graalvm.tools</groupId>
<artifactId>chromeinspector</artifactId>
<version>[{{graalVersion}},)</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-graalvm-compiler</id>
<phase>initialize</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.graalvm.compiler</groupId>
<artifactId>compiler</artifactId>
<version>{{graalVersion}}</version>
<type>jar</type>
<destFileName>compiler.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.graalvm.truffle</groupId>
<artifactId>truffle-api</artifactId>
<version>{{graalVersion}}</version>
<type>jar</type>
<destFileName>truffle-api.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>{{graalVersion}}</version>
<type>jar</type>
<destFileName>graal-sdk.jar</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>target/compiler</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>
{{#dependencies}}
<dependency>
Expand Down Expand Up @@ -117,6 +202,7 @@
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
Expand All @@ -133,7 +219,7 @@
</transformers>
<artifactSet>
</artifactSet>
<outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
<outputFile>${project.build.directory}/${project.artifactId}-${project.version}-${shade.classifier}.jar</outputFile>
</configuration>
</execution>
</executions>
Expand Down
Loading

0 comments on commit a257665

Please sign in to comment.