-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
108 lines (96 loc) · 3.4 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
module.exports = function(grunt) {
var initcfg = {
pkg: grunt.file.readJSON('package.json'),
//backend documentation
jsdoc : {
main: {
src: [
'app.js',
'routes/**/*.js',
'model/**/*.js',
'utils/**/*.js',
'config/**/*.js',
'test/**/*.js'
],
options: {
destination: 'docs/backend',
readme: './README.md',
configure: 'jsdoc.conf.json'
}
}
},
jshint: {
frontEnd: ['assets/app/**/*.js', 'assets/test/**/*.js'],
backEnd: [
'Gruntfile.js',
'bin/www',
'app.js',
'config/index.js',
'routes/**/*.js',
'model/**/*.js',
'utils/**/*.js',
'test/**/*.js'
]
},
lesslint: {
src: ['assets/less/style.less'],
options: {
imports: ['assets/less/**/*.less'],
csslint: {
'known-properties': false,
'box-model': false,
'adjoining-classes': false,
'box-sizing': false,
'zero-units': false,
'outline-none': false,
'overqualified-elements': false,
'important': false,
'font-sizes': false,
'compatible-vendor-prefixes': false,
'qualified-headings': false,
'duplicate-background-images': false,
'fallback-colors': false,
'regex-selectors': false,
'unqualified-attributes': false,
'universal-selector': false,
'ids': false,
}
}
},
karma: {
unit: {
configFile: 'karma.conf.js'
}
},
mocha_istanbul: {
coverage: {
src: 'test',
},
},
angular_architecture_graph: {
diagram: {
files: {
"angular-depends": [
"assets/app/**/*.js"
]
}
}
},
};
grunt.initConfig(initcfg);
grunt.loadNpmTasks('grunt-angular-architecture-graph');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-lesslint');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.registerTask('angular-depends', ['angular_architecture_graph']);
grunt.registerTask('test-frontend', ['html2js:dev', 'karma:unit']);
grunt.registerTask('test-backend', ['mocha_istanbul']);
grunt.registerTask('test', ['jshint', 'test-frontend', 'test-backend']);
grunt.registerTask('build', ['copy', 'less', 'html2js:dev', 'ngAnnotate:main']);
grunt.registerTask('prod', ['copy', 'less', 'html2js:prod', 'ngAnnotate:main', 'uglify']);
grunt.registerTask('server', ['express:dev', 'watch']);
grunt.registerTask('docs', ['ngdocs']);
grunt.registerTask('default', ['build']);
};