diff --git a/Gruntfile.js b/Gruntfile.js index 84ae7808b861..58a967907495 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -174,10 +174,47 @@ module.exports = function (grunt) { }, }, }, + + parallel: { + 'write-out-wpt-cts-html-all': { + options: { grunt: true }, + tasks: [ + 'run:write-out-wpt-cts-html', + 'run:write-out-wpt-cts-html-chunked2sec', + ], + }, + 'all-builds': { + options: { grunt: true }, + tasks: [ + 'build-standalone', + 'build-wpt', + 'run:build-out-node', + ], + }, + 'all-checks': { + options: { grunt: true }, + tasks: [ + 'ts:check', + 'run:validate', + 'run:validate-cache', + 'run:unittest', + 'run:lint', + 'run:tsdoc-treatWarningsAsErrors', + ], + }, + 'all-builds-and-checks': { + options: { grunt: true }, + tasks: [ + 'build-all', // Internally parallel + 'parallel:all-checks', + ], + }, + }, }); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-parallel'); grunt.loadNpmTasks('grunt-run'); grunt.loadNpmTasks('grunt-ts'); @@ -202,14 +239,20 @@ module.exports = function (grunt) { grunt.registerTask('build-wpt', 'Build out-wpt/ (no checks; run after generate-common)', [ 'run:build-out-wpt', 'run:copy-assets-wpt', - 'run:autoformat-out-wpt', 'copy:gen-to-out-wpt', 'copy:htmlfiles-to-out-wpt', - 'run:write-out-wpt-cts-html', - 'run:write-out-wpt-cts-html-chunked2sec', + 'parallel:write-out-wpt-cts-html-all', + 'run:autoformat-out-wpt', + ]); + grunt.registerTask('build-all', 'Build out*/ (no checks; run after generate-common)', [ + 'parallel:all-builds', + 'build-done-message', ]); grunt.registerTask('build-done-message', () => { - process.stderr.write('\nBuild completed! Running checks/tests'); + grunt.log.writeln(`\ +===================================================== +==== Build completed! Continuing checks/tests... ==== +=====================================================`); }); grunt.registerTask('pre', ['all']); @@ -217,12 +260,7 @@ module.exports = function (grunt) { registerTaskAndAddToHelp('all', 'Run all builds and checks', [ 'clean', 'generate-common', - // None of the steps below have interdependencies. - 'build-standalone', - 'build-wpt', - 'run:build-out-node', - 'build-done-message', - 'checks', + 'parallel:all-builds-and-checks', ]); registerTaskAndAddToHelp('standalone', 'Build standalone (out/) (no checks)', [ 'generate-common', @@ -235,12 +273,7 @@ module.exports = function (grunt) { 'build-done-message', ]); registerTaskAndAddToHelp('checks', 'Run all checks (and build tsdoc)', [ - 'ts:check', - 'run:validate', - 'run:validate-cache', - 'run:unittest', - 'run:lint', - 'run:tsdoc-treatWarningsAsErrors', + 'parallel:all-checks', ]); registerTaskAndAddToHelp('unittest', 'Just run unittests', [ 'run:unittest', diff --git a/package-lock.json b/package-lock.json index 361ee369cd22..37e22310c6e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,6 +39,7 @@ "grunt-cli": "^1.4.3", "grunt-contrib-clean": "^2.0.1", "grunt-contrib-copy": "^1.0.0", + "grunt-parallel": "^0.5.1", "grunt-run": "^0.8.1", "grunt-timer": "^0.6.0", "grunt-ts": "^6.0.0-beta.22", @@ -4857,6 +4858,22 @@ "node": ">=10" } }, + "node_modules/grunt-parallel": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/grunt-parallel/-/grunt-parallel-0.5.1.tgz", + "integrity": "sha512-Daa6XgRpjzkZ2F+xDOW9aTxMIpi5Y8jwUhG2x0AItW1Dd7IW2rVmA/pfTIvOw8vYhp3iGOW9lBCnS/ihQbl2+Q==", + "dev": true, + "dependencies": { + "lpad": "~0.1.0", + "q": "~0.8.12" + }, + "engines": { + "node": "*" + }, + "peerDependencies": { + "grunt": ">=0.4.0" + } + }, "node_modules/grunt-run": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/grunt-run/-/grunt-run-0.8.1.tgz", @@ -6992,6 +7009,15 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "node_modules/lpad": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lpad/-/lpad-0.1.0.tgz", + "integrity": "sha512-Iuj1jLmrxOseShxLayj8ODB1rmAncUDwR1KCgOMGLpAxC0a3qqEo/xDeJclC7Gzi34pZUYGBLFJ4zTNjV7WWYQ==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -8176,6 +8202,16 @@ "node": ">=6" } }, + "node_modules/q": { + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/q/-/q-0.8.12.tgz", + "integrity": "sha512-mvLmeFP7lwVSFzDhpVhkI9Jw3u9goGQ2IY9nbSNMA4OZyviFjs2XILKMesUz8nBz4deKS9eWibvEuBNlRxZHBg==", + "dev": true, + "engines": { + "node": ">=0.6.0", + "teleport": ">=0.2.0" + } + }, "node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -13989,6 +14025,16 @@ "which": "~2.0.2" } }, + "grunt-parallel": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/grunt-parallel/-/grunt-parallel-0.5.1.tgz", + "integrity": "sha512-Daa6XgRpjzkZ2F+xDOW9aTxMIpi5Y8jwUhG2x0AItW1Dd7IW2rVmA/pfTIvOw8vYhp3iGOW9lBCnS/ihQbl2+Q==", + "dev": true, + "requires": { + "lpad": "~0.1.0", + "q": "~0.8.12" + } + }, "grunt-run": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/grunt-run/-/grunt-run-0.8.1.tgz", @@ -15510,6 +15556,12 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "lpad": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lpad/-/lpad-0.1.0.tgz", + "integrity": "sha512-Iuj1jLmrxOseShxLayj8ODB1rmAncUDwR1KCgOMGLpAxC0a3qqEo/xDeJclC7Gzi34pZUYGBLFJ4zTNjV7WWYQ==", + "dev": true + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -16401,6 +16453,12 @@ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true }, + "q": { + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/q/-/q-0.8.12.tgz", + "integrity": "sha512-mvLmeFP7lwVSFzDhpVhkI9Jw3u9goGQ2IY9nbSNMA4OZyviFjs2XILKMesUz8nBz4deKS9eWibvEuBNlRxZHBg==", + "dev": true + }, "qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", diff --git a/package.json b/package.json index c9d82e3ba9e2..6f6b3b0df54b 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "grunt-cli": "^1.4.3", "grunt-contrib-clean": "^2.0.1", "grunt-contrib-copy": "^1.0.0", + "grunt-parallel": "^0.5.1", "grunt-run": "^0.8.1", "grunt-timer": "^0.6.0", "grunt-ts": "^6.0.0-beta.22",