From 2ede8662e183f11a29c0943fca3e43c7145d49dc Mon Sep 17 00:00:00 2001 From: Dan Hermann Date: Tue, 31 Mar 2020 06:48:46 -0500 Subject: [PATCH] Bump multi-release JARs to Java 11 --- libs/core/build.gradle | 28 +++++++++---------- .../core/internal/io/Streams.java | 0 server/build.gradle | 28 +++++++++---------- .../org/elasticsearch/monitor/jvm/JvmPid.java | 0 4 files changed, 28 insertions(+), 28 deletions(-) rename libs/core/src/main/{java9 => java11}/org/elasticsearch/core/internal/io/Streams.java (100%) rename server/src/main/{java9 => java11}/org/elasticsearch/monitor/jvm/JvmPid.java (100%) diff --git a/libs/core/build.gradle b/libs/core/build.gradle index 5515acf6fa3..cef1aed9881 100644 --- a/libs/core/build.gradle +++ b/libs/core/build.gradle @@ -25,40 +25,40 @@ apply plugin: 'nebula.maven-scm' archivesBaseName = 'elasticsearch-core' -// we want to keep the JDKs in our IDEs set to JDK 8 until minimum JDK is bumped to 9 so we do not include this source set in our IDEs +// we want to keep the JDKs in our IDEs set to JDK 8 until minimum JDK is bumped to 11 so we do not include this source set in our IDEs if (!isEclipse) { sourceSets { - java9 { + java11 { java { - srcDirs = ['src/main/java9'] + srcDirs = ['src/main/java11'] } } } configurations { - java9Compile.extendsFrom(compile) + java11Compile.extendsFrom(compile) } dependencies { - java9Compile sourceSets.main.output + java11Compile sourceSets.main.output } - compileJava9Java { - sourceCompatibility = 9 - targetCompatibility = 9 + compileJava11Java { + sourceCompatibility = 11 + targetCompatibility = 11 } - forbiddenApisJava9 { - if (BuildParams.runtimeJavaVersion < JavaVersion.VERSION_1_9) { - targetCompatibility = JavaVersion.VERSION_1_9.getMajorVersion() + forbiddenApisJava11 { + if (BuildParams.runtimeJavaVersion < JavaVersion.VERSION_11) { + targetCompatibility = JavaVersion.VERSION_11.getMajorVersion() } replaceSignatureFiles 'jdk-signatures' } jar { metaInf { - into 'versions/9' - from sourceSets.java9.output + into 'versions/11' + from sourceSets.java11.output } manifest.attributes('Multi-Release': 'true') } @@ -81,7 +81,7 @@ dependencies { testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" if (!isEclipse) { - java9Compile sourceSets.main.output + java11Compile sourceSets.main.output } testCompile(project(":test:framework")) { diff --git a/libs/core/src/main/java9/org/elasticsearch/core/internal/io/Streams.java b/libs/core/src/main/java11/org/elasticsearch/core/internal/io/Streams.java similarity index 100% rename from libs/core/src/main/java9/org/elasticsearch/core/internal/io/Streams.java rename to libs/core/src/main/java11/org/elasticsearch/core/internal/io/Streams.java diff --git a/server/build.gradle b/server/build.gradle index 6191005ec58..810e75bb032 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -34,41 +34,41 @@ publishing { archivesBaseName = 'elasticsearch' -// we want to keep the JDKs in our IDEs set to JDK 8 until minimum JDK is bumped to 9 so we do not include this source set in our IDEs +// we want to keep the JDKs in our IDEs set to JDK 8 until minimum JDK is bumped to 11 so we do not include this source set in our IDEs if (!isEclipse) { sourceSets { - java9 { + java11 { java { - srcDirs = ['src/main/java9'] + srcDirs = ['src/main/java11'] } } } configurations { - java9Compile.extendsFrom(compile) + java11Compile.extendsFrom(compile) } dependencies { - java9Compile sourceSets.main.output + java11Compile sourceSets.main.output } - compileJava9Java { - sourceCompatibility = 9 - targetCompatibility = 9 + compileJava11Java { + sourceCompatibility = 11 + targetCompatibility = 11 } - forbiddenApisJava9 { + forbiddenApisJava11 { doFirst { - if (BuildParams.runtimeJavaVersion < JavaVersion.VERSION_1_9) { - targetCompatibility = JavaVersion.VERSION_1_9.getMajorVersion() + if (BuildParams.runtimeJavaVersion < JavaVersion.VERSION_11) { + targetCompatibility = JavaVersion.VERSION_11.getMajorVersion() } } } jar { metaInf { - into 'versions/9' - from sourceSets.java9.output + into 'versions/11' + from sourceSets.java11.output } manifest.attributes('Multi-Release': 'true') } @@ -124,7 +124,7 @@ dependencies { compile "org.elasticsearch:jna:${versions.jna}" if (!isEclipse) { - java9Compile sourceSets.main.output + java11Compile sourceSets.main.output } testCompile(project(":test:framework")) { diff --git a/server/src/main/java9/org/elasticsearch/monitor/jvm/JvmPid.java b/server/src/main/java11/org/elasticsearch/monitor/jvm/JvmPid.java similarity index 100% rename from server/src/main/java9/org/elasticsearch/monitor/jvm/JvmPid.java rename to server/src/main/java11/org/elasticsearch/monitor/jvm/JvmPid.java