forked from clebert/typesystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
executable file
·119 lines (110 loc) · 2.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
'use strict';
var time = require('time-grunt');
module.exports = function (grunt) {
time(grunt);
grunt.initConfig({
bumpup: {
file: 'package.json'
},
jscs: {
options: {
config: '.jscsrc'
},
src: [
'**/*.js',
'!node_modules/**/*.js'
]
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
src: [
'**/*.js',
'**/*.json',
'!node_modules/**/*.js',
'!node_modules/**/*.json'
]
},
mochacov: {
options: {
colors: true,
files: 'test/*.test.js',
harmony: true,
ui: 'bdd'
},
'test-spec': {
options: {
reporter: 'spec'
}
},
'test-html-cov': {
options: {
output: 'test/coverage.html',
quiet: true,
reporter: 'html-cov'
}
},
'test-console-cov': {
options: {
coverage: true,
reporter: 'mocha-cov-reporter'
}
},
'travis-coveralls': {
options: {
coveralls: {
serviceName: 'travis-ci'
}
}
}
},
module: {
'check-repository': {
options: {
check: true
}
},
'license-copyright': {
options: {
replace: true,
line: 3
},
src: 'LICENSE'
},
'release-publish': {
options: {
release: true,
publish: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-bumpup');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-mocha-cov');
grunt.loadNpmTasks('grunt-module');
grunt.registerTask('test', [
'mochacov:test-spec',
'mochacov:test-html-cov',
'mochacov:test-console-cov'
]);
grunt.registerTask('build', [
'jscs',
'jshint',
'test'
]);
grunt.registerTask('publish', function (type) {
grunt.task.run('build');
grunt.task.run('module:check-repository');
grunt.task.run('bumpup:' + type);
grunt.task.run('module:license-copyright');
grunt.task.run('module:release-publish');
});
grunt.registerTask('travis', [
'build',
'mochacov:travis-coveralls'
]);
grunt.registerTask('default', 'build');
};