forked from omegaup/karel.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
76 lines (74 loc) · 1.76 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jison: {
karelPascal: {
options: {
moduleType: 'commonjs',
moduleName: 'karelpascal',
},
files: {
'js/karelpascal.js': 'gramaticas/karelpascal.jison',
}
},
karelJava: {
options: {
moduleType: 'commonjs',
moduleName: 'kareljava',
},
files: {
'js/kareljava.js': 'gramaticas/kareljava.jison',
}
},
karelRuby: {
options: {
moduleType: 'commonjs',
moduleName: 'karelruby',
},
files: {
'js/karelruby.js': 'gramaticas/karelruby.jison',
}
},
},
jshint: {
files: ['js/karel.js', 'js/karelide.js'],
options: {
undef: true,
unused: true,
trailing: true,
maxlen: 100,
quotmark: 'single',
noarg: true,
latedef: 'nofunc',
inmed: true,
forin: true,
browser: true,
devel: true,
node: true,
},
},
concat: {
dist: {
src: [
'js/codemirror-karelpascal.js',
'js/codemirror-karelruby.js',
'js/karelpascal.js',
'js/karelruby.js',
'js/karel.js',
'js/karelide.js'
],
dest: 'js/karel-distrib.js',
}
},
uglify: {
dist: {
files: {'js/karel-distrib.min.js': ['js/karel-distrib.js']},
},
},
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-jison');
grunt.registerTask('default', ['jison', 'jshint', 'concat', 'uglify']);
};