forked from curiousdannii/parchment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
178 lines (165 loc) · 4.15 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
module.exports = function( grunt )
{
"use strict";
/* jshint -W070 */ // Allow trailing commas only in the Gruntfile
grunt.initConfig({
concat: {
options: {
process: true,
},
all: {
files: {
'lib/parchment.debug.js': [
'src/parchment/header.txt',
'src/lib/class.js',
'src/lib/iff.js',
'src/structio/intro.js',
'src/structio/input.js',
'src/structio/textgrid.js',
'src/structio/api.js',
'src/structio/outro.js',
'src/structio/runner.js',
'src/parchment/intro.js',
'src/parchment/error-handling.js',
'src/parchment/file.js',
'src/parchment/ui.js',
'src/parchment/library.js',
'src/parchment/quixe.js',
'src/parchment/ifvms.js',
'src/parchment/gnusto.js',
'src/parchment/outro.js',
'src/parchment/quixe-runner.js',
],
'lib/parchment.debug.css': [
'src/parchment/header.txt',
'src/parchment/parchment.css',
'src/structio/structio.css',
'src/ifvms.js/dist/zvm.css',
],
'lib/gnusto.debug.js': [
'src/gnusto/header.txt',
'src/ifvms.js/src/zvm/quetzal.js',
'src/gnusto/remedial.js',
'src/gnusto/engine/gnusto-engine.js',
'src/ifvms.js/src/zvm/ui.js',
'src/gnusto/runner.js',
],
'lib/quixe.min.js': [
'src/quixe/lib/quixe.min.js',
],
'lib/glkote.min.js': [
'src/quixe/lib/glkote.min.js',
],
'lib/glkote.debug.css': [
'src/quixe/media/i7-glkote.css',
'src/quixe/media/dialog.css',
],
'.build/(manifest).txt': [
'src/parchment/(manifest).txt'
],
},
},
},
cssmin: {
parchment: {
options: {
banner: grunt.file.read( "src/parchment/header.txt" ),
},
files: {
'lib/parchment.min.css': [ 'lib/parchment.debug.css' ],
},
},
glkote: {
files: {
'lib/glkote.min.css': [ 'lib/glkote.debug.css' ],
},
},
},
jshint: {
options: {
// Enforcing options
curly: true, // Require brackets for all blocks
eqeqeq: true, // Require === and !==
latedef: true, // require all vars to be defined before being used
newcap: true, // require classes to begin with a capital
strict: true, // ES5 strict mode
undef: true, // all vars must be defined
unused: true, // warn for unused vars
// Relaxing options
boss: true, // Allow assignments in if, return etc
evil: true, // eval() :)
funcscope: true, // don't complain about using variables defined inside if statements
// Environment
browser: true,
node: true,
nonstandard: true,
predef: [
'DEBUG',
],
},
all: [
'Gruntfile.js'
],
},
uglify: {
options: {
beautify: {
ascii_only: true,
},
compress: {
global_defs: {
DEBUG: false,
},
},
mangle: {
'eval': true,
},
preserveComments: function( node, token ) { return (/Built/).test( token.value ); },
report: false,
},
parchment: {
files: {
'lib/parchment.min.js': [ 'lib/parchment.debug.js' ],
'lib/gnusto.min.js': [ 'lib/gnusto.debug.js' ],
},
},
zvm: {
options: {
compress: {
global_defs: {
DEBUG: false,
ZVM: true,
GVM: false,
},
},
},
files: {
'lib/zvm.min.js': [ 'lib/zvm.debug.js' ],
}
},
},
zip: {
inform7: {
compression: 'DEFLATE',
dest: 'lib/parchment-for-inform7.zip',
src: [
'lib/jquery.min.js',
'lib/parchment.min.css',
'lib/parchment.min.js',
'lib/zvm.min.js',
'.build/(manifest).txt',
],
router: function( path ) { return 'Parchment/' + require( 'path' ).basename( path ); },
},
},
});
grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-update-submodules' );
grunt.loadNpmTasks( 'grunt-zip' );
grunt.registerTask( 'default', [ 'update_submodules', 'parchment', 'inform7' ] );
grunt.registerTask( 'inform7', [ 'zip' ] );
grunt.registerTask( 'parchment', [ 'concat', 'jshint', 'cssmin', 'uglify' ] );
};