Skip to content

Commit ad9f02a

Browse files
committed
chore: enable cyclic dependency check
Closes angular#9742
1 parent 2d73583 commit ad9f02a

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

gulpfile.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,22 @@ gulp.task('lint', ['format:enforce', 'tools:build'], () => {
101101

102102
gulp.task('tools:build', (done) => { tsc('tools/', done); });
103103

104+
gulp.task('check-cycle', (done) => {
105+
var madge = require('madge');
106+
107+
var dependencyObject = madge(['dist/all/'], {
108+
format: 'cjs',
109+
extensions: ['.js'],
110+
onParseFile: function(data) { data.src = data.src.replace(/\/\* circular \*\//g, "//"); }
111+
});
112+
var circularDependencies = dependencyObject.circular().getArray();
113+
if (circularDependencies.length > 0) {
114+
console.log('Found circular dependencies!');
115+
console.log(circularDependencies);
116+
process.exit(1);
117+
}
118+
done();
119+
});
104120

105121
gulp.task('serve', () => {
106122
let connect = require('gulp-connect');
@@ -132,7 +148,6 @@ gulp.task('changelog', () => {
132148
.pipe(gulp.dest('./'));
133149
});
134150

135-
136151
function tsc(projectPath, done) {
137152
let child_process = require('child_process');
138153

modules/@angular/compiler/src/output/value_util.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
19
import {CompileIdentifierMetadata} from '../compile_metadata';
210
import {StringMapWrapper} from '../facade/collection';
311
import {BaseException} from '../facade/exceptions';

scripts/ci-lite/test_e2e.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ echo 'travis_fold:end:test.buildPackages'
2626
./tools/typings-test/test.sh
2727
$(npm bin)/gulp public-api:enforce
2828

29+
$(npm bin)/gulp check-cycle
30+
2931
echo 'travis_fold:start:test.e2e.localChrome'
3032
cd dist/
3133
$(npm bin)/gulp serve &

0 commit comments

Comments
 (0)