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',
|
2015-09-12 04:49:14 -05:00
|
|
|
'tslint',
|
2015-09-10 05:42:24 -05:00
|
|
|
'clean:release',
|
2016-02-12 02:58:00 -06:00
|
|
|
'copy:node_modules',
|
2015-09-10 05:42:24 -05:00
|
|
|
'copy:public_to_gen',
|
2015-09-10 04:26:40 -05:00
|
|
|
'typescript:build',
|
2016-01-20 06:28:10 -06:00
|
|
|
'karma:test',
|
2015-09-24 18:19:49 -05:00
|
|
|
'phantomjs',
|
2015-09-10 04:26:40 -05:00
|
|
|
'css',
|
2015-12-21 03:02:39 -06:00
|
|
|
'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',
|
2015-12-21 03:02:39 -06:00
|
|
|
'systemjs:build',
|
2015-09-10 09:47:38 -05:00
|
|
|
'concat:js',
|
2015-12-21 09:34:18 -06:00
|
|
|
'filerev',
|
|
|
|
'remapFilerev',
|
2015-09-10 09:47:38 -05:00
|
|
|
'usemin',
|
2015-12-21 09:34:18 -06:00
|
|
|
'uglify:genDir'
|
2013-11-14 17:07:14 -06:00
|
|
|
]);
|
|
|
|
|
2015-03-13 05:11:31 -05:00
|
|
|
// task to add [[.AppSubUrl]] to reved path
|
2015-09-10 05:42:24 -05:00
|
|
|
grunt.registerTask('remapFilerev', function() {
|
|
|
|
var root = grunt.config().genDir;
|
2015-03-13 05:11:31 -05:00
|
|
|
var summary = grunt.filerev.summary;
|
|
|
|
var fixed = {};
|
|
|
|
|
|
|
|
for(var key in summary){
|
|
|
|
if(summary.hasOwnProperty(key)){
|
2015-12-02 11:22:47 -06:00
|
|
|
var orig = key.replace(root, root+'/[[.AppSubUrl]]/public');
|
|
|
|
var revved = summary[key].replace(root, root+'/[[.AppSubUrl]]/public');
|
2015-03-13 05:11:31 -05:00
|
|
|
fixed[orig] = revved;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
grunt.filerev.summary = fixed;
|
|
|
|
});
|
|
|
|
|
2015-01-01 08:28:28 -06:00
|
|
|
grunt.registerTask('build-post-process', function() {
|
2015-09-10 06:34:32 -05:00
|
|
|
grunt.config('copy.public_gen_to_temp', {
|
2015-03-03 03:18:24 -06:00
|
|
|
expand: true,
|
2015-09-10 05:42:24 -05:00
|
|
|
cwd: '<%= genDir %>',
|
2015-03-03 03:18:24 -06:00
|
|
|
src: '**/*',
|
2015-09-10 06:34:32 -05:00
|
|
|
dest: '<%= tempDir %>/public/',
|
2015-03-03 03:18:24 -06:00
|
|
|
});
|
|
|
|
grunt.config('copy.backend_bin', {
|
|
|
|
cwd: 'bin',
|
|
|
|
expand: true,
|
2015-04-20 01:10:23 -05:00
|
|
|
src: ['*'],
|
2015-03-03 03:18:24 -06:00
|
|
|
options: { mode: true},
|
2015-09-10 06:34:32 -05:00
|
|
|
dest: '<%= tempDir %>/bin/'
|
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},
|
2015-09-10 06:34:32 -05:00
|
|
|
dest: '<%= tempDir %>'
|
2015-03-03 03:18:24 -06:00
|
|
|
});
|
|
|
|
|
2015-09-10 06:34:32 -05:00
|
|
|
grunt.task.run('copy:public_gen_to_temp');
|
2015-03-03 03:18:24 -06:00
|
|
|
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
|
|
|
};
|