-
Notifications
You must be signed in to change notification settings - Fork 29
/
Gruntfile.js
103 lines (92 loc) · 2.7 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
(function () {
var project = {
name: 'boombox.js'
};
module.exports = function (grunt) {
// enviroment
project.dir = grunt.file.findup('../' + project.name);
grunt.log.ok('[environment] project name:', project.name);
grunt.log.ok('[environment] project directory:', project.dir);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
src: ['docs', 'report']
},
exec: {
spec_foundation: {
command: 'beez-foundation -c spec/foundation/spec.js -a ' + project.name + ':' + project.dir,
stdout: true,
stderr: true
},
},
jshint: {
src: ['boombox.js'],
options: {
jshintrc: '.jshintrc',
jshintignore: ".jshintignore"
}
},
mkdir: {
docs: {
options: {
mode: 0755,
create: ['docs']
}
}
},
jsdoc : {
dist : {
src: ['boombox.js'],
options: {
lenient: true,
recurse: true,
private: true,
destination: 'docs',
configure: '.jsdoc3.json'
}
}
},
uglify: {
options: {
sourceMap: 'boombox.min.map',
preserveComments: 'some'
},
default: {
files: {
'boombox.min.js': ['boombox.js']
}
}
},
plato: {
default: {
files: {
'report': ['boombox.js']
}
}
}
});
// These plugins provide necessary tasks.
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// task: foundation
grunt.registerTask('foundation', [
'exec:spec_foundation'
]);
// task: build
grunt.registerTask('build', [
'jshint',
'uglify:default'
]);
// task: docs
grunt.registerTask('docs', [
'mkdir:docs',
'plato',
'jsdoc'
]);
// task: defulat
grunt.registerTask('default', [
'clean',
'docs',
'build'
]);
};
})(this);