-
Notifications
You must be signed in to change notification settings - Fork 34
/
Gruntfile.js
153 lines (137 loc) · 5.08 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
module.exports = function (grunt) {
var srcFiles = [
'src/utils/util.array.js',
'src/utils/util.string.js',
'src/utils/class.class.js',
'src/utils/class.map.js',
'src/utils/util.color.js',
'src/utils/math/class.vector2D.js',
'src/utils/class.region.js',
'src/constants.js',
'src/utils/class.traverser.js',
'src/utils/class.imgManager.js',
'src/event/class.event.js',
'src/event/class.eventmanager.js',
'src/theme/class.CSSManager.js',
'src/animation/class.keyframe.js',
'src/interpolator/class.interpolator.js',
'src/interpolator/class.interpolator.linear.js',
'src/interpolator/class.interpolator.TCB.js',
'src/animation/class.anim.timeline.js',
'src/animation/class.animmanager.js',
'src/collision/enum.collision.method.js',
'src/collision/class.collision.tester.region.js',
'src/collision/class.collision.tester.ghost.ondemand.js',
'src/collision/class.collision.tester.factory.js',
'src/collision/class.collision.manager.js',
'src/globals.js',
'src/utils/util.global.js',
'src/utils/util.color.js',
'src/mask/class.mask.js',
'src/mask/class.mask.clip.js',
'src/utils/math/math.js',
'src/utils/class.handlebox.js',
'src/node/class.node.js',
'src/node/class.node.dom.js',
'src/node/class.node.line.js',
'src/node/class.node.curveTCB.js',
'src/node/class.node.colorPicker.js',
'src/node/class.node.tabMenu.js',
'src/node/class.node.text.js',
'src/node/class.node.webview.js',
'src/node/class.node.square.js',
'src/node/class.node.slider.js',
'src/node/class.node.circle.js',
'src/node/class.node.ellipse.js',
'src/node/class.node.image.js',
'src/node/class.node.animatedSprite.js',
'src/node/class.node.button.js',
'src/node/class.particles.js',
'src/class.scenegraph.js',
'src/class.view.js'
];
var output = 'min/scenegraph_<%= pkg.version %>.js';
var outputMin = 'min/scenegraph_<%= pkg.version %>.min.js';
var outputMap = 'min/scenegraph_<%= pkg.version %>.map';
// Grunt configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: '',
// Replace all 'use strict' statements in the code with a single one at the top
banner: "'use strict';\n",
process: function (src, filepath) {
return '// Source: ' + filepath + '\n' +
src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
}
},
dist: {
src: srcFiles,
dest: output
}
},
uglify: {
options: {
separator: ';',
sourceMap: true,
sourceMapName: outputMap
},
min: {
src: [output],
dest: outputMin
}
},
yuidoc: {
compile: {
name: '<%= pkg.name %>',
description: '<%= pkg.description %>',
version: '<%= pkg.version %>',
url: '<%= pkg.homepage %>',
"logo": "../logo/logoCGSG_256x57.png",
"themedir": "./Medias/theme_yuidoc/defaulttheme.json",
"options": {
"linkNatives": "true",
"attributesEmit": "true",
"selleck": "false",
"paths": ["./src"],
"outdir": "./api/v<%= pkg.version %>",
"tabtospace": 4
}
}
},
jshint: {
options: {
curly: true,
eqeqeq: true,
browser: true,
strict: false,
expr: true,
evil: true,
noempty: false,
//reporter: require('jshint-stylish'),
reporterOutput: "./jshint.log"
},
ignore_warning: {
options: {
'-W015': true,
'-W030': true,
'-W083': true
},
src: srcFiles
}
}
});
// Load of plugins
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Tasks definition
grunt.registerTask('default', ['concat:dist', 'uglify:min', 'yuidoc:compile']);
grunt.registerTask('full', ['concat:dist', 'jshint', 'uglify:min', 'yuidoc:compile']);
grunt.task.registerTask('bowerRegister', 'Register this version to Bower.', function () {
//bower register SceneGraph.js git://github.com/GwennaelBuchet/SceneGraph.js.git
});
};
//bower register SceneGraph.js git://github.com/GwennaelBuchet/SceneGraph.js.git