forked from randy-ran/jquery-mobile-toast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
executable file
·108 lines (93 loc) · 2.31 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
module.exports = function(grunt) {
grunt.initConfig({
// Import package manifest
pkg: grunt.file.readJSON("package.json"),
// Banner definitions
meta: {
banner: '/*\n' +
' * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n' +
' * <%= pkg.description %>\n' +
' * <%= pkg.homepage %>\n' +
' *\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under the <%= pkg.license %> license.\n' +
' */\n\n'
},
// Concat definitions
concat: {
all: {
src: ["src/jquery.mobile.toast.js"],
dest: "dist/jquery.mobile.toast.js"
},
options: {
banner: "<%= meta.banner %>"
}
},
// Lint definitions
jshint: {
files: ["src/jquery.mobile.toast.js"],
options: {
jshintrc: ".jshintrc"
}
},
// Check code style
jscs: {
files: ["src/jquery.mobile.toast.js"],
options: {
config: ".jscsrc"
}
},
// Minify definitions
uglify: {
all: {
src: ["dist/jquery.mobile.toast.js"],
dest: "dist/jquery.mobile.toast.min.js"
},
options: {
banner: "<%= meta.banner %>"
}
},
clean: ["dist"],
jasmine: {
all: {
src: "src/jquery.mobile.toast.js",
options: {
vendor: [
"http://code.jquery.com/jquery-1.9.1.min.js",
"http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"
],
specs: "test/spec/{,*/}*.js"
}
}
},
// Generate documentation
yuidoc: {
compile: {
name: "<%= pkg.name %>",
description: "<%= pkg.description %>",
version: "<%= pkg.version %>",
url: "<%= pkg.homepage %>",
options: {
paths: "src",
outdir: "docs"
}
}
},
watch: {
scripts: {
files: ["src/*.js"],
tasks: ["jshint", "clean","concat", "uglify", "yuidoc"]
}
}
});
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-yuidoc");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-jasmine");
grunt.loadNpmTasks("grunt-jscs");
grunt.registerTask("default", ["jshint", "jscs", "clean","concat", "uglify", "jasmine", "yuidoc"]);
grunt.registerTask("test", ["jasmine"]);
};