This repository has been archived by the owner on Jan 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
grunt.js
101 lines (91 loc) · 2.54 KB
/
grunt.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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
name: 'class.js',
banner: "/*! class.js v<%= pkg.version %> <%= pkg.url %> | License: https://github.com/tjbutz/class.js/blob/master/LICENSE */"
},
concat: {
dist: {
src: ['<banner>',
// Warning: The order of the script inclusion is relevant
// for the order of the class definition.
// e.g.: Interface check should be done when all methods were added
'lib/class.core.js',
'lib/class.namespace.js',
'lib/class.singleton.js',
'lib/class.statics.js', // can override singleton
'lib/class.properties.js',
'lib/class.mixins.js',
'lib/class.members.js', // can override properties & mixins
'lib/class.interfaces.js' // need to be added last
],
dest: 'class.js'
}
},
min: {
dist: {
src: ['<banner>', 'class.js'],
dest: 'class.min.js'
}
},
test: {
files: ['test/**/*.js']
},
lint: {
files: ['grunt.js', 'lib/**/*.js']
},
watch: {
files: [
"lib/**/*.js"
],
tasks : "default"
},
jshint: {
options: {
curly: false,
eqeqeq: true,
immed: false,
latedef: true,
newcap: false,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
shadow : true,
expr : false
},
globals: {
exports: true,
require : true,
module: false
}
},
uglify: {}
});
// Default task.
// grunt.registerTask('default', 'lint test concat min');
grunt.registerTask('default', 'concat min qunit');
grunt.registerTask("qunit", function( commit, configFile ) {
var done = this.async();
//var config = grunt.file.readJSON( configFile ).qunit;
var testrunner = require("qunit");
// or use setup function
testrunner.setup({
log: {
summary: true,
errors: true
}
});
// one code and tests file
testrunner.run({
deps: "./test/lib/underscore.js",
code: "./class.js",
tests: ["./test/oo.js", "./test/properties.js", "./test/properties.ecma5.js", "./test/members.js", "./test/mixins.js", "./test/interfaces.js", "./test/statics.js", "./test/singleton.js"]
},function(err, report) {
done(report.failed === 0);
});
});
};