Build: Fix subdirectories in meta plugins to be copied correctly (#28282)
This commit fixes the copying of files from bundled plugin zips. Previously all files within each zip would be flattened under the bundled plugin name, and the original directories would exist at the top level of the plugin.
This commit is contained in:
parent
c15ae7eb20
commit
ac1c509844
|
@ -40,8 +40,7 @@ class MetaPluginBuildPlugin implements Plugin<Project> {
|
||||||
project.integTestCluster {
|
project.integTestCluster {
|
||||||
dependsOn(project.bundlePlugin)
|
dependsOn(project.bundlePlugin)
|
||||||
distribution = 'zip'
|
distribution = 'zip'
|
||||||
setupCommand 'installMetaPlugin',
|
setupCommand('installMetaPlugin', 'bin/elasticsearch-plugin', 'install', 'file:' + project.bundlePlugin.archivePath)
|
||||||
'bin/elasticsearch-plugin', 'install', 'file:' + project.bundlePlugin.archivePath
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +56,9 @@ class MetaPluginBuildPlugin implements Plugin<Project> {
|
||||||
include(buildProperties.descriptorOutput.name)
|
include(buildProperties.descriptorOutput.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// due to how the renames work for each bundled plugin, we must exclude empty dirs or every subdir
|
||||||
|
// within bundled plugin zips will show up at the root as an empty dir
|
||||||
|
includeEmptyDirs = false
|
||||||
|
|
||||||
}
|
}
|
||||||
project.assemble.dependsOn(bundle)
|
project.assemble.dependsOn(bundle)
|
||||||
|
@ -71,7 +73,10 @@ class MetaPluginBuildPlugin implements Plugin<Project> {
|
||||||
dependsOn bundledPluginProject.bundlePlugin
|
dependsOn bundledPluginProject.bundlePlugin
|
||||||
from(project.zipTree(bundledPluginProject.bundlePlugin.outputs.files.singleFile)) {
|
from(project.zipTree(bundledPluginProject.bundlePlugin.outputs.files.singleFile)) {
|
||||||
eachFile { FileCopyDetails details ->
|
eachFile { FileCopyDetails details ->
|
||||||
details.relativePath = new RelativePath(true, 'elasticsearch', bundledPluginProjectName, details.name)
|
// paths in the individual plugins begin with elasticsearch, and we want to add in the
|
||||||
|
// bundled plugin name between that and each filename
|
||||||
|
details.relativePath = new RelativePath(true, 'elasticsearch', bundledPluginProjectName,
|
||||||
|
details.relativePath.toString().replace('elasticsearch/', ''))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue