-
Notifications
You must be signed in to change notification settings - Fork 58
/
Gruntfile.coffee
65 lines (56 loc) · 1.61 KB
/
Gruntfile.coffee
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
module.exports = (grunt) ->
config =
package: require('./package.json')
javascripts: [
"src/api-*.js"
"src/*/*.js"
]
OUT_FILE: "lib/audiolib.js"
OUT_FILE_MIN: "lib/audiolib.min.js"
RELEASE_TGZ: "lib/audiolib.js.<%= package.version %>.tar.gz"
RELEASE_ZIP: "lib/audiolib.js.<%= package.version %>.zip"
clean:
lib:
src: ["lib"]
concat:
default:
options:
banner: grunt.file.read("src/wrapper-start.js")
footer: grunt.file.read("src/wrapper-end.js")
src: ["<%= javascripts %>"]
dest: "<%= OUT_FILE %>"
uglify:
default:
src: ["<%= OUT_FILE %>"]
dest: "<%= OUT_FILE_MIN %>"
compress:
tgz:
options:
mode: "tgz"
archive: "<%= RELEASE_TGZ %>"
files: [{
src: "*.js"
dest: ""
cwd: "lib"
}]
zip:
options:
mode: "zip"
archive: "<%= RELEASE_ZIP %>"
files: [{
src: "*.js"
dest: ""
cwd: "lib"
}]
grunt.initConfig(config)
grunt.loadNpmTasks("grunt-contrib-clean")
grunt.loadNpmTasks("grunt-contrib-compress")
grunt.loadNpmTasks("grunt-contrib-concat")
grunt.loadNpmTasks("grunt-contrib-uglify")
buildTools = require('./dependencies/build-scripts')
grunt.registerTask "docs", "Updates the documentation", ->
buildTools.updatables.docs()
grunt.registerTask "wrappers", "Updates the wrappers.", ->
buildTools.updatables.wrappers()
grunt.registerTask "package", "Updates the package.", ->
buildTools.updatables.package()