Fix distribution build ordering issue
Today when running gradle clean :distribution:(integ-test-zip|tar|zip):assemble, the created archive distribution will be missing the empty plugins directory. This is because the empty plugins folder created in the build folder for the copy spec task is created during configuration and then is later wiped away by the clean task. This commit addresses this issue, by pushing creation of the directory out of the configuration phase. Relates #21271
This commit is contained in:
parent
c4c4a3a504
commit
799a12ad63
|
@ -196,6 +196,13 @@ subprojects {
|
||||||
* Zip and tgz configuration *
|
* Zip and tgz configuration *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
configure(subprojects.findAll { ['zip', 'tar', 'integ-test-zip'].contains(it.name) }) {
|
configure(subprojects.findAll { ['zip', 'tar', 'integ-test-zip'].contains(it.name) }) {
|
||||||
|
// CopySpec does not make it easy to create an empty director so we create the directory that we want, and then point CopySpec to its
|
||||||
|
// parent to copy to the root of the distribution
|
||||||
|
File plugins = new File(buildDir, 'plugins-hack/plugins')
|
||||||
|
task createPluginsDir(type: EmptyDirTask) {
|
||||||
|
dir "${plugins}"
|
||||||
|
dirMode 0755
|
||||||
|
}
|
||||||
project.ext.archivesFiles = copySpec {
|
project.ext.archivesFiles = copySpec {
|
||||||
into("elasticsearch-${version}") {
|
into("elasticsearch-${version}") {
|
||||||
with libFiles
|
with libFiles
|
||||||
|
@ -215,12 +222,6 @@ configure(subprojects.findAll { ['zip', 'tar', 'integ-test-zip'].contains(it.nam
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
into('') {
|
into('') {
|
||||||
// CopySpec does not make it easy to create an empty directory
|
|
||||||
// so we create the directory that we want, and then point
|
|
||||||
// CopySpec to its parent to copy to the root of the
|
|
||||||
// distribution
|
|
||||||
File plugins = new File(buildDir, 'plugins-hack/plugins')
|
|
||||||
plugins.mkdirs()
|
|
||||||
from {
|
from {
|
||||||
plugins.getParent()
|
plugins.getParent()
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
||||||
|
|
||||||
task buildZip(type: Zip) {
|
task buildZip(type: Zip) {
|
||||||
|
dependsOn createPluginsDir
|
||||||
baseName = 'elasticsearch'
|
baseName = 'elasticsearch'
|
||||||
with archivesFiles
|
with archivesFiles
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
task buildTar(type: Tar) {
|
task buildTar(type: Tar) {
|
||||||
|
dependsOn createPluginsDir
|
||||||
baseName = 'elasticsearch'
|
baseName = 'elasticsearch'
|
||||||
extension = 'tar.gz'
|
extension = 'tar.gz'
|
||||||
with archivesFiles
|
with archivesFiles
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
||||||
|
|
||||||
task buildZip(type: Zip) {
|
task buildZip(type: Zip) {
|
||||||
|
dependsOn createPluginsDir
|
||||||
baseName = 'elasticsearch'
|
baseName = 'elasticsearch'
|
||||||
with archivesFiles
|
with archivesFiles
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue