forked from handsontable/handsontable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
184 lines (172 loc) · 5.04 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/**
* This file is used to build Handsontable from `src/*`
*
* Installation:
* 1. Install Grunt CLI (`npm install -g grunt-cli`)
* 1. Install Grunt 0.4.0 and other dependencies (`npm install`)
*
* Build:
* Execute `grunt` from root directory of this directory (where Gruntfile.js is)
* To execute automatically after each change, execute `grunt --force default watch`
* To execute build followed by the test run, execute `grunt test`
*
* Result:
* building Handsontable will create files:
* - jquery.handsontable.js
* - jquery.handsontable.css
* - dist/jquery.handsontable.full.js
* - dist/jquery.handsontable.full.css
*
* See http://gruntjs.com/getting-started for more information about Grunt
*/
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
src: [
'tmp/core.js',
'src/focusCatcher.js',
'src/tableView.js',
'src/helpers.js',
'src/fillHandle.js',
'src/undoRedo.js',
'src/selectionPoint.js',
'src/renderers/textRenderer.js',
'src/renderers/autocompleteRenderer.js',
'src/renderers/checkboxRenderer.js',
'src/renderers/numericRenderer.js',
'src/editors/textEditor.js',
'src/editors/autocompleteEditor.js',
'src/editors/checkboxEditor.js',
'src/editors/dateEditor.js',
'src/editors/handsontableEditor.js',
'src/cellTypes.js',
'src/pluginHooks.js',
'src/plugins/autoColumnSize.js',
'src/plugins/columnSorting.js',
'src/plugins/contextMenu.js',
'src/plugins/legacy.js',
'src/plugins/manualColumnMove.js',
'src/plugins/manualColumnResize.js',
'src/3rdparty/jquery.autoresize.js',
'src/3rdparty/sheetclip.js',
'src/3rdparty/copypaste.js'
],
walkontable: [
'src/3rdparty/walkontable/src/*.js',
'src/3rdparty/walkontable/src/3rdparty/*.js'
],
vendor: [
'lib/bootstrap-typeahead.js',
'lib/numeral.js',
'lib/jQuery-contextMenu/jquery.contextMenu.js'
// seems to have no effect when turned off on contextmenu.html
//'lib/jQuery-contextMenu/jquery.ui.position.js'
]
},
concat: {
dist: {
files: {
'jquery.handsontable.js': [
'tmp/intro.js',
'<%= meta.src %>',
'<%= meta.walkontable %>',
'src/outro.js'
]
}
},
full_js: {
files: {
'dist/jquery.handsontable.full.js': [
'jquery.handsontable.js',
'<%= meta.vendor %>'
]
}
},
full_css: {
files: {
'dist/jquery.handsontable.full.css': [
'jquery.handsontable.css',
'lib/jQuery-contextMenu/jquery.contextMenu.css'
]
}
}
},
watch: {
files: [
'src/**/*.js',
'src/**/*.css',
'lib/**/*.js',
'lib/**/*.css'
],
tasks: ['replace', 'concat', 'clean']
},
clean: {
dist: ['tmp']
},
replace: {
dist: {
options: {
variables: {
version: '<%= pkg.version %>',
timestamp: '<%= (new Date()).toString() %>'
}
},
files: {
'tmp/intro.js': 'src/intro.js',
'tmp/core.js': 'src/core.js',
'jquery.handsontable.css': 'src/css/jquery.handsontable.css'
}
}
},
jasmine: {
handsontable: {
src: [
'lib/jquery.min.js',
'jquery.handsontable.js',
'lib/bootstrap-typeahead.js',
'lib/numeral.js',
'lib/jQuery-contextMenu/jquery.contextMenu.js',
'test/jasmine/spec/SpecHelper.js'
],
options: {
specs: [
'test/jasmine/spec/*Spec.js',
'test/jasmine/spec/*/*Spec.js'
],
styles: [
'test/jasmine/css/SpecRunner.css',
'jquery.handsontable.css',
'lib/jQuery-contextMenu/jquery.contextMenu.css'
]
}
},
walkontable: {
src: [
'lib/jquery.min.js',
'src/3rdparty/walkontable/src/*.js',
'src/3rdparty/walkontable/src/3rdparty/*.js',
'src/3rdparty/walkontable/test/jasmine/SpecHelper.js'
],
options: {
specs: [
'src/3rdparty/walkontable/test/jasmine/spec/*.spec.js'
],
styles: [
'src/3rdparty/walkontable/css/walkontable.css'
]
}
}
}
});
// Default task.
grunt.registerTask('default', ['replace', 'concat', 'clean']);
grunt.registerTask('test', ['default', 'jasmine']);
grunt.registerTask('test:handsontable', ['default', 'jasmine:handsontable']);
grunt.registerTask('test:walkontable', ['default', 'jasmine:walkontable']);
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jasmine');
};