This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
forked from yaoazhen/recorder.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
111 lines (105 loc) · 2.55 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
/*global module:false*/
module.exports = function (grunt) {
// load all grunt tasks matching the `grunt-*` pattern
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks("grunt-git-dist");
grunt.registerTask("build", ["exec:make","copy:dist","urequire","uglify"]);
grunt.registerTask("default", ["clean:dist","build", "clean:swf"]);
grunt.registerTask("release", [
"clean:dist",
"git-dist:release:clone",
"build",
"git-describe",
"git-dist:release:add",
"git-dist:release:commit",
"git-dist:release:push"
]);
grunt.event.on("git-describe", function(git_version) {
grunt.config("pkg.version", grunt.config("pkg.version") + "+" + git_version.object);
});
// Project configuration.
grunt.config.init({
pkg: grunt.file.readJSON('package.json'),
meta: {
version: "<%= pkg.version %>",
banner: "/*! <%= pkg.name %> - <%= pkg.version %> @ <%= grunt.template.today('yyyy-mm-dd HH:MM:ss') %> */"
},
clean: {
"dist": "dist/",
"swf": "*.swf"
},
exec: {
make: {
cmd: "make",
stdout: false,
stderr: false
}
},
copy: {
dist: {
files: [
{
expand : true,
src: ["recorder.js","recorder.swf","require.js", "module.js"],
dest: "dist"
}
]
}
},
urequire: {
amd: {
template: "AMD",
path: 'dist',
filez: ["recorder.js"],
// Export global Recorder for bridging flash.
dependencies: {
exports: {
root: {
"recorder": "Recorder"
}
}
},
resources: [
[
'+exportsVars',
["recorder.js"],
function (m) {
m.afterBody = "module.exports = Recorder;"
}
]
],
forceOverwriteSources: true
}
},
uglify: {
dist: {
src: [ "<banner>", "dist/recorder.js" ],
dest: "dist/recorder.min.js"
}
},
"git-describe": {
bundle: {}
},
bump: {
options: {
commitMessage: 'Release v%VERSION%',
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: true,
pushTo: 'origin',
// options to use with '$ git describe'
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d'
}
},
"git-dist" : {
"release" : {
"options" : {
"branch" : "dist",
"dir" : "dist",
"message" : "Built <%= pkg.name %> - <%= pkg.version %>"
}
}
}
});
};