-
Notifications
You must be signed in to change notification settings - Fork 111
/
Gruntfile.js
152 lines (139 loc) · 3.9 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-karma');
grunt.initConfig({
shell: {
options : {
stdout: true
},
npm_install: {
command: 'npm install'
},
bower_install: {
command: './node_modules/.bin/bower install'
},
font_awesome_fonts: {
command: 'cp -R bower_components/components-font-awesome/font app/font'
}
},
connect: {
options: {
base: 'app/'
},
webserver: {
options: {
port: 8888,
keepalive: true
}
},
devserver: {
options: {
port: 8888
}
},
testserver: {
options: {
port: 9999
}
},
coverage: {
options: {
base: 'coverage/',
port: 5555,
keepalive: true
}
}
},
open: {
devserver: {
path: 'http://localhost:8888'
},
coverage: {
path: 'http://localhost:5555'
}
},
karma: {
unit: {
configFile: './test/karma-unit.conf.js',
autoWatch: false,
singleRun: true
},
unit_auto: {
configFile: './test/karma-unit.conf.js'
},
midway: {
configFile: './test/karma-midway.conf.js',
autoWatch: false,
singleRun: true
},
midway_auto: {
configFile: './test/karma-midway.conf.js'
},
e2e: {
configFile: './test/karma-e2e.conf.js',
autoWatch: false,
singleRun: true
},
e2e_auto: {
configFile: './test/karma-e2e.conf.js'
}
},
watch: {
assets: {
files: ['app/styles/**/*.css','app/scripts/**/*.js'],
tasks: ['concat']
}
},
concat: {
styles: {
dest: './app/assets/app.css',
src: [
'app/styles/reset.css',
'bower_components/components-font-awesome/css/font-awesome.css',
'bower_components/bootstrap.css/css/bootstrap.css',
'app/styles/app.css'
]
},
scripts: {
options: {
separator: ';'
},
dest: './app/assets/app.js',
src: [
'bower_components/angular/angular.js',
'bower_components/angular-route/angular-route.js',
'bower_components/angularjs-scope.safeapply/src/Scope.SafeApply.js',
'app/scripts/lib/router.js',
'app/scripts/config/config.js',
'app/scripts/services/**/*.js',
'app/scripts/directives/**/*.js',
'app/scripts/controllers/**/*.js',
'app/scripts/filters/**/*.js',
'app/scripts/config/routes.js',
'app/scripts/app.js',
]
}
}
});
grunt.registerTask('test', ['connect:testserver','karma:unit','karma:midway', 'karma:e2e']);
grunt.registerTask('test:unit', ['karma:unit']);
grunt.registerTask('test:midway', ['connect:testserver','karma:midway']);
grunt.registerTask('test:e2e', ['connect:testserver', 'karma:e2e']);
//keeping these around for legacy use
grunt.registerTask('autotest', ['autotest:unit']);
grunt.registerTask('autotest:unit', ['connect:testserver','karma:unit_auto']);
grunt.registerTask('autotest:midway', ['connect:testserver','karma:midway_auto']);
grunt.registerTask('autotest:e2e', ['connect:testserver','karma:e2e_auto']);
//installation-related
grunt.registerTask('install', ['shell:npm_install','shell:bower_install','shell:font_awesome_fonts']);
//defaults
grunt.registerTask('default', ['dev']);
//development
grunt.registerTask('dev', ['install', 'concat', 'connect:devserver', 'open:devserver', 'watch:assets']);
//server daemon
grunt.registerTask('serve', ['connect:webserver']);
};