forked from Juniper/contrail-web-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
83 lines (77 loc) · 3.4 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
/*
* Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
*/
/*jshint node:true */
module.exports = function( grunt ) {
grunt.loadNpmTasks( "grunt-contrib-concat" );
grunt.loadNpmTasks('grunt-contrib-jshint');
var UI_THIRD_PARTY = './contrail-webui-third-party/';
function process( code ) {
return code
// Embed version
.replace( /@VERSION/g, grunt.config( "pkg" ).version )
// Embed date (yyyy-mm-ddThh:mmZ)
.replace( /@DATE/g, ( new Date() ).toISOString().replace( /:\d+\.\d+Z$/, "Z" ) );
}
grunt.initConfig({
pkg: grunt.file.readJSON( "package.json" ),
concat: {
"qunit-js": {
options: { process: process },
src: [
UI_THIRD_PARTY + "qunit/src/intro.js",
UI_THIRD_PARTY + "qunit/src/core.js",
UI_THIRD_PARTY + "qunit/src/test.js",
UI_THIRD_PARTY + "qunit/src/assert.js",
UI_THIRD_PARTY + "qunit/src/equiv.js",
UI_THIRD_PARTY + "qunit/src/dump.js",
UI_THIRD_PARTY + "qunit/src/diff.js",
UI_THIRD_PARTY + "qunit/src/export.js",
UI_THIRD_PARTY + "qunit/src/outro.js"
],
dest: "webroot/assets/qunit/qunit.js"
},
"qunit-css": {
options: { process: process },
src: [
UI_THIRD_PARTY + "qunit/src/qunit.css"
],
dest: "webroot/assets/qunit/qunit.css"
},
"sinon-js" : {
options: {process: process},
src: [
UI_THIRD_PARTY + "Sinon.JS/lib/sinon.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/spy.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/call.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/behavior.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/stub.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/mock.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/collection.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/assert.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/sandbox.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/test.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/test_case.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/assert.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/match.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/util/event.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/util/fake_timers.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/util/fake_server_with_clock.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/util/fake_xml_http_request.js",
UI_THIRD_PARTY + "Sinon.JS/lib/sinon/util/fake_server.js",
],
dest: "webroot/assets/sinon/sinon.js"
}
},
jshint: {
options: {
ignores: [
"../contrail-web-controller/node_modules/**/*.js",
]
},
all: ['../contrail-web-controller/**/js/*.js']
}
});
grunt.registerTask("build", ["concat"]);
grunt.registerTask("default", ["jshint", "build"]);
};