Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with JDK-9 only #1097

Merged
merged 10 commits into from
Oct 9, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 0 additions & 3 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 Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,12 @@ allprojects { subproj ->
}

tasks.withType(JavaCompile) {
sourceCompatibility = rootProject.sourceCompatibility
targetCompatibility = rootProject.targetCompatibility
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep specifying source and target.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javac does not allow this:

Execution failed for task ':junit-platform-commons:compileJava'.
> option -source cannot be used together with --release

When added to compilerArgs via:

	// See: https://docs.oracle.com/javase/9/tools/javac.htm#JSWOR627
	compileJava.options*.compilerArgs = [
		'--release', rootProject.javacRelease,
		'-source', rootProject.javacRelease,
		'-target', rootProject.javacRelease,
...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But our build refers to compileJava.sourceCompatibility here and there. Like in cloverInstrumentJava around line 224: source: compileJava.sourceCompatibility) {.

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 +153,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
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