-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
124 lines (119 loc) · 2.93 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
/*
* Copyright 2013 The Polymer Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
module.exports = function(grunt) {
var sources = grunt.file.readJSON ('build.json');
// create core file list for debuging
// Its include the profiling code
var core_debug = sources.core.slice (0, sources.core.length - 1);
core_debug = core_debug.concat (sources.profiling);
core_debug.push (sources.core [sources.core.length - 1]);
grunt.initConfig({
concat: {
options: {
separator: '\n'
},
core: {
src: sources.core,
dest: 'lib/core.js'
},
core_release: {
src: sources.core,
dest: 'lib/core.js'
},
core_debug: {
src: core_debug,
dest: 'lib/core.js'
},
util: {
src: sources.util,
dest: 'lib/util.js'
},
class: {
src: sources.class,
dest: 'lib/class.js'
},
webcomponent: {
src: sources.webcomponent,
dest: 'lib/webcomponent.js'
},
recognizers: {
src: sources.recognizers,
dest: 'lib/recognizers.js'
},
widgets: {
src: sources.widget,
dest: 'lib/widgets.js'
}
},
copy: {
platform: {
src: 'bower_components/CustomElements/platform.js',
dest: 'lib/custom_elements.js'
},
requirejs: {
src: 'bower_components/requirejs/require.js',
dest: 'lib/require.js'
},
customElements: {
flatten: true,
expand: true,
src: ['src/glengine.html', 'src/recognizers/recognizers.html', 'src/widget/widgets.html'],
dest: 'lib/'
},
demosLib: {
expand: true,
flatten: true,
cwd: 'lib/',
src: '**',
dest: 'demos/lib/'
},
tests: {
flatten: false,
expand: true,
cwd: 'tests/gui',
src: '**',
dest: 'tests/temp/gui'
}
},
clean: {
tests: ["tests/temp"]
},
shell: {
tests: {
command: 'open -a Safari http://localhost:8000/tests/temp/gui/index.html'
}
}
});
// plugins
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-closure-tools');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-shell');
//grunt.loadNpmTasks('grunt-contrib-uglify');
//grunt.loadNpmTasks('grunt-contrib-yuidoc');
// tasks
grunt.registerTask('default', [
'concat:core_debug',
'concat:util',
'concat:class',
'concat:webcomponent',
'concat:recognizers',
'concat:widgets',
'copy:platform',
'copy:customElements',
'copy:requirejs',
'copy:demosLib'
]);
// tasks
grunt.registerTask('tests', [
'default',
'clean:tests',
'copy:tests',
'shell:tests',
]);
};