Skip to content

Commit a080a98

Browse files
authored
[Build] Fix the manifest target and source information for jdbc projects (elastic#121888) (elastic#122239)
The nebula info broker plugin takes the information for the manifest from the java project settings rather then from the compile task configuration. Instead of setting the compiler task configuration explicitly we now set the project configuration accordingly. Also tweaked the javaTestCompile tasks to keep compiling with general minimum runtime version as we did before (cherry picked from commit 6e6e42f)
1 parent f108363 commit a080a98

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaBasePlugin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public class ElasticsearchJavaBasePlugin implements Plugin<Project> {
5858

5959
@Override
6060
public void apply(Project project) {
61-
project.getRootProject().getPlugins().apply(GlobalBuildInfoPlugin.class);
6261
// make sure the global build info plugin is applied to the root project
6362
project.getRootProject().getPluginManager().apply(GlobalBuildInfoPlugin.class);
6463
buildParams = project.getRootProject().getExtensions().getByType(BuildParameterExtension.class);

x-pack/plugin/sql/jdbc/build.gradle

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,20 @@ dependencies {
2020
testImplementation project(':modules:rest-root')
2121
}
2222

23-
tasks.named("compileJava").configure {
23+
java {
2424
targetCompatibility = JavaVersion.VERSION_1_8
2525
sourceCompatibility = JavaVersion.VERSION_1_8
2626
}
2727

28+
tasks.named("compileTestJava").configure {
29+
targetCompatibility = buildParams.getMinimumRuntimeVersion()
30+
sourceCompatibility = buildParams.getMinimumRuntimeVersion()
31+
}
32+
33+
tasks.named("test").configure {
34+
// reset the unit test classpath as using the shadow jar won't work due to relocated packages
35+
classpath = sourceSets.test.runtimeClasspath
36+
}
2837

2938
tasks.named("shadowJar").configure {
3039
relocate 'com.fasterxml', 'shadow.fasterxml'
@@ -34,7 +43,3 @@ tasks.named("shadowJar").configure {
3443
}
3544
}
3645

37-
tasks.named("test").configure {
38-
// reset the unit test classpath as using the shadow jar won't work due to relocated packages
39-
classpath = sourceSets.test.runtimeClasspath
40-
}

x-pack/plugin/sql/sql-client/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ dependencies {
1212
testImplementation(testArtifact(project(xpackModule('core'))))
1313
}
1414

15-
tasks.named("compileJava").configure {
15+
java {
1616
targetCompatibility = JavaVersion.VERSION_1_8
1717
sourceCompatibility = JavaVersion.VERSION_1_8
1818
}
1919

20+
tasks.named("compileTestJava").configure {
21+
targetCompatibility = buildParams.getMinimumRuntimeVersion()
22+
sourceCompatibility = buildParams.getMinimumRuntimeVersion()
23+
}
24+
2025
tasks.named('forbiddenApisMain').configure {
2126
// does not depend on core, so only jdk and http signatures should be checked
2227
replaceSignatureFiles 'jdk-signatures'

x-pack/plugin/sql/sql-proto/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ dependencies {
1616
}
1717
}
1818

19-
tasks.named("compileJava").configure {
19+
java {
2020
targetCompatibility = JavaVersion.VERSION_1_8
2121
sourceCompatibility = JavaVersion.VERSION_1_8
2222
}
2323

24+
tasks.named("compileTestJava").configure {
25+
targetCompatibility = buildParams.getMinimumRuntimeVersion()
26+
sourceCompatibility = buildParams.getMinimumRuntimeVersion()
27+
}
28+
2429
tasks.named('forbiddenApisMain').configure {
2530
//sql does not depend on server, so only jdk signatures should be checked
2631
replaceSignatureFiles 'jdk-signatures'

0 commit comments

Comments
 (0)