-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathGruntfile.js
78 lines (63 loc) · 2.05 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
// get packge info
pkg: grunt.file.readJSON('package.json'),
// app
app: 'app/js/app.js',
// get all states / modules
states: grunt.file.expand(
'app/states/**/*.js',
'!app/states/**/*.pageobject.js',
'!app/states/**/*.scenario.js',
'!app/states/**/*.spec.js'
).join(' '),
// get all components
components: grunt.file.expand(
'app/components/**/*.js',
'!app/components/**/*.spec.js'
).join(' '),
// start local server
connect: {
server: {
options: {
port: 8000,
base: 'app',
keepalive: true
}
}
},
// run shell scripts
shell: {
// create app.min.js
min: {
command: 'java -jar closure/compiler.jar ' +
'--compilation_level ADVANCED_OPTIMIZATIONS ' +
// '--formatting PRETTY_PRINT ' +
'--language_in ECMASCRIPT5_STRICT ' +
'--angular_pass ' + // inject dependencies automatically
'--externs closure/externs/angular.js ' + // angular.d -> angular.module
'--generate_exports ' + // keep @export notated code
'--manage_closure_dependencies ' +
'--js closure/library/base.js ' + // don't add 'goog.' stuff to script
'--js <%= app %> ' +
'--js <%= states %> ' +
'--js <%= components %> ' +
'--js_output_file app/js/app.min.js'
},
// karma
karma: {
command: './node_modules/karma/bin/karma start test/unit/karma.conf.js'
},
// protractor
protractor: {
command: './node_modules/protractor/bin/protractor test/e2e/protractor.conf.js'
}
},
});
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default', ['shell:min']);
grunt.registerTask('protractor', ['shell:protractor']);
grunt.registerTask('karma', ['shell:karma']);
};