From 0d71345b9367b0a7649fb15c555c57ee825a35bf Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 4 May 2016 15:17:53 -0600 Subject: [PATCH] fix(codegen): codegen all files in the program, not just roots fixes #8475 --- modules/@angular/compiler_cli/integrationtest.sh | 6 ++++-- .../@angular/compiler_cli/integrationtest/tsconfig.json | 9 +++++++-- .../@angular/compiler_cli/integrationtest/typings.d.ts | 2 -- modules/@angular/compiler_cli/src/codegen.ts | 6 ++++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/modules/@angular/compiler_cli/integrationtest.sh b/modules/@angular/compiler_cli/integrationtest.sh index a1a889f3a0..86c88c6224 100755 --- a/modules/@angular/compiler_cli/integrationtest.sh +++ b/modules/@angular/compiler_cli/integrationtest.sh @@ -5,5 +5,7 @@ set -e -o pipefail cd $(dirname $0) cd $(pwd)/../../.. export NODE_PATH=$NODE_PATH:$(pwd)/dist/all:$(pwd)/dist/tools -node dist/all/@angular/compiler_cli/src/main -p modules/@angular/compiler_cli/integrationtest -node dist/tools/cjs-jasmine -- @angular/compiler_cli/integrationtest/**/*_spec.js +readonly TESTDIR="modules/@angular/compiler_cli/integrationtest" +rm $TESTDIR/src/*.{ngfactory,css.shim}.ts +node dist/all/@angular/compiler_cli/src/main -p $TESTDIR +node dist/tools/cjs-jasmine -- $TESTDIR/**/*_spec.js diff --git a/modules/@angular/compiler_cli/integrationtest/tsconfig.json b/modules/@angular/compiler_cli/integrationtest/tsconfig.json index 07d017a174..5a4f51baae 100644 --- a/modules/@angular/compiler_cli/integrationtest/tsconfig.json +++ b/modules/@angular/compiler_cli/integrationtest/tsconfig.json @@ -14,10 +14,15 @@ "outDir": "../../../../dist/all/@angular/compiler_cli/integrationtest", "rootDir": "", "declaration": true, - + "lib": ["es6", "dom"], "baseUrl": ".", "paths": { "@angular/*": ["../../../../dist/all/@angular/*"] } - } + }, + + "files": [ + "src/bootstrap.ts", + "typings.d.ts" + ] } diff --git a/modules/@angular/compiler_cli/integrationtest/typings.d.ts b/modules/@angular/compiler_cli/integrationtest/typings.d.ts index b233a0dc0c..b99e33358e 100644 --- a/modules/@angular/compiler_cli/integrationtest/typings.d.ts +++ b/modules/@angular/compiler_cli/integrationtest/typings.d.ts @@ -1,4 +1,2 @@ -/// -/// /// /// diff --git a/modules/@angular/compiler_cli/src/codegen.ts b/modules/@angular/compiler_cli/src/codegen.ts index be4f8152e2..546e473882 100644 --- a/modules/@angular/compiler_cli/src/codegen.ts +++ b/modules/@angular/compiler_cli/src/codegen.ts @@ -155,8 +155,10 @@ export class CodeGenerator { return Promise.all(stylesheetPromises); }) .catch((e) => { console.error(e.stack); }); - return Promise.all( - this.program.getRootFileNames().filter(f => !GENERATED_FILES.test(f)).map(generateOneFile)); + return Promise.all(this.program.getSourceFiles() + .map(sf => sf.fileName) + .filter(f => !GENERATED_FILES.test(f)) + .map(generateOneFile)); } static create(ngOptions: AngularCompilerOptions, program: ts.Program, options: ts.CompilerOptions,