update analyzer and code_transformers version and use mock sdk from code transformers
R=sigmund@google.com
Review URL: https://codereview.chromium.org//997193004
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fc10126..59705c9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,8 @@
#### 0.10.5+3
* Fix normalization of relative paths inside of deep relative imports,
https://github.com/dart-lang/polymer-dart/issues/30.
+ * Update analyzer and code_transformers versions and use new mock sdk from
+ code_transformers.
#### 0.10.5+2
* Append html imports in front of the dart script tag, if one exists in
diff --git a/lib/build/html_import_annotation_recorder.dart b/lib/build/html_import_annotation_recorder.dart
index c320862..ba5d2ab 100644
--- a/lib/build/html_import_annotation_recorder.dart
+++ b/lib/build/html_import_annotation_recorder.dart
@@ -34,6 +34,10 @@
type = annotationElement.returnType;
} else if (annotationElement is PropertyAccessorElement) {
type = annotationElement.variable.propagatedType;
+ if (type == null) {
+ type = pluginData.resolver.evaluateConstant(annotationElement.library,
+ pluginData.initializer.annotationNode.name).value.type;
+ }
} else {
logger.error('Unsupported annotation type. Only constructors and '
'properties are supported as initializers.');
diff --git a/lib/build/web_components.dart b/lib/build/web_components.dart
index a5bf002..52b1a28 100644
--- a/lib/build/web_components.dart
+++ b/lib/build/web_components.dart
@@ -10,6 +10,7 @@
import 'package:code_transformers/assets.dart';
import 'package:code_transformers/messages/build_logger.dart';
import 'package:code_transformers/resolver.dart';
+import 'package:code_transformers/src/dart_sdk.dart' as dart_sdk;
import 'package:html5lib/dom.dart' as dom;
import 'package:initialize/transformer.dart' show generateBootstrapFile;
import 'package:initialize/build/initializer_plugin.dart';
@@ -51,49 +52,8 @@
final Resolvers _resolvers;
TransformOptions options;
- WebComponentsTransformer(this.options) : _resolvers = new Resolvers.fromMock({
- // The list of types below is derived from:
- // * types that are used internally by the resolver (see
- // _initializeFrom in resolver.dart).
- // TODO(jakemac): Move this into code_transformers so it can be shared.
- 'dart:core': '''
- library dart.core;
- class Object {}
- class Function {}
- class StackTrace {}
- class Symbol {}
- class Type {}
-
- class String extends Object {}
- class bool extends Object {}
- class num extends Object {}
- class int extends num {}
- class double extends num {}
- class DateTime extends Object {}
- class Null extends Object {}
-
- class Deprecated extends Object {
- final String expires;
- const Deprecated(this.expires);
- }
- const Object deprecated = const Deprecated("next release");
- class _Override { const _Override(); }
- const Object override = const _Override();
- class _Proxy { const _Proxy(); }
- const Object proxy = const _Proxy();
-
- class List<V> extends Object {}
- class Map<K, V> extends Object {}
- ''',
- 'dart:html': '''
- library dart.html;
- class HtmlElement {}
- ''',
- 'dart:async': '''
- library dart.async;
- class Future<T> {}
- ''',
- });
+ WebComponentsTransformer(this.options)
+ : _resolvers = new Resolvers.fromMock(dart_sdk.mockSdkSources);
bool isPrimary(AssetId id) {
if (options.entryPoints != null) {
diff --git a/pubspec.yaml b/pubspec.yaml
index fa01acf..1274e1d 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -10,9 +10,9 @@
elements, by hiding DOM subtrees under shadow roots. HTML Imports let authors
bundle code and HTML as if they were libraries.
dependencies:
- analyzer: '^0.22.4'
+ analyzer: '>=0.22.4 <0.25.0'
barback: '>=0.14.2 <0.16.0'
- code_transformers: '^0.2.4'
+ code_transformers: '^0.2.7'
html5lib: '^0.12.0'
initialize: '^0.5.0+1'
path: '^1.3.0'