diff --git a/benchmarks/build.gradle b/benchmarks/build.gradle index 0838af72871..992462b6fc0 100644 --- a/benchmarks/build.gradle +++ b/benchmarks/build.gradle @@ -21,10 +21,7 @@ apply plugin: 'elasticsearch.build' apply plugin: 'application' mainClassName = 'org.openjdk.jmh.Main' -// Not published so no need to assemble -tasks.remove(assemble) -build.dependsOn.remove('assemble') - +assemble.enabled = false archivesBaseName = 'elasticsearch-benchmarks' test.enabled = false diff --git a/build.gradle b/build.gradle index ad92a379b66..a0c00db10dc 100644 --- a/build.gradle +++ b/build.gradle @@ -579,13 +579,11 @@ gradle.projectsEvaluated { if (project.path.startsWith(':qa')) { Task assemble = project.tasks.findByName('assemble') if (assemble) { - project.tasks.remove(assemble) - project.build.dependsOn.remove('assemble') + assemble.enabled = false } Task dependenciesInfo = project.tasks.findByName('dependenciesInfo') if (dependenciesInfo) { - project.tasks.remove(dependenciesInfo) - project.precommit.dependsOn.remove('dependenciesInfo') + dependenciesInfo.enabled = false } } } diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 1e3446f3ccd..6ed98217d34 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -547,7 +547,7 @@ class BuildPlugin implements Plugin { } // build poms with assemble (if the assemble task exists) Task assemble = project.tasks.findByName('assemble') - if (assemble) { + if (assemble && assemble.enabled) { assemble.dependsOn(generatePOMTask) } } diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy index 27f122b8610..9b2b1ca2156 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy @@ -35,8 +35,7 @@ public class DocsTestPlugin extends RestTestPlugin { // The distribution can be configured with -Dtests.distribution on the command line project.integTestCluster.distribution = System.getProperty('tests.distribution', 'zip') // Docs are published separately so no need to assemble - project.tasks.remove(project.assemble) - project.build.dependsOn.remove('assemble') + project.tasks.assemble.enabled = false Map defaultSubstitutions = [ /* These match up with the asciidoc syntax for substitutions but * the values may differ. In particular {version} needs to resolve diff --git a/client/benchmark/build.gradle b/client/benchmark/build.gradle index c67120c7cf5..a53f1020340 100644 --- a/client/benchmark/build.gradle +++ b/client/benchmark/build.gradle @@ -23,8 +23,7 @@ apply plugin: 'application' group = 'org.elasticsearch.client' // Not published so no need to assemble -tasks.remove(assemble) -build.dependsOn.remove('assemble') +assemble.enabled = true archivesBaseName = 'client-benchmarks' mainClassName = 'org.elasticsearch.client.benchmark.BenchmarkMain' diff --git a/client/client-benchmark-noop-api-plugin/build.gradle b/client/client-benchmark-noop-api-plugin/build.gradle index cc84207d90d..b5a5fb5dc5e 100644 --- a/client/client-benchmark-noop-api-plugin/build.gradle +++ b/client/client-benchmark-noop-api-plugin/build.gradle @@ -28,8 +28,7 @@ esplugin { } // Not published so no need to assemble -tasks.remove(assemble) -build.dependsOn.remove('assemble') +assemble.enabled = false dependencyLicenses.enabled = false dependenciesInfo.enabled = false diff --git a/distribution/bwc/build.gradle b/distribution/bwc/build.gradle index b515c606cc3..a2915b13b9a 100644 --- a/distribution/bwc/build.gradle +++ b/distribution/bwc/build.gradle @@ -50,8 +50,7 @@ subprojects { apply plugin: 'distribution' // Not published so no need to assemble - tasks.remove(assemble) - build.dependsOn.remove('assemble') + assemble.enabled = false File checkoutDir = file("${buildDir}/bwc/checkout-${bwcBranch}") diff --git a/plugins/examples/build.gradle b/plugins/examples/build.gradle index 47db55b3b33..2b9f3c6433d 100644 --- a/plugins/examples/build.gradle +++ b/plugins/examples/build.gradle @@ -3,8 +3,7 @@ gradle.projectsEvaluated { subprojects { Task assemble = project.tasks.findByName('assemble') if (assemble) { - project.tasks.remove(assemble) - project.build.dependsOn.remove('assemble') + assemble.enabled = false } } } diff --git a/x-pack/plugin/ccr/qa/build.gradle b/x-pack/plugin/ccr/qa/build.gradle index 4a007422f38..ef03d968209 100644 --- a/x-pack/plugin/ccr/qa/build.gradle +++ b/x-pack/plugin/ccr/qa/build.gradle @@ -5,8 +5,7 @@ gradle.projectsEvaluated { subprojects { Task assemble = project.tasks.findByName('assemble') if (assemble) { - project.tasks.remove(assemble) - project.build.dependsOn.remove('assemble') + assemble.enabled = false } } } diff --git a/x-pack/plugin/ml/qa/build.gradle b/x-pack/plugin/ml/qa/build.gradle index 517c93cc178..5b3dcd7c850 100644 --- a/x-pack/plugin/ml/qa/build.gradle +++ b/x-pack/plugin/ml/qa/build.gradle @@ -20,12 +20,11 @@ gradle.projectsEvaluated { subprojects { Task assemble = project.tasks.findByName('assemble') if (assemble) { - project.tasks.remove(assemble) - project.build.dependsOn.remove('assemble') + assemble.enabled = false } Task dependenciesInfo = project.tasks.findByName('dependenciesInfo') if (dependenciesInfo) { - project.precommit.dependsOn.remove('dependenciesInfo') + dependenciesInfo.enabled = false } } } diff --git a/x-pack/qa/build.gradle b/x-pack/qa/build.gradle index 24b6618b7d8..ae77c8f8935 100644 --- a/x-pack/qa/build.gradle +++ b/x-pack/qa/build.gradle @@ -25,12 +25,11 @@ gradle.projectsEvaluated { subprojects { Task assemble = project.tasks.findByName('assemble') if (assemble) { - project.tasks.remove(assemble) - project.build.dependsOn.remove('assemble') + assemble.enabled = false } Task dependenciesInfo = project.tasks.findByName('dependenciesInfo') if (dependenciesInfo) { - project.precommit.dependsOn.remove('dependenciesInfo') + dependenciesInfo.enabled = false } } }