fix(codegen): codegen all files in the program, not just roots

fixes #8475
This commit is contained in:
Alex Eagle 2016-05-04 15:17:53 -06:00
parent f235454dd6
commit 0d71345b93
4 changed files with 15 additions and 8 deletions

View File

@ -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

View File

@ -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"
]
}

View File

@ -1,4 +1,2 @@
/// <reference path="../../typings/es6-collections/es6-collections.d.ts" />
/// <reference path="../../typings/es6-promise/es6-promise.d.ts" />
/// <reference path="../../typings/node/node.d.ts" />
/// <reference path="../../typings/jasmine/jasmine.d.ts" />

View File

@ -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,