From 8bd7a19d6198aa5ca5f37d84c7d581c72068eb7f Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 20 Dec 2017 16:22:21 -0500 Subject: [PATCH] Use full profile on JDK 10 builds JDK 10 has gone fully-modular. This means that: - when targeting JDK 8 with a JDK 10 compiler, we have to use the full profile - when targeting JDK 10 with a JDK 10 compiler, we have to use -add-modules java.base Today we only target JDK 8 (our minimum compatibility version) so we need to change the compiler flags conditional on using a JDK 10 compiler. This commit does that. Relates #27884 --- .../main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 46b338c08ea..a29f204c580 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -408,7 +408,11 @@ class BuildPlugin implements Plugin { /** Adds compiler settings to the project */ static void configureCompile(Project project) { - project.ext.compactProfile = 'compact3' + if (project.javaVersion < JavaVersion.VERSION_1_10) { + project.ext.compactProfile = 'compact3' + } else { + project.ext.compactProfile = 'full' + } project.afterEvaluate { project.tasks.withType(JavaCompile) { File gradleJavaHome = Jvm.current().javaHome