This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Gruntfile.js
106 lines (94 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
/* Copyright (c) 2014 Intel Corporation. All rights reserved.
* Use of this source code is governed by an Apache v2 license that can be
* found in the LICENSE-APACHE-V2 file. */
var shell = require('shelljs');
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-mochaccino');
grunt.loadNpmTasks('grunt-release');
grunt.registerTask('copyDocs', function () {
if (shell.test('-d', 'build/docs-raw')) {
shell.rm('-r', 'build/docs-raw');
}
shell.mkdir('-p', 'build/docs-raw/tutorials');
// add links to HACKING.md in README.md so they point to
// the output HTML file
shell.cat('README.md')
.replace(/HACKING\.md/g, '[HACKING](tutorial-HACKING.html)')
.to('build/docs-raw/README.md');
// add links from HACKING.md to README.md
shell.cat('HACKING.md')
.replace(/README.md/g, '[README](index.html)')
.to('build/docs-raw/tutorials/HACKING.md');
});
grunt.initConfig({
jshint: {
all: {
files: {src: 'src/**/*.js' },
options: {
jshintrc: '.jshintrc'
}
}
},
jsdoc : {
all : {
src: [
'build/docs-raw/README.md',
'data/doc-tools/external-namespaces.js',
'src/app.js',
'src/app-skeleton.js',
'src/archive-fetcher.js',
'src/build-tools.js',
'src/command-runner.js',
'src/console-logger.js',
'src/downloader.js',
'src/env.js',
'src/finder.js',
'src/locations.js',
'src/unpacker.js',
'src/wrappers/aapt-wrapper.js',
'src/wrappers/dx-wrapper.js',
'src/wrappers/apk-gen-wrapper.js',
'src/wrappers/apk-sign-wrapper.js',
'src/wrappers/javac-wrapper.js'
],
options: {
destination: 'build/docs',
tutorials: 'build/docs-raw/tutorials'
}
}
},
mochaccino: {
cov: {
files: [
{ src: 'test/unit/*.test.js' }
],
reporter: 'html-cov',
reportDir: 'build'
},
unit: {
files: { src: 'test/unit/*.test.js' },
reporter: 'dot'
}
},
release: {
options: {
add: true,
commit: true,
push: true,
bump: true,
tag: true,
pushTags: true,
npm: true,
folder: '.',
tagName: '<%= version %>',
tagMessage: 'Version <%= version %>'
}
}
});
grunt.registerTask('cov', 'mochaccino:cov');
grunt.registerTask('test', 'mochaccino:unit');
grunt.registerTask('docs', ['copyDocs', 'jsdoc']);
grunt.registerTask('default', ['jshint', 'test']);
};