diff --git a/lib/tools/transformer/metadata_extractor.dart b/lib/tools/transformer/metadata_extractor.dart index f1858be86..fda272556 100644 --- a/lib/tools/transformer/metadata_extractor.dart +++ b/lib/tools/transformer/metadata_extractor.dart @@ -10,7 +10,7 @@ import 'package:code_transformers/resolver.dart'; class AnnotatedType { final ClassElement type; - Iterable annotations; + List annotations; AnnotatedType(this.type); @@ -269,8 +269,7 @@ class AnnotationExtractor { .where((Annotation annotation) { var element = annotation.element; if (element != null && !element.isPublic) { - warn('Annotation $annotation is not public.', - annotation.parent.element); + warn('Annotation $annotation is not public.', cls); return false; } if (element is! ConstructorElement) { @@ -278,10 +277,9 @@ class AnnotationExtractor { return false; } ConstructorElement ctor = element; - var cls = ctor.enclosingElement; - if (!cls.isPublic) { - warn('Annotation $annotation is not public.', - annotation.parent.element); + var annotationClass = ctor.enclosingElement; + if (!annotationClass.isPublic) { + warn('Annotation $annotation is not public.', cls); return false; } return element.enclosingElement.type.isAssignableTo(directiveType.type) || diff --git a/lib/tools/transformer/metadata_generator.dart b/lib/tools/transformer/metadata_generator.dart index b4e003ff1..d27d72e08 100644 --- a/lib/tools/transformer/metadata_generator.dart +++ b/lib/tools/transformer/metadata_generator.dart @@ -1,6 +1,5 @@ library angular.tools.transformer.metadata_generator; -import 'dart:async'; import 'package:analyzer/src/generated/element.dart'; import 'package:angular/tools/transformer/options.dart'; import 'package:barback/barback.dart'; diff --git a/lib/tools/transformer/options.dart b/lib/tools/transformer/options.dart index d93280b29..3a730075a 100644 --- a/lib/tools/transformer/options.dart +++ b/lib/tools/transformer/options.dart @@ -1,9 +1,5 @@ library angular.tools.transformer.options; -import 'dart:async'; - -import 'package:barback/barback.dart'; -import 'package:code_transformers/resolver.dart'; import 'package:di/transformer/options.dart' as di; /** Options used by Angular transformers */ diff --git a/lib/tools/transformer/static_angular_generator.dart b/lib/tools/transformer/static_angular_generator.dart index cd45a883b..284b9924f 100644 --- a/lib/tools/transformer/static_angular_generator.dart +++ b/lib/tools/transformer/static_angular_generator.dart @@ -1,6 +1,5 @@ library angular.tools.transformer.static_angular_generator; -import 'dart:async'; import 'package:analyzer/src/generated/ast.dart'; import 'package:analyzer/src/generated/element.dart'; import 'package:angular/tools/transformer/options.dart'; diff --git a/lib/transformer.dart b/lib/transformer.dart index 3ea0837b1..0d8668203 100644 --- a/lib/transformer.dart +++ b/lib/transformer.dart @@ -9,7 +9,7 @@ import 'package:angular/tools/transformer/html_dart_references_generator.dart'; import 'package:angular/tools/transformer/options.dart'; import 'package:barback/barback.dart'; import 'package:code_transformers/resolver.dart'; -import 'package:di/transformer/injector_generator.dart' as di; +import 'package:di/transformer/injector_generator.dart' show InjectorGenerator; import 'package:di/transformer/options.dart' as di; import 'package:path/path.dart' as path; @@ -126,7 +126,7 @@ List> _createPhases(TransformOptions options) { [new HtmlDartReferencesGenerator(options)], [new _SerialTransformer([ new ExpressionGenerator(options, resolvers), - new di.InjectorGenerator(options.diOptions, resolvers), + new InjectorGenerator(options.diOptions, resolvers), new MetadataGenerator(options, resolvers), new StaticAngularGenerator(options, resolvers) ])] @@ -145,7 +145,7 @@ class _SerialTransformer extends Transformer { final Iterable _transformers; _SerialTransformer(this._transformers); - Future isPrimary(Asset input) => + Future isPrimary(input) => Future.wait(_transformers.map((t) => t.isPrimary(input))) .then((l) => l.any((result) => result));