Add grunt plugin to build K4 as a plugin

This commit is contained in:
Rashid Khan 2014-06-16 16:52:19 -07:00
parent 81e1426ed1
commit 9128e363fb
5 changed files with 34 additions and 5 deletions

3
.gitignore vendored
View file

@ -2,4 +2,5 @@
node_modules
trash
src/bower_components/K4D3
src/bower_components/elasticsearch
src/bower_components/elasticsearch
build

View file

@ -5,9 +5,12 @@ module.exports = function (grunt) {
configPath: __dirname + '/tasks/config',
init: true,
config: {
pkg: grunt.file.readJSON('package.json'),
root: __dirname,
src: __dirname + '/src',
app: __dirname + '/src/kibana',
build: __dirname + '/build',
unitTestDir: __dirname + '/test/unit',
testUtilsDir: __dirname + '/test/utils',
bowerComponentsDir: __dirname + '/src/bower_components',

View file

@ -1,8 +1,8 @@
{
"name": "kibana4",
"name": "kibana",
"private": true,
"version": "0.0.0",
"description": "Kibana TNG",
"version": "4.0.0-BETA1",
"description": "Kibana 4",
"main": "Gulpfile.js",
"dependencies": {},
"devDependencies": {
@ -21,7 +21,9 @@
"istanbul": "~0.2.4",
"load-grunt-config": "~0.7.0",
"lodash": "~2.4.1",
"mocha": "~1.17.1"
"mocha": "~1.17.1",
"grunt-contrib-compress": "~0.9.1",
"grunt-contrib-copy": "~0.5.0"
},
"scripts": {
"test": "grunt test",

17
tasks/config/compress.js Normal file
View file

@ -0,0 +1,17 @@
module.exports = function (config) {
return {
plugin: {
options: {
archive: '<%= build %>/<%= pkg.name %>-plugin-latest.tar.gz'
},
files : [
{
expand: true,
cwd: 'src',
src: ['**/*'],
dest: '<%= pkg.name %>/_site'
}
]
}
};
};

6
tasks/plugin.js Normal file
View file

@ -0,0 +1,6 @@
module.exports = function (grunt) {
grunt.registerTask('plugin', [
'less',
'compress'
]);
};