forked from paazmaya/grunt-togeojson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
95 lines (83 loc) · 1.87 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
/**
* grunt-togeojson
* https://github.com/paazmaya/grunt-togeojson
*
* Copyright (c) Juga Paazmaya <olavic@gmail.com>
* Licensed under the MIT license.
*/
'use strict';
module.exports = function gruntConf(grunt) {
require('time-grunt')(grunt); // Must be first item
// Project configuration.
grunt.initConfig({
eslint: {
options: {
config: '.eslintrc',
format: 'stylish'
},
target: [
'Gruntfile.js',
'karma.conf.js',
'tasks/*.js',
'<%= nodeunit.tests %>'
]
},
// Before generating any new files, remove any previously-created files.
clean: {
tests: ['tmp']
},
// Configuration to be run (and then tested).
togeojson: {
geojson: {
files: {
'tmp/Naginata.json': ['test/fixtures/Naginata.kml']
}
},
topojson: {
options: {
output: 'topojson'
},
files: {
'tmp/Naginata.topo': ['test/fixtures/Naginata.kml']
}
},
geobuf: {
options: {
compress: true
},
files: {
'tmp/Naginata.geobuf': ['test/fixtures/Naginata.kml']
}
},
geobuf_topo: {
options: {
compress: true,
output: 'topojson'
},
files: {
'tmp/Naginata.topo.geobuf': ['test/fixtures/Naginata.kml']
}
}
},
// Unit tests.
nodeunit: {
tests: ['test/*_test.js']
},
// Code coverage
karma: {
coverage: {
configFile: 'karma.conf.js'
}
},
// Coverage data to coveralls.io
coveralls: {
options: {
coverage_dir: 'coverage'
}
}
});
grunt.loadTasks('tasks');
require('jit-grunt')(grunt);
grunt.registerTask('test', ['clean', 'togeojson', 'nodeunit']);
grunt.registerTask('default', ['eslint', 'test', 'karma']);
};