angular-cn/tools/gulp-tasks
Wagner Maciel b7f2a033df feat(dev-infra): exposed new rule 'component_benchmark' via dev_infra (#36434)
* Move tools/brotli-cli, tools/browsers, tools/components,
  tools/ng_rollup_bundle, and modules/e2e_util to dev-infra/benchmarking
* Fix imports and references to moved folders and files
* Set up BUILD.bazel files for moved folders so they can be packaged with
  dev-infra's :npm_package

PR Close #36434
2020-04-23 13:31:53 -07:00
..
cldr build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
README.md build: no longer run tslint from within gulp task (#35800) 2020-03-03 09:20:49 -08:00
changelog-zonejs.js docs(zone.js): update release docs instructions (#32128) 2019-08-13 16:55:03 -07:00
changelog.js feat(dev-infra): add dev-infra to the commit message scopes (#35992) 2020-03-10 13:26:12 -04:00
cldr.js build: move cldr dependency to npm (#33634) 2019-11-07 17:49:19 +00:00
format.js feat(dev-infra): exposed new rule 'component_benchmark' via dev_infra (#36434) 2020-04-23 13:31:53 -07:00
platform-script-path.js build: update npm dependencies (#19328) 2017-09-22 13:20:52 -07:00
source-map-test.js build: update npm dependencies (#19328) 2017-09-22 13:20:52 -07:00

README.md

Gulp Tasks folder

This folder contains one file for each task (or group of related tasks) for the project's gulpfile. The dependencies between the tasks is kept in the gulpfile.

Task File Structure

Each task is defined by a factory function that accepts gulp as a parameter. Each file exports either one factory or an object of factories.

E.g. The build.js file contains only one task:

module.exports = (gulp) => (done) => {
  ...
};

E.g. The format.js file contains two tasks:

module.exports = {
  // Check source code for formatting errors (clang-format)
  enforce: (gulp) => () => {
    ...
  },

  // Format the source code with clang-format (see .clang-format)
  format: (gulp) => () => {
    ...
  }
};

Loading Tasks

The tasks are loaded in the gulp file, by requiring them. There is a helper called loadTask(fileName, taskName) will do this for us, where the taskName is optional if the file only exports one task.

E.g. Loading the task that will run the build, from a task file that contains only one task.

gulp.task('build.sh', loadTask('build'));

E.g. Loading the task that will enforce formatting, from a task file that contains more than one task:

gulp.task('format:enforce', loadTask('format', 'enforce'));

E.g. Loading a task that has dependencies:

gulp.task('lint', ['format:enforce'], loadTask('lint'));