Skip to content

Commit

Permalink
Avoid eager task realization (elastic#103343)
Browse files Browse the repository at this point in the history
* Avoid eager task realization in esql qa projects
* Fix eager task realization in PomValidationPrecommitPlugin
* Make loadCsvSpecData task lazy created
* Fix test task reference
  • Loading branch information
breskeby authored and henningandersen committed Jan 25, 2024
1 parent 8e8729d commit 0a308c5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public TaskProvider<? extends Task> createTask(Project project) {
.register("validate" + publicationName + "Pom", PomValidationTask.class);
validatePom.configure(t -> t.dependsOn(validateTask));
validateTask.configure(task -> {
GenerateMavenPom generateMavenPom = project.getTasks()
TaskProvider<GenerateMavenPom> generateMavenPom = project.getTasks()
.withType(GenerateMavenPom.class)
.getByName("generatePomFileFor" + publicationName + "Publication");
.named("generatePomFileFor" + publicationName + "Publication");
task.dependsOn(generateMavenPom);
task.getPomFile().fileValue(generateMavenPom.getDestination());
task.getPomFile().fileProvider(generateMavenPom.map(GenerateMavenPom::getDestination));
});
});

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/esql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sourceSets.main.java {
exclude 'generated/**'
}

tasks.getByName('test') {
tasks.named("test").configure {
if (BuildParams.isCi() == false) {
systemProperty 'generateDocs', true
doFirst {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/esql/qa/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description = 'Integration tests for ESQL'

subprojects {
tasks.withType(Javadoc).all { enabled = false }
tasks.withType(Javadoc).configureEach { enabled = false }
}
2 changes: 1 addition & 1 deletion x-pack/plugin/esql/qa/testFixtures/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {
* If no arguments are specified, the default URL is http://localhost:9200 without authentication.
* It also supports HTTPS.
*/
task loadCsvSpecData(type: JavaExec) {
tasks.register("loadCsvSpecData", JavaExec) {
group = "Execution"
description = "Loads ESQL CSV Spec Tests data on a running stand-alone instance"
classpath = sourceSets.main.runtimeClasspath
Expand Down

0 comments on commit 0a308c5

Please sign in to comment.