mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-20 11:54:52 +00:00
* Fixing the --release flag usage for javac (#2343) * Fixing the --release flag usage for javac Signed-off-by: Andriy Redko <andriy.redko@aiven.io> * Fixing the --html5 flag usage for javadoc Signed-off-by: Andriy Redko <andriy.redko@aiven.io> * Fix java-version-checker source/target compatibility settings (#2354) Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
This commit is contained in:
parent
0cc2c9be6a
commit
ae52008463
@ -173,7 +173,10 @@ public class OpenSearchJavaPlugin implements Plugin<Project> {
|
|||||||
// workaround for https://github.com/gradle/gradle/issues/14141
|
// workaround for https://github.com/gradle/gradle/issues/14141
|
||||||
compileTask.getConventionMapping().map("sourceCompatibility", () -> java.getSourceCompatibility().toString());
|
compileTask.getConventionMapping().map("sourceCompatibility", () -> java.getSourceCompatibility().toString());
|
||||||
compileTask.getConventionMapping().map("targetCompatibility", () -> java.getTargetCompatibility().toString());
|
compileTask.getConventionMapping().map("targetCompatibility", () -> java.getTargetCompatibility().toString());
|
||||||
|
// The '--release is available from JDK-9 and above
|
||||||
|
if (BuildParams.getRuntimeJavaVersion().compareTo(JavaVersion.VERSION_1_8) > 0) {
|
||||||
compileOptions.getRelease().set(releaseVersionProviderFromCompileTask(project, compileTask));
|
compileOptions.getRelease().set(releaseVersionProviderFromCompileTask(project, compileTask));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// also apply release flag to groovy, which is used in build-tools
|
// also apply release flag to groovy, which is used in build-tools
|
||||||
project.getTasks().withType(GroovyCompile.class).configureEach(compileTask -> {
|
project.getTasks().withType(GroovyCompile.class).configureEach(compileTask -> {
|
||||||
@ -267,7 +270,9 @@ public class OpenSearchJavaPlugin implements Plugin<Project> {
|
|||||||
* that the default will change to html5 in the future.
|
* that the default will change to html5 in the future.
|
||||||
*/
|
*/
|
||||||
CoreJavadocOptions javadocOptions = (CoreJavadocOptions) javadoc.getOptions();
|
CoreJavadocOptions javadocOptions = (CoreJavadocOptions) javadoc.getOptions();
|
||||||
|
if (BuildParams.getRuntimeJavaVersion().compareTo(JavaVersion.VERSION_1_8) > 0) {
|
||||||
javadocOptions.addBooleanOption("html5", true);
|
javadocOptions.addBooleanOption("html5", true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
TaskProvider<Javadoc> javadoc = project.getTasks().withType(Javadoc.class).named("javadoc");
|
TaskProvider<Javadoc> javadoc = project.getTasks().withType(Javadoc.class).named("javadoc");
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
|
|
||||||
apply plugin: 'opensearch.build'
|
apply plugin: 'opensearch.build'
|
||||||
|
|
||||||
targetCompatibility = JavaVersion.VERSION_1_7
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
// targetting very old java versions enables a warning by default on newer JDK: disable it.
|
// targetting very old java versions enables a warning by default on newer JDK: disable it.
|
||||||
compileJava.options.compilerArgs += '-Xlint:-options'
|
compileJava.options.compilerArgs += '-Xlint:-options'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user