forked from hugoruscitti/pilasweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
93 lines (84 loc) · 2.45 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
var shell = require('shelljs');
module.exports = function(grunt) {
grunt.initConfig({
qunit: {
files: ['tests/index.html']
},
concat: {
options: {
separator: ';',
},
dist: {
src: [
'vendor/copyright.js',
'vendor/PxLoader.js',
'vendor/PxLoaderImage.js',
'vendor/Box2dWeb-2.1.a.3.js',
'vendor/traits.js',
'vendor/preloadjs-0.4.1.min.js',
'vendor/soundjs-0.5.2.min.js',
'vendor/easeljs-0.7.1.min.js',
'vendor/tweenjs-0.5.1.min.js',
'vendor/uuid.js',
'vendor/rsvp-latest.js',
'tmp/pilasweb.js',
],
dest: 'dist/pilasweb.js',
},
},
typescript: {
base: {
src: ['src/**/*.ts'],
dest: 'tmp/pilasweb.js',
options: {
module: 'commonjs',
target: 'es5',
sourceMap: false,
fullSourceMapPath: false,
declaration: true,
comments: true,
}
}
},
copy: {
main: {
src: 'tmp/pilasweb.d.ts',
dest: 'dist/pilasweb.d.ts',
},
documentacion_html: {
src: 'docs/build/html/**',
dest: 'ide/docs/',
},
},
watch: {
scripts: {
files: ['src/**', 'tests/**'],
tasks: ['clear', 'typescript', 'concat', 'copy'],
},
test: {
files: ['src/**', 'tests/**'],
tasks: ['clear', 'typescript', 'concat', 'copy', 'qunit'],
},
},
});
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('tags', ['tags']);
grunt.registerTask('test', ['test']);
grunt.registerTask('clear', ['clear']);
grunt.registerTask('clear', "limpia la pantalla", function() {
shell.exec('clear');
});
grunt.registerTask('generar_docs', "create documentation files", function() {
shell.exec('git submodule update --init');
});
grunt.registerTask('make_docs', "create documentation files", function() {
shell.exec('jsduck public/pilasweb.js --title="pilas-engine web" --images=docs/images/ -o docs/html');
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.registerTask('docs', ['typescript', 'concat', 'make_docs']);
grunt.registerTask('default', ['typescript', 'concat', 'copy']);
grunt.registerTask('test', 'qunit');
};