Skip to content

Commit

Permalink
Disable assemble task instead of removing it (#33348)
Browse files Browse the repository at this point in the history
  • Loading branch information
alpar-t authored Sep 4, 2018
1 parent 78df00f commit 7f7e8fd
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 27 deletions.
5 changes: 1 addition & 4 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ class BuildPlugin implements Plugin<Project> {
}
// build poms with assemble (if the assemble task exists)
Task assemble = project.tasks.findByName('assemble')
if (assemble) {
if (assemble && assemble.enabled) {
assemble.dependsOn(generatePOMTask)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> defaultSubstitutions = [
/* These match up with the asciidoc syntax for substitutions but
* the values may differ. In particular {version} needs to resolve
Expand Down
3 changes: 1 addition & 2 deletions client/benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 1 addition & 2 deletions client/client-benchmark-noop-api-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions distribution/bwc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down
3 changes: 1 addition & 2 deletions plugins/examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
3 changes: 1 addition & 2 deletions x-pack/plugin/ccr/qa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
5 changes: 2 additions & 3 deletions x-pack/plugin/ml/qa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
5 changes: 2 additions & 3 deletions x-pack/qa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

0 comments on commit 7f7e8fd

Please sign in to comment.