kibana/Gruntfile.js

95 lines
3 KiB
JavaScript
Raw Normal View History

2016-03-10 20:42:45 +01:00
const camelCase = require('lodash').camelCase;
require('babel/register')(require('./src/optimize/babel_options').node);
2015-08-01 01:33:01 +02:00
module.exports = function (grunt) {
// set the config once before calling load-grunt-config
2015-07-23 01:21:49 +02:00
// and once during so that we have access to it via
// grunt.config.get() within the config files
2016-03-10 20:42:45 +01:00
const config = {
pkg: grunt.file.readJSON('package.json'),
root: __dirname,
src: __dirname + '/src',
buildDir: __dirname + '/build', // temporary build directory
plugins: __dirname + '/src/core_plugins',
2015-06-26 00:59:55 +02:00
server: __dirname + '/src/server',
target: __dirname + '/target', // location of the compressed build targets
2016-02-24 22:00:46 +01:00
testUtilsDir: __dirname + '/src/test_utils',
configFile: __dirname + '/src/config/kibana.yml',
karmaBrowser: (function () {
if (grunt.option('browser')) {
return grunt.option('browser');
}
switch (require('os').platform()) {
case 'win32':
return 'IE';
default:
return 'Chrome';
}
}()),
nodeVersion: grunt.file.read('.node-version').trim(),
meta: {
banner: '/*! <%= package.name %> - v<%= package.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= package.homepage ? " * " + package.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= package.author.company %>;' +
' Licensed <%= package.license %> */\n'
2015-02-07 20:26:20 +01:00
},
2015-08-14 06:16:54 +02:00
2015-02-07 20:26:20 +01:00
lintThese: [
'Gruntfile.js',
'<%= root %>/tasks/**/*.js',
2015-11-11 23:45:24 +01:00
'<%= root %>/test/**/*.js',
2015-06-25 19:31:50 +02:00
'<%= src %>/**/*.js',
2015-11-13 00:04:43 +01:00
'!<%= src %>/fixtures/**/*.js',
'!<%= root %>/test/fixtures/scenarios/**/*.js'
2015-09-14 22:39:17 +02:00
],
deepModules: {
'caniuse-db': '1.0.30000265',
'chalk': '1.1.0',
'glob': '4.5.3',
'har-validator': '1.8.0',
'json5': '0.4.0',
'loader-utils': '0.2.11',
'micromatch': '2.2.0',
'postcss-normalize-url': '2.1.1',
'postcss-reduce-idents': '1.0.2',
'postcss-unique-selectors': '1.0.0',
'postcss-minify-selectors': '1.4.6',
'postcss-single-charset': '0.3.0',
'regenerator': '0.8.36',
'readable-stream': '2.1.0'
2015-09-14 22:39:17 +02:00
}
};
grunt.config.merge(config);
// must run before even services/platforms
grunt.config.set('build', require('./tasks/config/build')(grunt));
config.packageScriptsDir = __dirname + '/tasks/build/package_scripts';
2015-08-14 20:53:26 +02:00
// ensure that these run first, other configs need them
2015-08-14 06:16:54 +02:00
config.services = require('./tasks/config/services')(grunt);
2015-08-14 20:53:26 +02:00
config.platforms = require('./tasks/config/platforms')(grunt);
2015-08-14 06:16:54 +02:00
grunt.config.merge(config);
// load plugins
require('load-grunt-config')(grunt, {
configPath: __dirname + '/tasks/config',
init: true,
config: config,
loadGruntTasks: {
pattern: ['grunt-*', '@*/grunt-*', 'gruntify-*', '@*/gruntify-*', 'intern']
}
});
// load task definitions
2014-09-16 23:16:36 +02:00
grunt.task.loadTasks('tasks');
2015-08-14 06:16:54 +02:00
grunt.task.loadTasks('tasks/build');
grunt.task.loadTasks('tasks/rebuild');
};