-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
81 lines (69 loc) · 1.99 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
'use strict';
// Exposes the build, test and documentation tasks for the production
module.exports = function (grunt) {
var environment = process.env,
time = environment.GRUNT_TIME === 'true',
notify = environment.GRUNT_NOTIFY === 'true';
// Report the duration of the tasks run
if (time) {
require('time-grunt')(grunt);
}
// Declare tasks for the package production stages
grunt.initConfig({
// Set up desktop grunt result notifications
notify_hooks: {
options: {
enabled: notify,
max_jshint_notifications: 5,
title: 'csui',
success: true,
duration: 3
}
},
// Delegate component build to their directories, delegate test
// execution and documentation production to their directories
subgrunt: {
check: {
'src': 'check'
},
compile: ['src'],
debug: {
'src': 'debug'
},
release: {
'src': 'release'
},
specs: {
'test': 'specs'
},
test: ['test'],
options: {
npmInstall: false
}
}
});
// Load grunt plugins used in this Gruntfile
grunt.loadNpmTasks('grunt-subgrunt');
grunt.loadNpmTasks('grunt-notify');
// Perform static code correctness check
grunt.registerTask('check', ['subgrunt:check']);
// Build debug packages
grunt.registerTask('compile_debug', [
'subgrunt:check', 'subgrunt:debug'
]);
// Build release packages
grunt.registerTask('compile_release', [
'subgrunt:check', 'subgrunt:release'
]);
// Build both debug and release packages
grunt.registerTask('compile', ['subgrunt:compile']);
// Execute tests: ixmk test
grunt.registerTask('test', ['subgrunt:test']);
// Allow running just "grunt" in this directory to perform static code
// checks, build both debug and release packages and run tests
grunt.registerTask('default', [
'subgrunt:compile', 'subgrunt:specs'
]);
// Register desktop notification hooks
grunt.task.run('notify_hooks');
};