forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
61 lines (53 loc) · 2.57 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* @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
*/
'use strict';
// 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.
const engines = require('./package.json').engines;
require('./tools/check-environment')({
requiredNodeVersion: engines.node,
requiredNpmVersion: engines.npm,
requiredYarnVersion: engines.yarn
});
const gulp = require('gulp');
// 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);
}
gulp.task('source-map-test', loadTask('source-map-test'));
gulp.task('changelog', loadTask('changelog'));
gulp.task('changelog:zonejs', loadTask('changelog-zonejs'));
gulp.task('check-env', () => {/* this is a noop because the env test ran already above */});
gulp.task('cldr:extract', loadTask('cldr', 'extract'));
gulp.task('cldr:gen-closure-locale', loadTask('cldr', 'closure'));
// TODO(josephperrott): Remove old task entries and deprecation notice after deprecation period.
/** Notify regarding `gulp format:*` deprecation. */
function gulpFormatDeprecationNotice() {
console.info(`######################################################################`)
console.info(`gulp format is deprecated in favor of running the formatter via ng-dev`);
console.info();
console.info(`You can find more usage information by running:`);
console.info(` yarn ng-dev format --help`);
console.info();
console.info(`For more on the rationale and effects of this deprecation visit:`);
console.info(` https://github.com/angular/angular/pull/36726#issue-406278018`);
console.info(`######################################################################`)
process.exit(1);
}
gulp.task('format:all', gulpFormatDeprecationNotice);
gulp.task('format:all:enforce', gulpFormatDeprecationNotice);
gulp.task('format:untracked', gulpFormatDeprecationNotice);
gulp.task('format:untracked:enforce', gulpFormatDeprecationNotice);
gulp.task('format:diff', gulpFormatDeprecationNotice);
gulp.task('format:diff:enforce', gulpFormatDeprecationNotice);
gulp.task('format:changed', gulpFormatDeprecationNotice);
gulp.task('format:changed:enforce', gulpFormatDeprecationNotice);
gulp.task('format', gulpFormatDeprecationNotice);
gulp.task('lint', gulpFormatDeprecationNotice);