Skip to content

Commit 8bd7a19

Browse files
authored
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
1 parent c8371fa commit 8bd7a19

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,11 @@ class BuildPlugin implements Plugin<Project> {
408408

409409
/** Adds compiler settings to the project */
410410
static void configureCompile(Project project) {
411-
project.ext.compactProfile = 'compact3'
411+
if (project.javaVersion < JavaVersion.VERSION_1_10) {
412+
project.ext.compactProfile = 'compact3'
413+
} else {
414+
project.ext.compactProfile = 'full'
415+
}
412416
project.afterEvaluate {
413417
project.tasks.withType(JavaCompile) {
414418
File gradleJavaHome = Jvm.current().javaHome

0 commit comments

Comments
 (0)