-
Notifications
You must be signed in to change notification settings - Fork 300
/
gruntfile.js
136 lines (133 loc) · 3.53 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '// <%= pkg.title %> v<%= pkg.version %>\n' + '//\n' + '// Copyright (c) 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' + '// Distributed under MIT License\n' + '//\n' + '// Documentation and full license available at:\n' + '// <%= pkg.homepage %>\n'
},
rig: {
browser: {
options: {
banner: '<%=grunt.config.get("meta").banner%>'
},
files: {
'dist/<%= pkg.name %>.js': ['src/<%= pkg.name %>.js']
}
},
amd: {
options: {
banner: '<%=grunt.config.get("meta").banner%>'
},
files: {
'dist/<%= pkg.name %>-amd.js': ['src/<%= pkg.name %>-amd.js']
}
}
},
uglify: {
browser: {
options: {
banner: '<%=grunt.config.get("meta").banner%>'
},
files: {
'dist/<%= pkg.name %>-min.js': ['dist/<%= pkg.name %>.js']
}
},
amd: {
options: {
banner: '<%=grunt.config.get("meta").banner%>'
},
files: {
'dist/<%= pkg.name %>-amd-min.js': ['dist/<%= pkg.name %>-amd.js']
}
}
},
watch: {
files: '<%=grunt.config.get("lint").files%>',
tasks: 'default'
},
buster: {
test: {
'config': 'buster.js',
'color': 'none',
'config-group': 'Browser'
},
server: {
'port': '1111'
}
},
jshint: {
all: ['grunt.js', 'src/**/*.js', 'tests/**/*.js']
},
docco: {
app: {
src: ['dist/backbone-validation.js'],
options: {
template: 'docco/docco.jst',
css: 'docco/docco.css',
output: 'docs/'
}
}
},
shell: {
npm: {
command: 'npm publish',
options: {
stdout: true,
stderr: true
}
},
clone: {
command: 'git clone [email protected]:thedersen/thedersen.github.com.git',
options: {
stdout: true,
stderr: true
}
},
copyDocco: {
command: 'cp docs/backbone-validation.html thedersen.github.com/projects/backbone-validation/docs/index.html',
options: {
stdout: true,
stderr: true
}
},
copyCss: {
command: 'cp docs/docco.css thedersen.github.com/projects/backbone-validation/docs/docco.css',
options: {
stdout: true,
stderr: true
}
},
copyExamples: {
command: 'cp -rf examples/ thedersen.github.com/projects/backbone-validation/examples/',
options: {
stdout: true,
stderr: true
}
},
push: {
command: 'git commit -am "Updated docs for Backbone.Validation" && git push origin master',
options: {
stdout: true,
stderr: true,
execOptions: {
cwd: 'thedersen.github.com'
}
}
},
cleanup: {
command: 'rm -rf thedersen.github.com',
options: {
stdout: true,
stderr: true
}
}
}
});
grunt.registerTask('default', ['rig', 'jshint', 'buster', 'uglify']);
grunt.registerTask('publish', ['docco', 'shell']);
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-buster');
grunt.loadNpmTasks('grunt-docco');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-rigger');
};