-
Notifications
You must be signed in to change notification settings - Fork 858
/
Gruntfile.js
107 lines (95 loc) · 3.35 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
src: [
'src/**/*.js'
],
options: {
curly: true,
immed: true,
newcap: true,
noarg: true,
sub: true,
boss: true,
eqnull: true
}
},
karma: {
unit: {
options: {
files: [
'vendor/jquery/jquery-2.1.0.min.js', // jQuery is included for the purposes of easier DOM selection when testing directives.
'vendor/angular/angular.js',
'vendor/angular-mocks/angular-mocks.js',
'vendor/angular-ui-router/release/angular-ui-router.js',
'tmp/templates.js',
'src/angularUtils.js',
'src/filters/**/*.js',
'src/filters/**/*.spec.js',
'src/directives/**/*.js',
'src/directives/**/*.spec.js',
'src/services/**/*.js',
'src/services/**/*.spec.js'
],
frameworks: [ 'jasmine' ],
plugins: [ 'karma-jasmine', 'karma-firefox-launcher', 'karma-chrome-launcher', 'karma-phantomjs-launcher' ]
},
singleRun: true,
port: 9877,
browsers: [
'PhantomJS'
]
}
},
watch: {
jssrc: {
files: [
'src/**/*.js'
],
tasks: [ 'default' ]
}
},
html2js: {
options: {
// custom options, see below
},
main: {
src: ['src/**/*.tpl.html'],
dest: 'tmp/templates.js'
}
},
copy: {
// used to copy certain of the utils to external repo directories
dirPagination: {
expand: true,
flatten: true,
src: [
'src/directives/pagination/dirPagination.js',
'src/directives/pagination/dirPagination.tpl.html'],
dest: '../angularUtils-dist/angularUtils-pagination/'
},
uiBreadcrumbs: {
expand: true,
flatten: true,
src: [
'src/directives/uiBreadcrumbs/uiBreadcrumbs.js',
'src/directives/uiBreadcrumbs/uiBreadcrumbs.tpl.html'],
dest: '../angularUtils-dist/angularUtils-uiBreadcrumbs/'
},
dirDisqus: {
expand: true,
flatten: true,
src: ['src/directives/disqus/dirDisqus.js'],
dest: '../angularUtils-dist/angularUtils-disqus/'
}
}
});
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['jshint', 'html2js', 'karma']);
grunt.registerTask('publish', ['copy']);
};