2013-11-14 17:07:14 -06:00
|
|
|
module.exports = function(grunt) {
|
2015-01-04 10:51:48 -06:00
|
|
|
"use strict";
|
2013-11-14 17:07:14 -06:00
|
|
|
|
|
|
|
// Concat and Minify the src directory into dist
|
|
|
|
grunt.registerTask('build', [
|
|
|
|
'jshint:source',
|
2014-04-06 03:47:14 -05:00
|
|
|
'jshint:tests',
|
2015-03-03 03:20:52 -06:00
|
|
|
'jscs',
|
2014-12-30 04:05:24 -06:00
|
|
|
'karma:test',
|
2013-11-14 17:07:14 -06:00
|
|
|
'clean:on_start',
|
2014-02-10 11:05:52 -06:00
|
|
|
'less:src',
|
2014-08-10 02:46:42 -05:00
|
|
|
'concat:cssDark',
|
|
|
|
'concat:cssLight',
|
2013-11-14 17:07:14 -06:00
|
|
|
'copy:everything_but_less_to_temp',
|
|
|
|
'htmlmin:build',
|
2014-06-01 09:57:59 -05:00
|
|
|
'ngtemplates',
|
2013-11-14 17:07:14 -06:00
|
|
|
'cssmin:build',
|
2015-02-03 06:36:04 -06:00
|
|
|
'ngAnnotate:build',
|
2013-11-14 17:07:14 -06:00
|
|
|
'requirejs:build',
|
2014-06-01 09:57:59 -05:00
|
|
|
'concat:js',
|
2014-05-31 02:22:49 -05:00
|
|
|
'filerev',
|
2014-06-01 09:57:59 -05:00
|
|
|
'usemin',
|
2013-11-14 17:07:14 -06:00
|
|
|
'clean:temp',
|
2015-03-03 03:18:24 -06:00
|
|
|
'uglify:dest'
|
2013-11-14 17:07:14 -06:00
|
|
|
]);
|
|
|
|
|
2015-01-01 08:28:28 -06:00
|
|
|
grunt.registerTask('build-post-process', function() {
|
2015-03-03 03:18:24 -06:00
|
|
|
grunt.config('copy.dist_to_tmp', {
|
|
|
|
expand: true,
|
|
|
|
cwd: '<%= destDir %>',
|
|
|
|
src: '**/*',
|
|
|
|
dest: '<%= tempDir %>/public/',
|
|
|
|
});
|
|
|
|
grunt.config('clean.dest_dir', ['<%= destDir %>']);
|
|
|
|
grunt.config('copy.backend_bin', {
|
|
|
|
cwd: 'bin',
|
|
|
|
expand: true,
|
|
|
|
src: ['grafana'],
|
|
|
|
options: { mode: true},
|
|
|
|
dest: '<%= tempDir %>'
|
2013-11-14 17:07:14 -06:00
|
|
|
});
|
2015-03-03 03:18:24 -06:00
|
|
|
grunt.config('copy.backend_files', {
|
|
|
|
expand: true,
|
2015-03-03 03:20:52 -06:00
|
|
|
src: ['conf/defaults.ini', 'conf/sample.ini', 'vendor/**/*', 'scripts/*'],
|
2015-03-03 03:18:24 -06:00
|
|
|
options: { mode: true},
|
|
|
|
dest: '<%= tempDir %>'
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.task.run('copy:dist_to_tmp');
|
|
|
|
grunt.task.run('clean:dest_dir');
|
|
|
|
grunt.task.run('copy:backend_bin');
|
|
|
|
grunt.task.run('copy:backend_files');
|
2013-11-14 17:07:14 -06:00
|
|
|
});
|
2014-06-09 09:59:53 -05:00
|
|
|
|
2014-05-31 02:22:49 -05:00
|
|
|
};
|