Skip to content

Commit 4ba4b5a

Browse files
committed
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 2ca00ee commit 4ba4b5a

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
@@ -407,7 +407,11 @@ class BuildPlugin implements Plugin<Project> {
407407

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

0 commit comments

Comments
 (0)