forked from apache/usergrid-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
112 lines (111 loc) · 3.58 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
module.exports = function(grunt) {
var files = [
"lib/modules/util/Promise.js",
"lib/modules/util/lodash.js",
"lib/modules/UsergridEnums.js",
"lib/modules/util/UsergridHelpers.js",
"lib/modules/UsergridClient.js",
"lib/Usergrid.js",
"lib/modules/UsergridQuery.js",
"lib/modules/UsergridRequest.js",
"lib/modules/UsergridAuth.js",
"lib/modules/UsergridEntity.js",
"lib/modules/UsergridUser.js",
"lib/modules/UsergridResponse.js",
"lib/modules/UsergridAsset.js"
];
var banner = "/*! \n\
*Licensed to the Apache Software Foundation (ASF) under one\n\
*or more contributor license agreements. See the NOTICE file\n\
*distributed with this work for additional information\n\
*regarding copyright ownership. The ASF licenses this file\n\
*to you under the Apache License, Version 2.0 (the\n\
*\"License\"); you may not use this file except in compliance\n\
*with the License. You may obtain a copy of the License at\n\
*\n\
* http://www.apache.org/licenses/LICENSE-2.0\n\
* \n\
*Unless required by applicable law or agreed to in writing,\n\
*software distributed under the License is distributed on an\n\
*\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n\
*KIND, either express or implied. See the License for the\n\
*specific language governing permissions and limitations\n\
*under the License.\n\
* \n\
* \n\
* <%= meta.package.name %>@<%= meta.package.version %> <%= grunt.template.today('yyyy-mm-dd') %> \n\
*/\n";
// Project configuration.
grunt.initConfig({
"meta": { "package": grunt.file.readJSON("package.json") },
"clean": ["usergrid.js", "usergrid.min.js"],
"uglify": {
"unminified": {
"options": {
"banner": banner,
"mangle": false,
"beautify": true,
"compress": false,
"preserveComments": "some"
},
"files": { "usergrid.js": files }
},
"minified": {
"options": {
"banner": banner,
"mangle": false,
"beautify": false,
"compress": {},
"preserveComments": "some"
},
"files": { "usergrid.min.js": files }
}
},
"connect": {
"server": {
"options": {
"port": 3000,
"base": "."
}
},
"test": {
"options": {
"port": 8000,
"base": "."
}
}
},
"watch": {
"files": [files, 'Gruntfile.js'],
"tasks": ["default"]
},
"mocha": {
"test": {
"options": {
"urls": [ 'http://localhost:<%= connect.test.options.port %>/tests/mocha/index.html' ],
"reporter": "Spec",
"threshold": 70,
"run":true
}
}
}
});
grunt.loadNpmTasks("grunt-mocha");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("should");
grunt.registerTask("default", [
"clean",
"uglify"
]);
grunt.registerTask("dev", [
"connect:server",
"watch"
]);
grunt.registerTask("test", [
"connect:test",
"mocha:test"
]);
};