Skip to content

Commit

Permalink
fix(codegen): codegen all files in the program, not just roots
Browse files Browse the repository at this point in the history
fixes #8475
  • Loading branch information
alexeagle committed May 11, 2016
1 parent f235454 commit 0d71345
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 4 additions & 2 deletions modules/@angular/compiler_cli/integrationtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 7 additions & 2 deletions modules/@angular/compiler_cli/integrationtest/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
"outDir": "../../../../dist/all/@angular/compiler_cli/integrationtest",
"rootDir": "",
"declaration": true,

"lib": ["es6", "dom"],
"baseUrl": ".",
"paths": {
"@angular/*": ["../../../../dist/all/@angular/*"]
}
}
},

"files": [

This comment has been minimized.

Copy link
@alexeagle

alexeagle May 25, 2016

Author Contributor

this change stopped the tests from being compiled, so they haven't been running :(

"src/bootstrap.ts",
"typings.d.ts"
]
}
2 changes: 0 additions & 2 deletions modules/@angular/compiler_cli/integrationtest/typings.d.ts
Original file line number Diff line number Diff line change
@@ -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" />
6 changes: 4 additions & 2 deletions modules/@angular/compiler_cli/src/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0d71345

Please sign in to comment.