This repository has been archived by the owner on Mar 11, 2022. It is now read-only.
forked from awslabs/amazon-kinesis-client-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
114 lines (100 loc) · 2.7 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
/***
Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Amazon Software License (the "License").
You may not use this file except in compliance with the License.
A copy of the License is located at
http://aws.amazon.com/asl/
or in the "license" file accompanying this file. This file is distributed
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing
permissions and limitations under the License.
***/
'use strict';
function mochaCoverageOptions(reporterName, outFile) {
return {
options: {
reporter: reporterName,
quiet: true,
captureFile: outFile
},
src: ['test/**/*_tests.js']
};
}
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: 'conf/.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
bin: {
src: ['bin/kcl-bootstrap']
},
lib: {
src: ['index.js', 'lib/**/*.js']
},
test: {
src: ['test/**/*.js']
},
samples: {
src: ['samples/**/*.js']
}
},
clean: {
build: {
options: {
force: true
},
src: ['build']
},
coverage: {
options: {
force: true
},
src: ['coverage']
},
doc: {
options: {
force: true
},
src: ['doc']
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
require: ['test/unit_tests_bootstrap'],
clearRequireCache: true
},
src: ['test/**/*_tests.js']
},
html: mochaCoverageOptions('html-cov', 'coverage/index.html'),
json: mochaCoverageOptions('json-cov', 'coverage/javascript.coverage.json'),
},
jsdoc : {
dist : {
src: ['index.js', 'lib/**/*.js', 'README.md'],
jsdoc: './node_modules/grunt-jsdoc/node_modules/jsdoc/jsdoc',
options: {
destination: 'doc',
configure: './conf/jsdoc.conf.json',
template: './node_modules/grunt-jsdoc/node_modules/ink-docstrap/template'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('default', ['jshint', 'mochaTest']);
grunt.registerTask('build', 'compile');
grunt.registerTask('compile', ['jshint']);
// clean task already defined above.
grunt.registerTask('doc', 'jsdoc');
grunt.registerTask('test', ['jshint', 'mochaTest']);
grunt.registerTask('release', ['jshint', 'mochaTest', 'jsdoc']);
};