2015-08-07 20:49:56 +02:00
|
|
|
require('babel/register')(require('./src/optimize/babelOptions'));
|
2015-08-01 01:33:01 +02:00
|
|
|
|
2014-02-11 00:09:04 +01:00
|
|
|
module.exports = function (grunt) {
|
2014-06-18 19:35:37 +02:00
|
|
|
// 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
|
2014-06-18 19:35:37 +02:00
|
|
|
// grunt.config.get() within the config files
|
|
|
|
var config = {
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
root: __dirname,
|
2015-06-26 00:44:06 +02:00
|
|
|
src: __dirname + '/src',
|
|
|
|
build: __dirname + '/build', // temporary build directory
|
|
|
|
plugins: __dirname + '/src/plugins',
|
2015-06-26 00:59:55 +02:00
|
|
|
server: __dirname + '/src/server',
|
2015-06-26 00:44:06 +02:00
|
|
|
target: __dirname + '/target', // location of the compressed build targets
|
2015-07-21 00:29:48 +02:00
|
|
|
testUtilsDir: __dirname + '/src/testUtils',
|
2015-06-26 00:44:06 +02:00
|
|
|
configFile: __dirname + '/src/config/kibana.yml',
|
2014-06-18 19:35:37 +02:00
|
|
|
|
2015-07-28 17:23:56 +02:00
|
|
|
karmaBrowser: (function () {
|
2015-08-19 00:33:29 +02:00
|
|
|
if (grunt.option('browser')) {
|
|
|
|
return grunt.option('browser');
|
|
|
|
}
|
|
|
|
|
2015-07-28 17:23:56 +02:00
|
|
|
switch (require('os').platform()) {
|
|
|
|
case 'win32':
|
|
|
|
return 'IE';
|
|
|
|
case 'darwin':
|
|
|
|
return 'Chrome';
|
|
|
|
default:
|
|
|
|
return 'Firefox';
|
|
|
|
}
|
|
|
|
}()),
|
|
|
|
|
2015-08-14 00:43:58 +02:00
|
|
|
nodeVersion: '2.5.0',
|
2014-10-23 08:30:49 +02:00
|
|
|
|
2014-06-18 19:35:37 +02:00
|
|
|
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-06-25 19:31:50 +02:00
|
|
|
'<%= src %>/**/*.js',
|
2015-07-21 00:29:48 +02:00
|
|
|
'!<%= src %>/fixtures/**/*.js'
|
2015-08-27 01:36:19 +02:00
|
|
|
]
|
2014-06-18 19:35:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
grunt.config.merge(config);
|
|
|
|
|
2015-08-14 06:16:54 +02:00
|
|
|
config.userScriptsDir = __dirname + '/build/userScripts';
|
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);
|
|
|
|
|
2014-06-18 19:35:37 +02:00
|
|
|
// load plugins
|
|
|
|
require('load-grunt-config')(grunt, {
|
|
|
|
configPath: __dirname + '/tasks/config',
|
|
|
|
init: true,
|
2015-08-03 18:35:31 +02:00
|
|
|
config: config,
|
|
|
|
loadGruntTasks: {
|
|
|
|
pattern: ['grunt-*', '@*/grunt-*', 'gruntify-*', '@*/gruntify-*']
|
|
|
|
}
|
2014-02-11 00:09:04 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
// 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');
|
2014-08-26 02:55:32 +02:00
|
|
|
};
|