This repository has been archived by the owner on Mar 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 155
/
gruntfile.js
executable file
·121 lines (109 loc) · 3.07 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
var fs = require('fs');
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: [ 'gruntfile.js', 'terraformer.js' ],
options: {
node: true
}
},
uglify: {
options: {
report: 'gzip',
banner: '/*! Terraformer JS - <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* https://github.com/esri/Terraformer\n' +
'* Copyright (c) 2013-<%= grunt.template.today("yyyy") %> Environmental Systems Research Institute, Inc.\n' +
'* Licensed MIT */'
},
terraformer: {
src: ['terraformer.js'],
dest: 'terraformer.min.js'
},
versioned: {
src: ['terraformer.js'],
dest: 'terraformer-<%= pkg.version %>.min.js'
}
},
jasmine: {
coverage: {
src: [
"terraformer.js"
],
options: {
specs: 'spec/*Spec.js',
helpers: 'spec/*Helpers.js',
// not sure why coverage isnt being generated
// keepRunner: true,
// outfile: 'SpecRunner.html',
// template: require('grunt-template-jasmine-istanbul'),
// templateOptions: {
// coverage: './.coverage/coverage.json',
// report: './.coverage',
// thresholds: {
// lines: 90,
// statements: 90,
// branches: 90,
// functions: 90
// }
// }
}
}
},
complexity: {
generic: {
src: [ 'terraformer.js' ],
options: {
jsLintXML: 'complexity.xml', // create XML JSLint-like report
errorsOnly: false, // show only maintainability errors
cyclomatic: 6,
halstead: 15,
maintainability: 65
}
}
},
'gh-pages': {
options: {
base: 'docs-build',
repo: 'git@github.com:Esri/Terraformer.git',
branch: 'gh-pages'
},
src: ['**']
},
middleman: {
server: {
options: {
useBundle: true
}
},
build: {
options: {
useBundle: true,
server: false,
command: "build"
}
}
},
copy: {
main: {
files: [
// includes files within path and its sub-directories
{expand: true, src: ['examples/browser/**'], dest: 'docs-build/'}
],
},
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-complexity');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-middleman');
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('test', ['jasmine']);
grunt.registerTask('version', ['test', 'uglify']);
grunt.registerTask('default', ['test']);
grunt.registerTask('docs-build', ['middleman:build', 'copy']);
grunt.registerTask('deploy-docs', ['middleman:build', 'copy', 'gh-pages']);
};