Skip to content

Commit

Permalink
feat(dart/transform): DirectiveProcessor: do not process generated files
Browse files Browse the repository at this point in the history
Prevent `DirectiveProcessor` from processing files which were generated
by the Angular2 Dart transformer.

Closes #6517
  • Loading branch information
Tim Blasi authored and kegluneq committed Jan 22, 2016
1 parent a24ee6a commit 78bfdf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions modules_dart/transform/lib/src/transform/common/names.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ const ALL_EXTENSIONS = const [
bool isGenerated(String uri) {
return const [
DEPS_EXTENSION,
META_EXTENSION,
NON_SHIMMED_STYLESHEET_EXTENSION,
SHIMMED_STYLESHEET_EXTENSION,
SUMMARY_META_EXTENSION,
TEMPLATE_EXTENSION,
].any((ext) => uri.endsWith(ext));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class DirectiveProcessor extends Transformer implements LazyTransformer {
DirectiveProcessor(this.options);

@override
bool isPrimary(AssetId id) => id.extension.endsWith('dart');
bool isPrimary(AssetId id) =>
id.extension.endsWith('dart') && !isGenerated(id.path);

@override
declareOutputs(DeclaringTransform transform) {
Expand Down

0 comments on commit 78bfdf7

Please sign in to comment.