-
Notifications
You must be signed in to change notification settings - Fork 17
/
Gruntfile.js
105 lines (94 loc) · 2.73 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
/*
* grunt-run-grunt * https://github.com/Bartvds/grunt-run-grunt *
* Copyright (c) 2013-2018 Bart van der Schoor
* Licensed under the MIT license.
*/
'use strict';
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-bump');
grunt.loadTasks('tasks');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bump: {
options: {
files: ['package.json'],
updateConfigs: ['pkg'],
commit: true,
commitMessage: 'release %VERSION%',
commitFiles: ['-a'], // '-a' for all files
createTag: true,
tagName: '%VERSION%',
tagMessage: 'version %VERSION%',
push: true,
pushTo: 'origin',
// cargo cult magic.. wtf?
// options to use with '$ git describe'
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d'
}
},
clean: {
tmp: ['tmp/**/*', 'test/tmp/**/*', 'test/shell/**/*']
},
jshint: {
options: {
reporter: './node_modules/jshint-path-reporter',
jshintrc: '.jshintrc'
},
all: [ 'Gruntfile.js', 'tasks/**/*.js', 'lib/**/*.js', 'test/**/*.js']
},
mochaTest: {
options: {
reporter: 'mocha-unfunk-reporter'
},
all: {
src: ['test/init.js', 'test/spec/**/*.test.js']
},
parser_module: {
src: ['test/init.js', 'test/spec/parser-module.test.js']
}
},
// dogfooding
run_grunt: {
options: {
concurrent: 2
},
all_tests: {
options: {
debugCli: true,
// writeShell: 'test/shell/',
// keep this updated
minimumFiles: 6,
maximumFiles: 12,
},
src: ['test/Gruntfile*.js']
},
task: {
src: ['test/Gruntfile-task.js']
},
process: {
src: ['test/Gruntfile-process.js']
},
help: {
src: ['test/Gruntfile-help.js']
},
parser: {
src: ['test/Gruntfile-parser.js']
},
gruntCli: {
src: ['test/Gruntfile-gruntCli.js']
}
}
});
grunt.registerTask('prep', ['clean', 'jshint']);
grunt.registerTask('test', ['prep', 'run_grunt:all_tests', 'mochaTest:all']);
grunt.registerTask('default', ['test']);
grunt.registerTask('dev', ['prep', 'run_grunt:task']);
grunt.registerTask('edit_01', ['mochaTest']);
grunt.registerTask('edit_02', ['prep', 'run_grunt:process']);
grunt.registerTask('edit_03', ['prep', 'run_grunt:help']);
grunt.registerTask('edit_04', ['prep', 'run_grunt:parser', 'mochaTest:parser_module']);
grunt.registerTask('edit_05', ['prep', 'run_grunt:gruntCli']);
};