forked from apache/wicket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
152 lines (139 loc) · 5.11 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
/*
* Grunt.js is a task runner for JavaScript development.
* Grunt and its plugins are installed and managed via npm, the Node.js package manager.
* http://gruntjs.com/
*
* To use it:
* 1) install node.js - http://nodejs.org/#download. This will install 'npm' (Node Package Manager) too.
* 3) run: npm install (This will use package.json and install grunt and all dependencies)
* 4.1) grunt jshint - checks all JavaScript files with JSHint
* 4.2) grunt jshint:core - checks only the files in wicket-core
* 4.3) grunt - starts the registered tasks: starting a web server and running all tests (Ajax, non-Ajax and AMD)
*/
/*global module: true */
module.exports = function(grunt) {
"use strict";
var
coreJs = [
'wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-event-jquery.js',
'wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery-debug.js',
'wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js',
"wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckSelector.js",
"wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/MultiFileUploadField.js",
"wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormChoiceComponentUpdatingBehavior.js",
"wicket-core/src/main/java/org/apache/wicket/markup/html/pages/wicket-browser-info.js"
],
extensionsJs = [
"wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js",
"wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/palette/palette.js",
"wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tree/res/tree.js",
"wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js",
"wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js",
"wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/wicket-filterform.js"
],
datetimeJs = [
"wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/wicket-date.js"
],
nativeWebSocketJs = [
"wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-jquery.js"
],
atmosphereJs = [
"wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/jquery.wicketatmosphere.js"
],
testsJs = [
"./wicket-core/src/test/js/ajax.js",
"./wicket-core/src/test/js/head.js",
"./wicket-core/src/test/js/form.js",
"./wicket-core/src/test/js/dom.js",
"./wicket-core/src/test/js/channels.js",
"./wicket-core/src/test/js/event.js",
"./wicket-core/src/test/js/amd.js"
],
gymTestsJs = [
"wicket-examples/src/main/webapp/js-test/tests/ajax/form.js",
"wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js",
"wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js",
"wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js",
"wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js",
"wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js",
"wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js",
"wicket-examples/src/main/webapp/js-test/tests/cdi/injection.js",
"wicket-examples/src/main/webapp/js-test/tests/echo.js",
"wicket-examples/src/main/webapp/js-test/tests/forminput.js",
"wicket-examples/src/main/webapp/js-test/tests/helloworld.js",
"wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js"
],
gruntJs = [
"Gruntfile.js"
];
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
core: coreJs,
extensions: extensionsJs,
datetime: datetimeJs,
nativeWebSocket: nativeWebSocketJs,
atmosphere: atmosphereJs,
testsJs: testsJs,
gymTestsJs: gymTestsJs,
grunt: gruntJs,
options: {
"boss": true,
"browser": true,
"curly": true,
"eqnull": true,
"eqeqeq": true,
"expr": true,
"evil": true,
"jquery": true,
"latedef": true,
"noarg": true,
"onevar": false,
"smarttabs": true,
"trailing": true,
"undef": true,
"strict": true,
"predef": [
"Wicket"
]
}
},
qunit: {
/*
* Runs all tests (w/ ajax).
* See ajax.js header for details how to setup it.
*/
all: {
options: {
urls: ['http://localhost:38888/test/js/all.html']
}
},
/**
* Run Asynchronous module definition tests
*/
amd: {
options: {
urls: ['http://localhost:38888/test/js/amd.html']
}
},
/*
* Runs only local tests (w/o ajax ones).
*/
local: ['wicket-core/src/test/js/all.html']
},
connect: {
server: {
options: {
port: 38888,
base: './wicket-core/src'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
// This plugin provides the "connect" task - starts a web server for the Ajax tests.
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default', ['jshint', 'connect', 'qunit']);
};