Files
blockly/gulpfile.js
Christopher Allen 54670d534e feat(test): Miscellaneous improvements to test_tasks.js (#6615)
* feat(tests): Make runTestBlock able to run any gulp task

  Modify runTestBlock so that it can run any async task, not just
  ones that return a Promise, by using the async-done package
  (part of Gulp, and already an indirect dependency) to detect
  task completion.

  Celebrate by renaming it to runTestTask.

* refactor(tests): Create Tester class to encapsulate test infrastructure

  - Create Tester class to encapsulate the runTestTask,
    and reportTestResult and runAll functions.

  - Remove the unnecessary id parameter from runTestTask (code was
    already using the .name of the task function object).

  - Remove --silent flag from npm scripts so as not to suppress
    syntax error in gulpfiles.

* refactor(tests): Invoke buildAdvancedCompilationTest task directly

  Have the test task invoke the buildAdvancedCompilationTest
  (via onlyBuildAdvancedCompilationTest, to skip already-run
  prerequisites) directly, rather than by running npm.
2022-11-16 18:17:54 +00:00

61 lines
2.2 KiB
JavaScript

/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Gulp script to build Blockly for Node & NPM.
* Run this script by calling "npm install" in this directory.
*/
/* eslint-env node */
const gulp = require('gulp');
const buildTasks = require('./scripts/gulpfiles/build_tasks');
const packageTasks = require('./scripts/gulpfiles/package_tasks');
const gitTasks = require('./scripts/gulpfiles/git_tasks');
const licenseTasks = require('./scripts/gulpfiles/license_tasks');
const appengineTasks = require('./scripts/gulpfiles/appengine_tasks');
const releaseTasks = require('./scripts/gulpfiles/release_tasks');
const cleanupTasks = require('./scripts/gulpfiles/cleanup_tasks');
const docsTasks = require('./scripts/gulpfiles/docs_tasks');
const testTasks = require('./scripts/gulpfiles/test_tasks');
module.exports = {
// Default target if gulp invoked without specifying.
default: buildTasks.build,
// Main sequence targets. They already invoke prerequisites.
langfiles: buildTasks.langfiles, // Build build/msg/*.js from msg/json/*.
tsc: buildTasks.tsc,
deps: buildTasks.deps,
minify: buildTasks.minify,
build: buildTasks.build,
package: packageTasks.package,
publish: releaseTasks.publish,
publishBeta: releaseTasks.publishBeta,
prepareDemos: appengineTasks.prepareDemos,
deployDemos: appengineTasks.deployDemos,
deployDemosBeta: appengineTasks.deployDemosBeta,
gitUpdateGithubPages: gitTasks.updateGithubPages,
// Manually-invokable targets, with prequisites where required.
prepare: buildTasks.prepare,
format: buildTasks.format,
messages: buildTasks.messages, // Generate msg/json/en.json et al.
sortRequires: cleanupTasks.sortRequires,
checkLicenses: licenseTasks.checkLicenses,
clean: gulp.parallel(buildTasks.cleanBuildDir, packageTasks.cleanReleaseDir),
test: testTasks.test,
testGenerators: testTasks.generators,
buildAdvancedCompilationTest: buildTasks.buildAdvancedCompilationTest,
gitCreateRC: gitTasks.createRC,
docs: docsTasks.docs,
// Legacy targets, to be deleted.
recompile: releaseTasks.recompile,
gitSyncDevelop: gitTasks.syncDevelop,
gitSyncMaster: gitTasks.syncMaster,
};