Index: packages/web_components/lib/build/html_import_annotation_recorder.dart |
diff --git a/packages/web_components/lib/build/html_import_annotation_recorder.dart b/packages/web_components/lib/build/html_import_annotation_recorder.dart |
index ba5d2abad5a99d35db6753f174c3bfba8e45399a..5f2a3200889bcdf86d5688ff44d9861719d5f20e 100644 |
--- a/packages/web_components/lib/build/html_import_annotation_recorder.dart |
+++ b/packages/web_components/lib/build/html_import_annotation_recorder.dart |
@@ -3,10 +3,7 @@ |
// BSD-style license that can be found in the LICENSE file. |
library web_components.build.html_import_recorder_inliner; |
-import 'package:analyzer/analyzer.dart'; |
-import 'package:analyzer/src/generated/ast.dart'; |
import 'package:analyzer/src/generated/element.dart'; |
-import 'package:barback/barback.dart'; |
import 'package:initialize/transformer.dart'; |
import 'package:path/path.dart' as path; |
import '../src/normalize_path.dart'; |
@@ -21,8 +18,6 @@ class HtmlImportAnnotationRecorder implements InitializerPlugin { |
/// All the normalized import paths that were seen. |
final Set<String> importPaths = new Set<String>(); |
- TransformLogger _logger; |
- |
HtmlImportAnnotationRecorder(); |
/// Applies to anything named `HtmlImport` which annotates a library. |
@@ -35,8 +30,11 @@ class HtmlImportAnnotationRecorder implements InitializerPlugin { |
} else if (annotationElement is PropertyAccessorElement) { |
type = annotationElement.variable.propagatedType; |
if (type == null) { |
- type = pluginData.resolver.evaluateConstant(annotationElement.library, |
- pluginData.initializer.annotationNode.name).value.type; |
+ type = pluginData.resolver |
+ .evaluateConstant(annotationElement.library, |
+ pluginData.initializer.annotationNode.name) |
+ .value |
+ .type; |
} |
} else { |
logger.error('Unsupported annotation type. Only constructors and ' |
@@ -60,18 +58,21 @@ class HtmlImportAnnotationRecorder implements InitializerPlugin { |
var annotationElement = pluginData.initializer.annotationElement; |
var element = pluginData.initializer.targetElement as LibraryElement; |
var resolver = pluginData.resolver; |
- var libraryDirective = |
- pluginData.initializer.targetNode.parent.parent as LibraryDirective; |
var originalImportPath; |
if (annotationElement.element is PropertyAccessorElement) { |
- originalImportPath = resolver.evaluateConstant( |
- element.library, annotation.name).value.fields[ |
- 'filePath'].stringValue; |
+ originalImportPath = resolver |
+ .evaluateConstant(element.library, annotation.name) |
+ .value |
+ .fields['filePath'] |
+ .toStringValue(); |
} else { |
assert(annotationElement.element is ConstructorElement); |
- originalImportPath = resolver.evaluateConstant(element.library, |
- annotation.arguments.arguments.first).value.stringValue; |
+ originalImportPath = resolver |
+ .evaluateConstant( |
+ element.library, annotation.arguments.arguments.first) |
+ .value |
+ .toStringValue(); |
} |
var libPath; |