-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
155 lines (141 loc) · 4.81 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
(function () {
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['Gruntfile.js', 'js/**/*.js', '!js/ext/**', '_tests/jasmine/spec/**/*.js'],
options: {
// stuff which makes linting more strict, most of which is just part of my style
curly: true,
eqeqeq: true,
freeze: true,
strict: true,
undef: true,
unused: true,
// stuff which makes linting less strict
//shadow: true, // I'm on the fence about this, I don't like when he complains about
// stuff like for(var i) and then later another for (var i)
// but I do want him to check other scope errors
// Decided to just add it to the code like /* jshint shadow:true */
// where appplicable
esversion: 8,
loopfunc: true, // we define functions as part of a promise chain in AudioManager.js:205,209
sub: true, // is deprecated, but I really like my bracket notation??
jasmine: true,
browser: true,
devel: true, // for console.log
globals: {
global: true, // our 'import/export' system
MainLoop: true, // see js/ext/mainloop
// JSZip
JSZip: true,
saveAs: true,
//
module: true // just for Gruntfile.js
}
}
},
jasmine: {
pivotal: {
// order is actually super important here so lets just do this kinda manually
// for now. Who cares
src: [
'js/global.js',
'js/config.js',
'js/tools/consts.js',
'js/tools/util.js',
'js/tools/draw.js',
'js/tools/collision.js',
'js/tools/resolution.js',
'js/tools/analytics.js',
'js/data/sprite-data.js',
'js/data/background-sky-data.js',
'js/data/background-data.js',
'js/data/chest-data.js',
'js/data/audio-data.js',
'js/data/audio-gui-data.js',
'js/data/menu-data.js',
'js/data/menu-text-data.js',
'js/data/torch-data.js',
'js/data/water-data.js',
'js/data/spike-data.js',
'js/data/raven-data.js',
'js/menus/LoadingBar.js',
'js/sprites/Sprite.js',
'js/sprites/ImageHandler.js',
'js/background/Background.js',
'js/menus/lib/Menu.js',
'js/menus/lib/ScrollableMenu.js',
'js/menus/StartMenu.js',
'js/menus/AboutMenu.js',
'js/menus/PauseMenu.js',
'js/menus/helpers/Popup.js',
'js/menus/NotificationMenu.js',
'js/menus/helpers/Checkbox.js',
'js/menus/helpers/Typebox.js',
'js/menus/helpers/Multibox.js',
'js/menus/SettingsMenu.js',
'js/menus/NameMenu.js',
'js/audio/helpers/Song.js',
'js/audio/helpers/AudioPlayer.js',
'js/audio/AudioGUI.js',
'js/audio/AudioManager.js',
'js/entities/lib/Entity.js',
'js/entities/lib/AnimatingEntity.js',
'js/entities/lib/MovingEntity.js',
'js/entities/Player.js',
'js/entities/Chest.js',
'js/entities/Torch.js',
'js/entities/Water.js',
'js/entities/Spikes.js',
'js/entities/Raven.js',
'js/entities/PlayerMouseAI.js',
'js/entities/managers/EntityManager.js',
'js/entities/managers/CollisionManager.js',
'js/tools/input.js',
'js/game.js',
'js/**/*.js' // if we forgot or add something lets hope it works in this order
],
options: {
//keepRunner: true, // this can be useful to check the console.logs
specs: '_tests/jasmine/spec/*Spec.js',
helpers: '_tests/jasmine/spec/*Helper.js'
}
}
},
uglify : {
minified: {
options: {
mangle: false, // keep variable names for console logs/debugging
banner: '/* Dream of songs v<%= pkg.version %> */',
sourceMap: true,
sourceMapName: 'dist/dreamofsongs.min.js.map'
},
files: {
'dist/dreamofsongs.min.js': ['<%= jasmine.pivotal.src %>']
}
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jasmine', 'jshint', 'uglify']
},
connect: {
server: {
options: {
port: 9001,
base: '../../',
keepalive: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default', ['jasmine', 'jshint', 'uglify']);
};
}());