2018-01-25 04:20:52 -05:00
|
|
|
import org.elasticsearch.gradle.plugin.MetaPluginBuildPlugin
|
|
|
|
import org.elasticsearch.gradle.plugin.MetaPluginPropertiesExtension
|
|
|
|
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
|
|
|
import org.elasticsearch.gradle.plugin.PluginPropertiesExtension
|
|
|
|
|
2017-06-12 10:02:48 -04:00
|
|
|
apply plugin: 'elasticsearch.vagrantsupport'
|
2016-11-15 09:30:13 -05:00
|
|
|
apply plugin: 'elasticsearch.vagrant'
|
|
|
|
|
|
|
|
esvagrant {
|
|
|
|
inheritTestUtils true
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2018-01-25 04:20:52 -05:00
|
|
|
// Packaging tests use the x-pack meta plugin
|
2018-01-27 00:48:30 -05:00
|
|
|
bats project(path: xpackProject('plugin').path, configuration: 'zip')
|
2016-11-15 09:30:13 -05:00
|
|
|
|
|
|
|
// Inherit Bats test utils from :qa:vagrant project
|
|
|
|
bats project(path: ':qa:vagrant', configuration: 'bats')
|
2017-06-12 10:02:48 -04:00
|
|
|
}
|
2018-01-25 04:20:52 -05:00
|
|
|
|
|
|
|
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')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|