diff --git a/benchmarks/build.gradle b/benchmarks/build.gradle index 0838af7287126..992462b6fc0a2 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 ad92a379b6606..a0c00db10dca2 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 1e3446f3ccd39..6ed98217d34fe 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 27f122b8610ee..9b2b1ca215673 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 c67120c7cf59b..a53f102034009 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 cc84207d90d22..b5a5fb5dc5ed1 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 b515c606cc3ff..a2915b13b9acb 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 47db55b3b33ca..2b9f3c6433d8f 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 4a007422f3819..ef03d968209e4 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 517c93cc17862..5b3dcd7c8508a 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 24b6618b7d8f6..ae77c8f893543 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 } } }