1 | module.exports = function (grunt) {
|
2 | 'use strict';
|
3 |
|
4 |
|
5 | require('time-grunt')(grunt);
|
6 |
|
7 |
|
8 | var configs = require('dalek-build-tools');
|
9 |
|
10 |
|
11 | grunt.initConfig({
|
12 |
|
13 |
|
14 | pkg: grunt.file.readJSON('package.json'),
|
15 |
|
16 |
|
17 | src: {
|
18 | lint: ['Gruntfile.js', 'index.js', 'lib/**/*.js', 'test/*.js'],
|
19 | complexity: ['index.js', 'lib/*.js', 'lib/comands/*.js'],
|
20 | test: ['test/*.js'],
|
21 | src: ['index.js', 'lib/**/*.js']
|
22 | },
|
23 |
|
24 |
|
25 | clean: configs.clean,
|
26 |
|
27 |
|
28 | concurrent: configs.concurrent,
|
29 |
|
30 |
|
31 | jshint: configs.jshint,
|
32 |
|
33 |
|
34 | mochaTest: configs.mocha,
|
35 |
|
36 |
|
37 | complexity: configs.complexity,
|
38 | plato: configs.plato(grunt.file.readJSON('.jshintrc')),
|
39 |
|
40 |
|
41 | yuidoc: configs.yuidocs(),
|
42 |
|
43 |
|
44 | documantix: {
|
45 | options: {
|
46 | header: 'dalekjs/dalekjs.com/master/assets/header.html',
|
47 | footer: 'dalekjs/dalekjs.com/master/assets/footer.html',
|
48 | target: 'report/docs',
|
49 | vars: {
|
50 | title: 'DalekJS - Documentation - Webdriver',
|
51 | desc: 'DalekJS - Documentation - Webdriver',
|
52 | docs: true
|
53 | }
|
54 | },
|
55 | src: ['index.js']
|
56 | },
|
57 |
|
58 |
|
59 | includereplace: {
|
60 | dist: {
|
61 | options: {
|
62 | globals: {
|
63 | timestamp: '<%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss TT") %>'
|
64 | },
|
65 | },
|
66 | src: 'report/docs/*.html',
|
67 | dest: './'
|
68 | }
|
69 | },
|
70 |
|
71 |
|
72 | bump: configs.bump({
|
73 | pushTo: 'git@github.com:dalekjs/dalek-internal-webdriver.git',
|
74 | files: ['package.json', 'CONTRIBUTORS.md', 'CHANGELOG.md']
|
75 | }),
|
76 |
|
77 |
|
78 | contributors: configs.contributors,
|
79 |
|
80 |
|
81 | compress: configs.compress,
|
82 |
|
83 |
|
84 |
|
85 | preparePlato: {
|
86 | options: {
|
87 | folders: [
|
88 | 'coverage',
|
89 | 'report',
|
90 | 'report/coverage',
|
91 | 'report/complexity',
|
92 | 'report/complexity/files',
|
93 | 'report/complexity/files/index_js',
|
94 | 'report/complexity/files/lib_driver_js',
|
95 | 'report/complexity/files/lib_webdriver_js',
|
96 | 'report/complexity/files/lib_commands_cookie_js',
|
97 | 'report/complexity/files/lib_commands_element_js',
|
98 | 'report/complexity/files/lib_commands_execute_js',
|
99 | 'report/complexity/files/lib_commands_frame_js',
|
100 | 'report/complexity/files/lib_commands_ime_js',
|
101 | 'report/complexity/files/lib_commands_interaction_js',
|
102 | 'report/complexity/files/lib_commands_page_js',
|
103 | 'report/complexity/files/lib_commands_screenshot_js',
|
104 | 'report/complexity/files/lib_commands_session_js',
|
105 | 'report/complexity/files/lib_commands_storage_js',
|
106 | 'report/complexity/files/lib_commands_timeout_js',
|
107 | 'report/complexity/files/lib_commands_url_js',
|
108 | 'report/complexity/files/lib_commands_window_js'
|
109 | ],
|
110 | files: [
|
111 | 'report.history.json',
|
112 | 'files/index_js/report.history.json',
|
113 | 'files/lib_driver_js/report.history.json',
|
114 | 'files/lib_webdriver_js/report.history.json',
|
115 | 'files/lib_commands_cookie_js/report.history.json',
|
116 | 'files/lib_commands_element_js/report.history.json',
|
117 | 'files/lib_commands_execute_js/report.history.json',
|
118 | 'files/lib_commands_frame_js/report.history.json',
|
119 | 'files/lib_commands_ime_js/report.history.json',
|
120 | 'files/lib_commands_interaction_js/report.history.json',
|
121 | 'files/lib_commands_page_js/report.history.json',
|
122 | 'files/lib_commands_screenshot_js/report.history.json',
|
123 | 'files/lib_commands_session_js/report.history.json',
|
124 | 'files/lib_commands_storage_js/report.history.json',
|
125 | 'files/lib_commands_timeout_js/report.history.json',
|
126 | 'files/lib_commands_url_js/report.history.json',
|
127 | 'files/lib_commands_window_js/report.history.json'
|
128 | ]
|
129 | }
|
130 | },
|
131 |
|
132 |
|
133 | prepareCoverage: {
|
134 | options: {
|
135 | folders: ['coverage', 'report', 'report/coverage'],
|
136 | pattern: '[require("fs").realpathSync(__dirname + "/../index.js"), require("fs").realpathSync(__dirname + "/../lib/")]'
|
137 | }
|
138 | },
|
139 |
|
140 |
|
141 |
|
142 | 'release-canary': {
|
143 | options: {
|
144 | files: ['index.js']
|
145 | }
|
146 | },
|
147 |
|
148 |
|
149 | archive: {
|
150 | options: {
|
151 | file: 'webdriver.html'
|
152 | }
|
153 | }
|
154 |
|
155 | });
|
156 |
|
157 |
|
158 | require('load-grunt-tasks')(grunt);
|
159 | grunt.loadTasks('./node_modules/dalek-build-tools/tasks');
|
160 |
|
161 |
|
162 | grunt.registerTask('lint', 'jshint');
|
163 |
|
164 |
|
165 | grunt.registerTask('test', ['clean:coverage', 'prepareCoverage', 'concurrent:test', 'generateCoverageBadge']);
|
166 | grunt.registerTask('docs', ['clean:reportZip', 'clean:report', 'preparePlato', 'documantix', 'includereplace', 'concurrent:docs', 'compress']);
|
167 |
|
168 |
|
169 | grunt.registerTask('releasePatch', ['test', 'bump-only:patch', 'contributors', 'changelog', 'bump-commit']);
|
170 | grunt.registerTask('releaseMinor', ['test', 'bump-only:minor', 'contributors', 'changelog', 'bump-commit']);
|
171 | grunt.registerTask('releaseMajor', ['test', 'bump-only:major', 'contributors', 'changelog', 'bump-commit']);
|
172 |
|
173 |
|
174 | grunt.registerTask('all', ['clean', 'test', 'docs']);
|
175 |
|
176 | }; |
\ | No newline at end of file |