2016-10-04 23:39:20 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2015-04-25 17:45:08 -04:00
|
|
|
'use strict';
|
|
|
|
|
2017-02-09 14:58:36 -05:00
|
|
|
|
2015-11-14 11:10:31 -05:00
|
|
|
// THIS CHECK SHOULD BE THE FIRST THING IN THIS FILE
|
|
|
|
// This is to ensure that we catch env issues before we error while requiring other dependencies.
|
2017-02-09 14:58:36 -05:00
|
|
|
const engines = require('./package.json').engines;
|
2017-02-22 23:55:25 -05:00
|
|
|
require('./tools/check-environment')({
|
|
|
|
requiredNodeVersion: engines.node,
|
|
|
|
requiredNpmVersion: engines.npm,
|
|
|
|
requiredYarnVersion: engines.yarn
|
|
|
|
});
|
2015-11-14 11:10:31 -05:00
|
|
|
|
2016-05-25 22:54:34 -04:00
|
|
|
const gulp = require('gulp');
|
2015-11-27 02:45:40 -05:00
|
|
|
|
2017-02-03 03:10:41 -05:00
|
|
|
// See `tools/gulp-tasks/README.md` for information about task loading.
|
|
|
|
function loadTask(fileName, taskName) {
|
|
|
|
const taskModule = require('./tools/gulp-tasks/' + fileName);
|
|
|
|
const task = taskName ? taskModule[taskName] : taskModule;
|
|
|
|
return task(gulp);
|
|
|
|
}
|
2016-06-23 19:23:15 -04:00
|
|
|
|
2019-01-28 19:13:29 -05:00
|
|
|
// Check source code for formatting errors in all source files.
|
2017-02-03 03:10:41 -05:00
|
|
|
gulp.task('format:enforce', loadTask('format', 'enforce'));
|
2019-01-28 19:13:29 -05:00
|
|
|
|
|
|
|
// Format all source files.
|
|
|
|
gulp.task('format:all', loadTask('format', 'format'));
|
|
|
|
|
|
|
|
// Format only untracked source code files.
|
2018-09-10 21:19:14 -04:00
|
|
|
gulp.task('format:untracked', loadTask('format', 'format-untracked'));
|
2019-01-28 19:13:29 -05:00
|
|
|
|
|
|
|
// Format only the changed, tracked source code files.
|
2018-09-07 12:54:47 -04:00
|
|
|
gulp.task('format:diff', loadTask('format', 'format-diff'));
|
2019-01-28 19:13:29 -05:00
|
|
|
|
|
|
|
// Format only changed lines based on the diff from the provided --branch
|
|
|
|
// argument (or `master` by default).
|
2018-09-10 21:19:14 -04:00
|
|
|
gulp.task('format:changed', ['format:untracked', 'format:diff']);
|
2019-01-28 19:13:29 -05:00
|
|
|
|
|
|
|
// Alias for `format:changed` that formerly formatted all files.
|
|
|
|
gulp.task('format', ['format:changed']);
|
|
|
|
|
2017-02-14 17:16:50 -05:00
|
|
|
gulp.task('lint', ['format:enforce', 'validate-commit-messages', 'tslint']);
|
|
|
|
gulp.task('tslint', ['tools:build'], loadTask('lint'));
|
2017-02-03 03:10:41 -05:00
|
|
|
gulp.task('validate-commit-messages', loadTask('validate-commit-message'));
|
2017-09-07 13:16:03 -04:00
|
|
|
gulp.task('source-map-test', loadTask('source-map-test'));
|
2017-02-03 03:10:41 -05:00
|
|
|
gulp.task('tools:build', loadTask('tools-build'));
|
|
|
|
gulp.task('check-cycle', loadTask('check-cycle'));
|
|
|
|
gulp.task('serve', loadTask('serve', 'default'));
|
2017-02-22 18:14:49 -05:00
|
|
|
gulp.task('changelog', loadTask('changelog'));
|
2017-02-22 23:55:25 -05:00
|
|
|
gulp.task('check-env', () => {/* this is a noop because the env test ran already above */});
|
2017-07-20 04:54:07 -04:00
|
|
|
gulp.task('cldr:extract', loadTask('cldr', 'extract'));
|
|
|
|
gulp.task('cldr:download', loadTask('cldr', 'download'));
|
2017-08-21 13:11:07 -04:00
|
|
|
gulp.task('cldr:gen-closure-locale', loadTask('cldr', 'closure'));
|