This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathGruntfile.js
96 lines (85 loc) · 2.24 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
module.exports = function (grunt) {
var canadarmFiles = [
'lib/intro.js',
'lib/constant.js',
'lib/level.js',
'lib/utils.js',
'lib/core.js',
'lib/appender/**/*.js',
'lib/handler/**/*.js',
'lib/instrument/**/function.js',
'lib/instrument/**/global.js',
'lib/instrument/**/event.js',
'lib/mock.js',
'lib/outro.js'
];
// Grunt Loaded Tasks
// http://chrisawren.com/posts/Advanced-Grunt-tooling
// ------------------------------------------------
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
availabletasks: {
tasks: {
options: {
filter: 'exclude',
tasks: ['availabletasks', 'default', 'concat', 'uglify']
}
}
},
// Order of these files matters. Specifically intro.js must be first
// and outro.js must be last. The build will fail if other files are
// not in the correct order.
concat: {
canadarm: {
files: {
'build/canadarm.js': canadarmFiles,
'example/js/canadarm.js': canadarmFiles
}
}
},
jsdoc : {
dist : {
src: ['lib/appender/*.js', 'lib/handler/*.js', 'lib/utils.js',
'lib/instrument/*.js', 'lib/core.js', 'lib/level.js', 'lib/constant.js'],
options: {
destination: 'docs'
}
}
},
mochaTest: {
test: {
options: {
reporter: 'nyan'
},
src: ['test/unit/**/*.js']
}
},
uglify: {
candarm: {
options: {
sourceMap: true
},
files: {
'build/canadarm.min.js': ['build/canadarm.js']
}
}
},
jshint: {
all: [
'lib/**'
],
concat: 'build/canadarm.js',
options: {
jshintrc: true
}
}
});
// Default task(s).
grunt.registerTask('default', ['availabletasks']);
// Convenience task to check lint and run tests once they exist
grunt.registerTask('test', ['mochaTest']);
// Add a task that builds our canadarm.js file
grunt.registerTask('build', ['jshint', 'concat', 'jshint:concat', 'uglify', 'test', 'jsdoc']);
};