2014-10-18 01:23:07 +02:00
|
|
|
module.exports = function (grunt) {
|
|
|
|
grunt.registerTask('make_plugin_dir', function () {
|
|
|
|
var dir = grunt.config.process('<%= build %>/dist/kibana/plugins');
|
|
|
|
grunt.file.mkdir(dir);
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.registerTask('describe_bundled_plugins', function () {
|
2014-12-17 19:33:20 +01:00
|
|
|
var configKey = 'bundled_plugin_ids';
|
2014-10-18 01:23:07 +02:00
|
|
|
var file = grunt.config.process('<%= build %>/dist/kibana/config/kibana.yml');
|
2014-12-17 19:33:20 +01:00
|
|
|
var idList = grunt.config.get('bundled_plugin_module_ids').map(function (id) {
|
2014-10-18 01:23:07 +02:00
|
|
|
return ' - ' + id;
|
|
|
|
}).join('\n');
|
|
|
|
|
|
|
|
var contents = grunt.file.read(file);
|
|
|
|
if (contents.indexOf(configKey) !== -1) {
|
|
|
|
grunt.log.error('bundled plugin ids already written to config/kibana.yml');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-10-21 22:01:53 +02:00
|
|
|
contents +=
|
2014-10-18 01:23:07 +02:00
|
|
|
'\n# Plugins that are included in the build, and no longer found in the plugins/ folder' +
|
|
|
|
'\n' + configKey + ':' +
|
|
|
|
'\n' + idList;
|
|
|
|
|
|
|
|
grunt.file.write(file, contents);
|
|
|
|
});
|
|
|
|
};
|