-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathGruntfile.js
More file actions
158 lines (142 loc) · 7.37 KB
/
Gruntfile.js
File metadata and controls
158 lines (142 loc) · 7.37 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';{}' // hack that 'works' for both JavaScript and CSS.
}
},
copy: {
bsim: {src: 'bsim/bsim.html', dest: 'build/bsim.html'},
bsim_edx: {src: 'bsim/bsim_edx.html', dest: 'build/bsim_edx.html'},
bsim_edx_deploy: {src: 'build/bsim_edx*', dest: '../6.004_mitx/static/labs/', flatten: true, expand: true },
bsim_6004: {src: 'bsim/bsim_workbook.html', dest: 'build/bsim_workbook.html'},
bsim_6004_deploy: {src: ['build/bsim_workbook*','build/glyphicons*'], dest: '../6.004_server/labs/tools/', flatten: true, expand: true },
bsim_workbook: {src: 'bsim/bsim_workbook.html', dest: 'build/bsim_workbook.html'},
bsim_workbook_deploy: {src: ['build/bsim_workbook*','build/glyphicons*'], dest: '../6004x.github.io/tools/', flatten: true, expand: true },
bsim_standalone: {src: 'bsim/bsim_standalone.html', dest: 'build/bsim_standalone.html'},
tmsim: {src: 'tmsim/tmsim.html', dest: 'build/tmsim.html'},
tmsim_edx: {src: 'tmsim/tmsim_edx.html', dest: 'build/tmsim_edx.html'},
tmsim_edx_deploy: {src: ['build/tmsim_edx*','build/glyphicons*'], dest: '../6.004_mitx/static/labs/', flatten: true, expand: true },
tmsim_6004: {src: 'tmsim/tmsim_6004.html', dest: 'build/tmsim_6004.html'},
tmsim_6004_deploy: {src: ['build/tmsim_6004*','build/glyphicons*'], dest: '../6.004_labs/ssldocs/coursewarex/', flatten: true, expand: true },
tmsim_workbook: {src: 'tmsim/tmsim_workbook.html', dest: 'build/tmsim_workbook.html'},
tmsim_workbook_deploy: {src: ['build/tmsim_workbook*','build/glyphicons*'], dest: '../6.004_server/labs/tools/', flatten: true, expand: true },
jsim: {src: ['jsim/jsim.html', 'jsim/*.png'], dest: 'build/', flatten: true, expand: true},
resources: {src: 'libs/*.png', dest: 'build/', flatten: true, expand: true}
},
uglify: {
options: {
beautify: {
ascii_only: true, // This prevents us screwing up on servers that don't sent correct content headers.
beautify: false
}
}
},
useminPrepare: {
bsim: 'bsim/bsim.html',
bsim_edx: 'bsim/bsim_edx.html',
bsim_6004: 'bsim/bsim_workbook.html',
bsim_workbook: 'bsim/bsim_workbook.html',
bsim_standalone: 'bsim/bsim_standalone.html',
jsim: 'jsim/jsim.html',
tmsim: 'tmsim/tmsim.html',
tmsim_edx: 'tmsim/tmsim_edx.html',
tmsim_6004: 'tmsim/tmsim_6004.html',
tmsim_workbook: 'tmsim/tmsim_workbook.html',
options: {
dest: 'build'
}
},
usemin: {
bsim: {
src: 'build/bsim.html',
options: {type: 'html'}
},
bsim_edx: {
src: 'build/bsim_edx.html',
options: {type: 'html'}
},
bsim_6004: {
src: 'build/bsim_workbook.html',
options: {type: 'html'}
},
bsim_workbook: {
src: 'build/bsim_workbook.html',
options: {type: 'html'}
},
bsim_standalone: {
src: 'build/bsim_standalone.html',
options: {type: 'html'}
},
jsim: {
src: 'build/jsim.html',
options: {type: 'html'}
},
tmsim: {
src: 'build/tmsim.html',
options: {type: 'html'}
},
tmsim_edx: {
src: 'build/tmsim_edx.html',
options: {type: 'html'}
},
tmsim_6004: {
src: 'build/tmsim_6004.html',
options: {type: 'html'}
},
tmsim_workbook: {
src: 'build/tmsim_workbook.html',
options: {type: 'html'}
},
options: {
dirs: ['build']
}
},
connect: {
server: {
options: {
port: '?',
base: '.'
}
}
},
qunit: {
all: {
options: {
urls: [
'http://<%= connect.server.options.host %>:<%= connect.server.options.port %>/test/all.html'
]
}
}
}
});
grunt.loadNpmTasks('grunt-usemin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('bsim', ['copy:resources', 'copy:bsim', 'useminPrepare:bsim', 'concat', 'uglify', 'cssmin', 'usemin:bsim']);
grunt.registerTask('bsim_edx', ['copy:resources', 'copy:bsim_edx', 'useminPrepare:bsim_edx', 'concat', 'uglify', 'cssmin', 'usemin:bsim_edx', 'copy:bsim_edx_deploy']);
//grunt.registerTask('bsim_6004', ['copy:resources', 'copy:bsim_6004', 'useminPrepare:bsim_6004', 'concat', 'uglify', 'cssmin', 'usemin:bsim_6004', 'copy:bsim_6004_deploy']);
grunt.registerTask('bsim_6004', ['copy:resources', 'copy:bsim_workbook', 'useminPrepare:bsim_workbook', 'concat', 'uglify', 'cssmin', 'usemin:bsim_workbook', 'copy:bsim_6004_deploy']);
grunt.registerTask('bsim_workbook', ['copy:resources', 'copy:bsim_workbook', 'useminPrepare:bsim_workbook', 'concat', 'uglify', 'cssmin', 'usemin:bsim_workbook', 'copy:bsim_workbook_deploy']);
grunt.registerTask('bsim_standalone', ['copy:resources', 'copy:bsim_standalone', 'useminPrepare:bsim_standalone', 'concat', 'uglify', 'cssmin', 'usemin:bsim_standalone']);
grunt.registerTask('tmsim', ['copy:resources', 'copy:tmsim', 'useminPrepare:tmsim', 'concat', 'uglify', 'cssmin', 'usemin:tmsim']);
grunt.registerTask('tmsim_edx', ['copy:resources', 'copy:tmsim_edx', 'useminPrepare:tmsim_edx', 'concat', 'uglify', 'cssmin', 'usemin:tmsim_edx', 'copy:tmsim_edx_deploy']);
grunt.registerTask('tmsim_6004', ['copy:resources', 'copy:tmsim_6004', 'useminPrepare:tmsim_6004', 'concat', 'uglify', 'cssmin', 'usemin:tmsim_6004', 'copy:tmsim_6004_deploy']);
grunt.registerTask('tmsim_workbook', ['copy:resources', 'copy:tmsim_workbook', 'useminPrepare:tmsim_workbook', 'concat', 'uglify', 'cssmin', 'usemin:tmsim_workbook', 'copy:tmsim_workbook_deploy']);
grunt.registerTask('jsim', ['copy:resources', 'copy:jsim', 'useminPrepare:jsim', 'concat', 'uglify', 'cssmin', 'usemin:jsim']);
grunt.registerTask('deploy', ['copy:deploy']);
grunt.registerTask('xblock', ['copy:xblock']);
grunt.registerTask('cs', ['copy:cs']);
grunt.registerTask('6.004', ['bsim_6004','tmsim_6004']);
grunt.registerTask('workbook', ['bsim_workbook','tmsim_workbook']);
grunt.registerTask('edx', ['bsim_edx','tmsim_edx']);
//grunt.registerTask('test', ['connect', 'qunit:all'])
// Builds everything if just called as 'grunt'
grunt.registerTask('default', ['bsim','jsim','tmsim']);
}