forked from github/game-off-2013
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Gruntfile.coffee
133 lines (115 loc) · 4.34 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
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
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
jade:
build:
options:
pretty: true
data:
debug: true
files:
"./build/index.html": ["./dev/index.jade"]
release:
options:
pretty: false
data:
debug: false
files:
"./dist/index.html": ["./dev/index.jade"]
less:
options:
paths: ["./dev/css"]
build:
options:
dumpLineNumbers: true
sourceMap: true
sourceMapRootpath: "/game-off-2013/"
files:
"./build/css/main.css": "./dev/css/main.less"
release:
options:
compress: true
cleancss: true
relativeUrls: true
files:
"./dist/css/main.css": "./dev/css/main.less"
browserify2:
build:
debug: true
entry: "./dev/js/main.js"
compile: "./build/js/main.js"
uglify:
options:
banner: "/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today('yyyy-mm-dd') %> */\n"
release:
src: "./build/js/main.js"
dest: "./dist/js/main.min.js"
copy:
build:
files: [
expand: true
cwd: "./dev/media/"
src: ["**/*.jpg","**/*.json","**/*.png","sounds/*.mp3","music/*.mp3","fonts/*","swf/*"]
dest: "./build/media/"
]
release:
files: [
expand: true
cwd: "./build/media/"
src: ["**/*.jpg","**/*.json","**/*.png","sounds/*.mp3","music/*.mp3","fonts/*","swf/*"]
dest: "./dist/media/"
]
libs:
files: [
expand: true
cwd: "./dev/js/lib/"
src: ["./soundmanager2-nodebug-jsmin.js", "./jquery.color-2.1.2.min.js", "./jquery-1.10.1.min.js"]
dest: "./build/js/"
]
libsrelease:
files: [
expand: true
cwd: "./dev/js/lib/"
src: ["./soundmanager2-nodebug-jsmin.js", "./jquery.color-2.1.2.min.js", "./jquery-1.10.1.min.js"]
dest: "./dist/js/"
]
clean:
build: ["./build/media"]
release: ["./dist"]
cleanlevel:
all:
src: ["./dev/media/data/levels/*.json"]
dest: "./build/media/data/levels"
watch:
build:
options:
livereload: true
files: ["./build/**"]
cleanlevel:
files: ["./dev/media/data/levels/*.json"]
tasks: ["cleanlevel"]
css:
files: ["./dev/css/**/*.less"]
tasks: ["less:build"]
jade:
files: ["./dev/*.jade"]
tasks: ["jade:build"]
js:
files: ["./dev/js/**/*.js"]
tasks: ["browserify2", "copy:libs"]
media:
files: ["./dev/media/**/*"]
tasks: ["copy:build", "cleanlevel:all"]
# jshint:
# compile: ["./dev/js/**/*.js"]
grunt.loadNpmTasks "grunt-contrib-less"
grunt.loadNpmTasks "grunt-contrib-jade"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-copy"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-browserify2"
# grunt.loadNpmTasks "grunt-contrib-jshint"
grunt.loadTasks "./tasks"
grunt.registerTask "release", ["clean:release", "jade:release", "less:release", "browserify2", "uglify", "copy:release", "copy:libsrelease", "cleanlevel:all"]
grunt.registerTask "default", ["clean:build", "jade:build", "less:build", "browserify2", "copy:build", "copy:libs", "cleanlevel:all"]