-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
127 lines (117 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
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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
options: {
paths: "src/css",
},
dev: {
files: {
"src/css/vde.css": "src/css/vde.less"
}
}
},
karma: {
unit: {
options: {
frameworks: ['jasmine'],
//All of the files that the app needs. The order is important --
//many files depend on others.
files: [
"src/js/lib/jquery.min-1.9.0.js",
"src/js/lib/**/jquery*.js",
"src/js/lib/bootstrap.min.js",
"src/js/lib/datatables/FixedColumns.js",
"src/js/lib/d3.v3.min.js",
"src/js/lib/vega-1.3.3.js",
"src/js/lib/angular-1.2.10.min.js",
"src/js/lib/angular-1.2.12-mocks.js",
"src/js/lib/bootstrap-colorpicker-module.js",
"src/js/lib/inflector.js",
"src/js/lib/sortable.js",
"src/js/lib/indexeddb.js",
"src/js/app/vde.js",
"src/js/app/**/*.js",
"src/js/vis/Vis.js",
"src/js/vis/iVis.js",
"src/js/vis/Callback.js",
"src/js/vis/Pipeline.js",
"src/js/vis/Field.js",
"src/js/vis/Mark.js",
"src/js/vis/marks/Group.js",
"src/js/vis/marks/Rect.js",
"src/js/vis/marks/Symbol.js",
"src/js/vis/marks/Arc.js",
"src/js/vis/marks/Line.js",
"src/js/vis/marks/Area.js",
"src/js/vis/marks/Text.js",
"src/js/vis/Scale.js",
"src/js/vis/Axis.js",
"src/js/vis/Transform.js",
"src/js/vis/transforms/**/*.js",
"tests/unit/**/*.js"
]
}
}
},
protractor: {
options: {
configFile: "tests.js", // Default config file
keepAlive: true, // If false, the grunt process stops when the test fails.
noColor: false, // If true, protractor will not use colors in its output.
args: {
// Arguments passed to the command
}
},
dev: {
options: {
configFile: "tests.js", // Target-specific config file
args: {} // Target-specific arguments
}
},
},
'http-server': {
dev: {
// the server root directory
root: "src",
port: 8080,
host: "localhost",
cache: 1,
showDir : true,
autoIndex: true,
defaultExt: "html",
// run in parallel with other tasks
runInBackground: true
},
'stay-open': {
root: "src",
port: 8080,
host: 'localhost',
cache: 1,
showDir: true,
autoIndex: true,
defaultExt: "html",
runInBackground: false
}
},
jshint: {
dev: {
src: ["src/js/app/*.js"]
}
},
githooks: {
all: {
'pre-commit': 'less'
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-protractor-runner');
grunt.loadNpmTasks('grunt-http-server');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-githooks');
grunt.registerTask('test', ['build', 'http-server:dev', 'protractor', 'jshint:dev', 'karma']);
grunt.registerTask('build', ['less']);
grunt.registerTask('serve', ['build', 'http-server:stay-open'])
};