-
Notifications
You must be signed in to change notification settings - Fork 17
/
Gruntfile.js
executable file
·139 lines (122 loc) · 3.91 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: [
'./js/build/*'
],
concat: {
build: {
files: {
'./js/build/services.js': './js/services/*.js',
'./js/build/controllers.js': './js/controllers/*.js',
'./js/build/directives.js': './js/directives/*.js',
'./js/build/filters.js': './js/filters/*.js',
}
}
},
ngtemplates: {
app: {
src: ['partials/*.htm'],
dest: './js/build/templates.js',
options: {
module: 'kla'
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
files: {
'./js/build/services.js': './js/build/services.min.js',
'./js/build/controllers.js': './js/build/controllers.min.js',
'./js/build/directives.js': './js/build/directives.min.js',
'./js/build/filters.js': './js/build/filters.min.js'
}
}
},
jshint: {
options: {
},
files: [
'./js/**/*.js'
]
},
sloc: {
app: {
files: {
'./': [ 'js/build/*.js' ],
'./js': [ 'app.js' ]
}
}
},
watch: {
scripts: {
files: [
'./js/services/*.js',
'./js/controllers/*.js',
'./js/directives/*.js',
'./js/filters/*.js',
'./partials/*.htm'
],
tasks: ['default'],
options: {
interrupt: true,
},
},
},
ngdocs: {
options: {
dest: './docs',
scripts: ['angular.js'],
html5Mode: false,
title: 'Docs',
},
app: {
src: [
'js/controllers/*.js',
'js/directives/*.js',
'js/services/*.js',
'js/filters/*.js',
],
title: 'KLA'
},
},
docular: {
groups: [{
id: "api",
title:"Angular API",
scripts: [
'js/directives/navbar-link.js',
]
}],
docular_partial_home: 'home.html',
docular_partial_navigation: 'navigation.html',
docular_webapp_target: 'docs',
showDocularDocs: true,
showAngularDocs: true
},
finished: {
app: {}
}
});
grunt.registerMultiTask('finished', function() {
grunt.log.writeln('Type "grunt sloc" to get a report on the number of source code lines.');
grunt.log.writeln('Type "grunt jshint" to get a report on the JavaScript code.');
});
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-sloc');
grunt.loadNpmTasks('grunt-ngdocs');
grunt.loadNpmTasks('grunt-docular');
// Default task(s).
grunt.registerTask('docs', ['ngdocs']);
grunt.registerTask('default', ['clean', 'concat', 'ngtemplates', 'uglify', 'finished']);
};