forked from chandlerprall/GoblinPhysics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
99 lines (93 loc) · 2.23 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
/*global module:false require:false*/
var fs = require( 'fs' );
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
license: fs.readFileSync( 'LICENSE' ).toString(),
banner: '/*\n' +
'<%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>\n\n' +
'<%= meta.license %>\n' +
'*/'
},
lint: {
files: ['grunt.js', 'src/classes/**/*.js', 'test/**/*.js']
},
test: {
files: ['test/**/*.js']
},
concat: {
dist: {
src: [
'<banner:meta.banner>',
'src/intro.js',
'src/classes/**/*.js',
'src/outro.js'
],
dest: 'build/goblin.js'
}
},
min: {
build: {
src: ['<banner:meta.banner>', '<config:concat.build.dest>'],
dest: 'build/<%= pkg.name %>.min.js'
}
},
watch: {
files: '<config:lint.files>',
tasks: 'lint test'
},
jshint: {
options: {
browser: true,
curly: true,
eqeqeq: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
smarttabs: true,
globals: {
'vec3': false,
'quat4': true,
'mat4': false,
'mat3': false,
'Goblin': true,
'_tmp_vec3_1': true,
'_tmp_vec3_2': true,
'_tmp_vec3_3': true,
'_tmp_quat4_1': true,
'_tmp_mat3_1': true,
'_tmp_mat3_2': true
}
},
beforeconcat: ['grunt.js', 'src/classes/**/*.js', 'test/**/*.js']
},
yuidoc: {
compile: {
name: '<%= pkg.title %>',
description: '<%= pkg.description %>',
version: '<%= pkg.version %>',
url: '',
options: {
paths: 'src',
outdir: 'docs'
}
}
}
});
// Default task.
grunt.registerTask('default', ['jshint', 'concat']);
// Build documentation
grunt.registerTask('docs', 'yuidoc');
};