From 7a2d6b85e0f888c2da436c7e3dd320e9d6c893c7 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 18 Dec 2017 21:29:40 -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. --- .../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 c1669c0a72ae2..cb0703e8036b4 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