chore: enable cyclic dependency check

Closes #9742
This commit is contained in:
Tobias Bosch 2016-06-30 13:34:32 -07:00
parent 2d73583253
commit ad9f02a73e
3 changed files with 26 additions and 1 deletions

View File

@ -101,6 +101,22 @@ gulp.task('lint', ['format:enforce', 'tools:build'], () => {
gulp.task('tools:build', (done) => { tsc('tools/', done); });
gulp.task('check-cycle', (done) => {
var madge = require('madge');
var dependencyObject = madge(['dist/all/'], {
format: 'cjs',
extensions: ['.js'],
onParseFile: function(data) { data.src = data.src.replace(/\/\* circular \*\//g, "//"); }
});
var circularDependencies = dependencyObject.circular().getArray();
if (circularDependencies.length > 0) {
console.log('Found circular dependencies!');
console.log(circularDependencies);
process.exit(1);
}
done();
});
gulp.task('serve', () => {
let connect = require('gulp-connect');
@ -132,7 +148,6 @@ gulp.task('changelog', () => {
.pipe(gulp.dest('./'));
});
function tsc(projectPath, done) {
let child_process = require('child_process');

View File

@ -1,3 +1,11 @@
/**
* @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
*/
import {CompileIdentifierMetadata} from '../compile_metadata';
import {StringMapWrapper} from '../facade/collection';
import {BaseException} from '../facade/exceptions';

View File

@ -26,6 +26,8 @@ echo 'travis_fold:end:test.buildPackages'
./tools/typings-test/test.sh
$(npm bin)/gulp public-api:enforce
$(npm bin)/gulp check-cycle
echo 'travis_fold:start:test.e2e.localChrome'
cd dist/
$(npm bin)/gulp serve &