-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
50 lines (41 loc) · 2.08 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
module.exports = function(grunt) {
// I don't know if this is important
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});
// Loads the different modules used by this gruntfile
// release
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('grunt-angular-templates');
// debug
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-protractor-runner');
grunt.loadNpmTasks('grunt-tslint');
// load the configs of all tasks defined under /config
var configs = require('load-grunt-configs')(grunt);
grunt.initConfig(configs);
// this task updates all distributions - launch it once before each release
grunt.registerTask('dist', ["clean:dist", "ts:dist", "ngtemplates:dist", 'concat:standard', 'uglify:standard', 'sass:dist', "copy:tsdefinitions", "copy:demolibs"]);
// use this tasks when you are developping
grunt.registerTask('debug', ["dist", "sass:demo", "clean:tests", "ts:test", "connect:server", "concurrent:debug"]);
// // use this one when you're coding e2e tests
grunt.registerTask('e2e', ["dist", "ts:e2e", "connect", "protractor:singlerun", "concurrent:e2e"]);
// this updates the dists and tests it, creates karma coverage
grunt.registerTask('test', ["dist", "clean:tests", "ts:test", 'karma:debug', 'karma:coverage', "connect:server", "protractor:singlerun", "jshint"]);
// default task
grunt.registerTask('default', ['debug']);
// used for travis integration
grunt.registerTask('travis-karma', ["ts:test", 'karma:travis']);
// grunt.registerTask('travis-protractor', ["ts:e2e", "connect", "protractor:saucelab"]);
grunt.registerTask('jenkins-karma', ["ts:test", "karma:coverage"]);
grunt.registerTask('jenkins-protractor', ["ts:e2e", "connect", "protractor:singlerun"]);
};