Skip to content

Commit

Permalink
[Truffle] Make the truffle module Java 8+.
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed May 9, 2016
1 parent 0905a7c commit 0cbdaf0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 17 deletions.
31 changes: 22 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ env:
- PHASE='-Prake -Dtask=spec:jruby'
- PHASE='-Prake -Dtask=spec:jrubyc'
- PHASE='-Prake -Dtask=spec:profiler'
- JT='test specs :command_line'
- JT='test specs :language'
- JT='test specs :core'
- JT='test specs :library'
- JT='test specs :truffle'
- JT='test integration fast'
- JT='test integration long' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true

matrix:
include:
Expand All @@ -78,11 +71,27 @@ matrix:
jdk: oraclejdk8
- env: COMMAND=test/check_versions.sh
jdk: oraclejdk8
# JRuby+Truffle needs Java 8
- env: JT='test specs :command_line'
jdk: oraclejdk8
- env: JT='test specs :language'
jdk: oraclejdk8
- env: JT='test specs :core'
jdk: oraclejdk8
- env: JT='test specs :library'
jdk: oraclejdk8
- env: JT='test specs :truffle'
jdk: oraclejdk8
- env: JT='test integration fast'
jdk: oraclejdk8
- env: JT='test integration long' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true
jdk: oraclejdk8
- env: JT=check_ambiguous_arguments SKIP_BUILD=true
jdk: oraclejdk8
allow_failures:
- env: PHASE='-Prake -Dtask=test:mri:fullint'
- env: JT='test mri'
jdk: oraclejdk8
- env: PHASE='-Pj2ee --projects !truffle'
jdk: oraclejdk7
- env: JT='test integration long' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true
Expand All @@ -103,8 +112,12 @@ branches:
- ruby-2.3

script: tool/travis_runner.sh
install:
- if [ -z "$SKIP_BUILD" ]; then travis_retry ./mvnw -Pbootstrap clean install -B -Dinvoker.skip -Dmaven.test.skip; fi
install: |
if [ -n "$PHASE" ]; then
travis_retry ./mvnw -Pbootstrap clean install -B --projects '!truffle' -Dinvoker.skip -Dmaven.test.skip;
else
if [ -z "$SKIP_BUILD" ]; then travis_retry ./mvnw package -B -Dinvoker.skip -Dmaven.test.skip; fi
fi
notifications:
irc:
Expand Down
8 changes: 8 additions & 0 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,14 @@ public JRubyTruffleInterface getTruffleContext() {
private JRubyTruffleInterface loadTruffle() {
Main.printTruffleTimeMetric("before-load-context");

String javaVersion = System.getProperty("java.version");
String[] parts = javaVersion.split("\\D+");
int firstPart = Integer.valueOf(parts[0]);
if (!(firstPart >= 9 || Integer.valueOf(parts[1]) >= 8)) {
System.err.println("JRuby+Truffle needs Java 8 to run (found " + javaVersion + ").");
System.exit(1);
}

final Class<?> clazz;

try {
Expand Down
4 changes: 2 additions & 2 deletions tool/travis_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
set -e
set -x

if [ -z "$SKIP_BUILD" ]
if [[ -v PHASE ]]
then
./mvnw install -B -Dinvoker.skip=false $PHASE | egrep -v 'Download|\\[exec\\] [[:digit:]]+/[[:digit:]]+|^[[:space:]]*\\[exec\\][[:space:]]*$'
./mvnw install -B --projects '!truffle' -Dinvoker.skip=false $PHASE | egrep -v 'Download|\\[exec\\] [[:digit:]]+/[[:digit:]]+|^[[:space:]]*\\[exec\\][[:space:]]*$'

MVN_STATUS=${PIPESTATUS[0]}

Expand Down
4 changes: 2 additions & 2 deletions truffle/pom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
'verbose' => 'false',
'showWarnings' => 'true',
'showDeprecation' => 'true',
'source' => [ '${base.java.version}', '1.7' ],
'target' => [ '${base.javac.version}', '1.7' ],
'source' => '1.8',
'target' => '1.8',
'useIncrementalCompilation' => 'false' ) do
execute_goals( 'compile',
:id => 'default-compile',
Expand Down
6 changes: 2 additions & 4 deletions truffle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,8 @@ DO NOT MODIFIY - GENERATED CODE
<verbose>false</verbose>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<source>${base.java.version}</source>
<source>1.7</source>
<target>${base.javac.version}</target>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
Expand Down

0 comments on commit 0cbdaf0

Please sign in to comment.