Skip to content

Commit

Permalink
Build with JDK-9 only (#1097)
Browse files Browse the repository at this point in the history
* Use --release 8 option from JDK 9 javac

* Remove matrix and special java options from Travis CI
  The JUnit 5 build requires JDK-9 or higher.
  The JUnit 5 runtime environment needs to be Java 8 or higher.
  Travis CI now sets "-Xmx" by default.

* Switch Javadoc step to use JDK 9

* Switch AsciiDoc step to use JDK 9 w/o PDF backend
  See jruby/jruby#4805

* Fix Clover instrumentation

* Add custom AppVeyor script to install JDK-9

* Add JDK9-compatible Javadoc stylesheet

* Fix Javadoc @value tag usages
  • Loading branch information
sormuras authored Oct 9, 2017
1 parent 3650342 commit bc7eef0
Show file tree
Hide file tree
Showing 9 changed files with 282 additions and 70 deletions.
10 changes: 10 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build: off

install:
- cinst jdk9 -params 'installdir=C:\\jdk9'
- SET JAVA_HOME=C:\jdk9
- SET PATH=C:\jdk9\bin;%PATH%

test_script:
- gradlew -version
- gradlew build --stacktrace
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
language: java
jdk: oraclejdk9

sudo: false
dist: trusty

Expand All @@ -7,14 +9,6 @@ branches:
except:
- /^r\d.*$/

env:
- _JAVA_OPTIONS='-Xmx500m'

matrix:
include:
- jdk: oraclejdk8 # JDK 1.8.0_131-b11 or newer
- jdk: oraclejdk9 # JDK 9+175 or newer

# Don't let Travis CI execute './gradlew assemble' by default
install:
# Display Gradle, Groovy, JVM and other versions
Expand Down
6 changes: 0 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ pipeline {
}
}
stage('Aggregate Javadoc') {
tools {
jdk 'Oracle JDK 8 (latest)' // Use JDK 8 because of custom stylesheet
}
steps {
sh './gradlew --no-daemon aggregateJavadocs'
}
Expand All @@ -46,9 +43,6 @@ pipeline {
}
}
stage('Generate User Guide') {
tools {
jdk 'Oracle JDK 8 (latest)' // Use JDK 8 because AsciiDoctor has problems on JDK 9
}
steps {
sh './gradlew --no-daemon asciidoctor'
}
Expand Down
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ allprojects { subproj ->
}

tasks.withType(JavaCompile) {
sourceCompatibility = rootProject.sourceCompatibility
targetCompatibility = rootProject.targetCompatibility
sourceCompatibility = rootProject.javacRelease // needed by clover
targetCompatibility = rootProject.javacRelease // needed by clover/asm
options.encoding = 'UTF-8'
}

// See: http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html#BHCJCABJ
// See: https://docs.oracle.com/javase/9/tools/javac.htm#JSWOR627
compileJava.options*.compilerArgs = [
'--release', rootProject.javacRelease,
'-Xlint:cast',
'-Xlint:classfile',
'-Xlint:deprecation',
Expand All @@ -154,8 +155,9 @@ allprojects { subproj ->
'-Werror'
]

// See: http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html#BHCJCABJ
// See: https://docs.oracle.com/javase/9/tools/javac.htm#JSWOR627
compileTestJava.options*.compilerArgs = [
'--release', rootProject.javacRelease,
'-Xlint:cast',
'-Xlint:classfile',
'-Xlint:deprecation',
Expand Down Expand Up @@ -218,6 +220,7 @@ allprojects { subproj ->
initstring: cloverInitstring,
recordTestResults: false,
destdir: instrumentedJavaSourcesDir,
encoding: 'UTF-8',
source: compileJava.sourceCompatibility) {
sourceSets.main.allJava.addToAntBuilder(ant, 'fileset', FileCollection.AntType.FileSet)
}
Expand Down
2 changes: 1 addition & 1 deletion documentation/documentation.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ asciidoctor {
separateOutputDirs false
sources { include 'index.adoc' }

backends 'html5', 'pdf' // , 'epub3'
backends 'html5' // , 'pdf' // , 'epub3'

attributes 'jupiter-version': project.property('version'),
'platform-version': project.property('platformVersion'),
Expand Down
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ platformVersion = 1.1.0-SNAPSHOT
vintageGroup = org.junit.vintage
vintageVersion = 4.12.2-SNAPSHOT

sourceCompatibility = 1.8
targetCompatibility = 1.8
# --release release
# Compiles against the public, supported and documented API for a specific VM version.
# Supported release targets are 6, 7, 8, and 9.
# Note that if --release is added then -target and -source are ignored.
javacRelease = 8

apiGuardianVersion = 1.0.0
assertJVersion = 3.8.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
String TOTAL_REPETITIONS_PLACEHOLDER = "{totalRepetitions}";

/**
* <em>Short</em> display name pattern for a repeated test: {@value #SHORT_DISPLAY_NAME}
* <em>Short</em> display name pattern for a repeated test: {@value}
*
* @see #CURRENT_REPETITION_PLACEHOLDER
* @see #TOTAL_REPETITIONS_PLACEHOLDER
Expand All @@ -85,7 +85,7 @@
String SHORT_DISPLAY_NAME = "repetition " + CURRENT_REPETITION_PLACEHOLDER + " of " + TOTAL_REPETITIONS_PLACEHOLDER;

/**
* <em>Long</em> display name pattern for a repeated test: {@value #LONG_DISPLAY_NAME}
* <em>Long</em> display name pattern for a repeated test: {@value}
*
* @see #DISPLAY_NAME_PLACEHOLDER
* @see #SHORT_DISPLAY_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ public interface ClassNameFilter extends DiscoveryFilter<String> {
/**
* Standard include pattern in the form of a regular expression that is
* used to match against fully qualified class names:
* {@value #STANDARD_INCLUDE_PATTERN} which matches against class names
* ending in {@code Test} or {@code Tests} (in any package).
* {@value org.junit.platform.engine.discovery.ClassNameFilter#STANDARD_INCLUDE_PATTERN}
* which matches against class names ending in {@code Test} or
* {@code Tests} (in any package).
*/
String STANDARD_INCLUDE_PATTERN = "^.*Tests?$";

Expand Down
Loading

0 comments on commit bc7eef0

Please sign in to comment.