Skip to content

Commit

Permalink
[Java] Upgrade to Build Scan 3.0, Shadow 5.2.0, ByteBuddy 1.10.2, and…
Browse files Browse the repository at this point in the history
… support Java building versions greater than 8.
  • Loading branch information
mjpt777 committed Nov 10, 2019
1 parent 8a21708 commit b8393cd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
40 changes: 28 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ buildscript {

plugins {
id 'java'
id 'com.gradle.build-scan' version '2.4.2'
id 'idea'
id 'com.gradle.build-scan' version '3.0'
id 'io.freefair.javadoc-links' version '4.1.3' apply false
id 'com.github.johnrengelman.shadow' version '5.1.0' apply false
id 'com.github.johnrengelman.shadow' version '5.2.0' apply false
id 'biz.aQute.bnd.builder' version '4.2.0' apply false
}

Expand All @@ -39,11 +40,10 @@ if (env.CI || env.TRAVIS) {

def aeronGroup = 'io.aeron'
def aeronVersion = file('version.txt').text.trim()
def aeronJavaVersion = JavaVersion.VERSION_1_8

def agronaVersion = '1.0.11'
def sbeVersion = '1.14.1'
def byteBuddyVersion = '1.9.10'
def byteBuddyVersion = '1.10.2'
def hdrHistogramVersion = '2.1.11'
def mockitoVersion = '3.1.0'

Expand Down Expand Up @@ -151,15 +151,23 @@ subprojects {
checkstyle.toolVersion = '8.25'

compileJava {
sourceCompatibility = aeronJavaVersion
targetCompatibility = aeronJavaVersion
if (JavaVersion.current().ordinal() >= JavaVersion.VERSION_1_9.ordinal()) {
options.compilerArgs.addAll(['--add-exports', 'java.base/java.lang.reflect=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'java.base/java.net=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'java.base/sun.nio.ch=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'jdk.unsupported/sun.misc=ALL-UNNAMED'])
}
options.encoding = 'UTF-8'
options.deprecation = true
}

compileTestJava {
sourceCompatibility = aeronJavaVersion
targetCompatibility = aeronJavaVersion
if (JavaVersion.current().ordinal() >= JavaVersion.VERSION_1_9.ordinal()) {
options.compilerArgs.addAll(['--add-exports', 'java.base/java.lang.reflect=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'java.base/java.net=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'java.base/sun.nio.ch=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'jdk.unsupported/sun.misc=ALL-UNNAMED'])
}
options.encoding = 'UTF-8'
options.deprecation = true
}
Expand Down Expand Up @@ -362,8 +370,12 @@ project(':aeron-archive') {

compileGeneratedJava {
dependsOn 'generateCodecs'
sourceCompatibility = aeronJavaVersion
targetCompatibility = aeronJavaVersion
if (JavaVersion.current().ordinal() >= JavaVersion.VERSION_1_9.ordinal()) {
options.compilerArgs.addAll(['--add-exports', 'java.base/java.lang.reflect=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'java.base/java.net=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'java.base/sun.nio.ch=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'jdk.unsupported/sun.misc=ALL-UNNAMED'])
}
options.encoding = 'UTF-8'
options.deprecation = true
classpath += configurations.codecGeneration
Expand Down Expand Up @@ -474,8 +486,12 @@ project(':aeron-cluster') {

compileGeneratedJava {
dependsOn 'generateCodecs'
sourceCompatibility = aeronJavaVersion
targetCompatibility = aeronJavaVersion
if (JavaVersion.current().ordinal() >= JavaVersion.VERSION_1_9.ordinal()) {
options.compilerArgs.addAll(['--add-exports', 'java.base/java.lang.reflect=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'java.base/java.net=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'java.base/sun.nio.ch=ALL-UNNAMED'])
options.compilerArgs.addAll(['--add-exports', 'jdk.unsupported/sun.misc=ALL-UNNAMED'])
}
options.encoding = 'UTF-8'
options.deprecation = true
classpath += configurations.codecGeneration
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
org.gradle.daemon = true
org.gradle.caching = true
org.gradle.jvmargs=-XX:+UseParallelOldGC

0 comments on commit b8393cd

Please sign in to comment.