mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-05 20:48:22 +00:00
5a86450df7
In order to more easily integrate xpack once it moves into the elasticsearch repo, references to the existing x-pack-elasticsearch need to be reduced. This commit introduces a few helper "methods" available to any project within xpack (through gradle project extension properties, as closures). All refeerences to project paths now use these helper methods, except for those pertaining to bwc, which will be handled in a followup. Original commit: elastic/x-pack-elasticsearch@850668744c
52 lines
1.8 KiB
Groovy
52 lines
1.8 KiB
Groovy
import org.elasticsearch.gradle.plugin.MetaPluginBuildPlugin
|
|
import org.elasticsearch.gradle.plugin.MetaPluginPropertiesExtension
|
|
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
|
import org.elasticsearch.gradle.plugin.PluginPropertiesExtension
|
|
|
|
apply plugin: 'elasticsearch.vagrantsupport'
|
|
apply plugin: 'elasticsearch.vagrant'
|
|
|
|
esvagrant {
|
|
inheritTestUtils true
|
|
}
|
|
|
|
dependencies {
|
|
// Packaging tests use the x-pack meta plugin
|
|
bats project(path: xpackProject('plugin').path, configuration: 'zip')
|
|
|
|
// Inherit Bats test utils from :qa:vagrant project
|
|
bats project(path: ':qa:vagrant', configuration: 'bats')
|
|
}
|
|
|
|
Map<String, List<String>> metaPlugins = [:]
|
|
for (Project metaPlugin : project.rootProject.subprojects) {
|
|
if (metaPlugin.plugins.hasPlugin(MetaPluginBuildPlugin)) {
|
|
MetaPluginPropertiesExtension extension = metaPlugin.extensions.findByName('es_meta_plugin')
|
|
if (extension != null) {
|
|
List<String> plugins = []
|
|
metaPlugin.subprojects.each {
|
|
if (extension.plugins.contains(it.name)) {
|
|
Project plugin = (Project) it
|
|
if (plugin.plugins.hasPlugin(PluginBuildPlugin)) {
|
|
PluginPropertiesExtension esplugin = plugin.extensions.findByName('esplugin')
|
|
if (esplugin != null) {
|
|
plugins.add(esplugin.name)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
metaPlugins.put(extension.name, plugins.toSorted())
|
|
}
|
|
}
|
|
}
|
|
|
|
setupBats {
|
|
doLast {
|
|
metaPlugins.each{ name, plugins ->
|
|
File expectedMetaPlugins = file("build/plugins/${name}.expected")
|
|
expectedMetaPlugins.parentFile.mkdirs()
|
|
expectedMetaPlugins.setText(plugins.join('\n'), 'UTF-8')
|
|
}
|
|
}
|
|
}
|