forked from wa0x6e/cal-heatmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
116 lines (108 loc) · 3.16 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
106
107
108
109
110
111
112
113
114
115
116
module.exports = function(grunt) {
"use strict";
var headerComment = "/*! <%= pkg.name %> v<%= pkg.version %> (<%= grunt.template.today() %>)\n" +
" * ---------------------------------------------\n" +
" * <%= pkg.description %>\n" +
" * <%= pkg.homepage %>\n" +
" * Licensed under the <%= pkg.license %> license\n" +
" * Copyright 2014 <%= pkg.author.name %>\n" +
" */\n";
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
jshint: {
options: {
jshintrc: ".jshintrc"
},
lib: {
src: ["src/<%= pkg.name %>.js"]
},
test: {
options: {
jshintrc: "test/.jshintrc"
},
src: ["test/test.js", "test/test-amd.js"]
}
},
csslint: {
base: {
src: "<%= pkg.name %>.css",
rules: {
"known-properties": false,
"box-sizing": false
}
}
},
uglify: {
options: {
banner: headerComment
},
base: {
files: {
"<%= pkg.name %>.min.js" : ["<%= pkg.name %>.js"]
}
}
},
qunit: {
options: {
"--web-security": "no",
coverage: {
src: ["src/*.js"],
instrumentedFiles: "temp/",
htmlReport: "report/coverage",
coberturaReport: "report/"
}
},
all: ["test/*.html"]
},
concat: {
options: {
banner: headerComment + "\n"
},
js: {
src: ["src/<%= pkg.name %>.js"],
dest: "<%= pkg.name %>.js"
},
test: {
src: ["test/src/function.js", "test/src/**/*.js"],
dest: "test/test.js"
}
},
coveralls: {
options: {
coverage_dir: "coverage/"
}
},
watch: {
scripts: {
files: "test/src/**/*.js",
tasks: ["concat:test"],
options: {
interrupt: true,
}
},
lint: {
files: "src/*.js",
tasks: ["jshint:lib"],
options: {
interrupt: true,
}
}
}
});
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-css");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-karma-coveralls");
grunt.loadNpmTasks("grunt-contrib-watch");
// TO RUN BEFORE COMMIT
// ====================
grunt.registerTask("quick-build", ["csslint", "jshint"]);
// Full build without version bump
grunt.registerTask("build", ["concat", "qunit", "csslint", "jshint", "uglify"]);
// FOR TRAVIS
// ==========
grunt.registerTask("travis", ["jshint", "csslint"]);
};