Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Update packages versions and related code #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package/inject/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ environment:
sdk: '>=2.0.0 <3.0.0'

dependencies:
meta: ^1.1.2
meta: ^1.2.3
2 changes: 1 addition & 1 deletion package/inject_generator/lib/src/analyzer/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:inject_generator/src/source/symbol_path.dart';

/// Constructs a serializable path to [element].
SymbolPath getSymbolPath(Element element) {
if (element is TypeDefiningElement && element.type.isDynamic) {
if (element is TypeDefiningElement && element.kind == ElementKind.DYNAMIC) {
throw new ArgumentError('Dynamic element type not supported. This is a '
'package:inject bug. Please report it.');
}
Expand Down
4 changes: 2 additions & 2 deletions package/inject_generator/lib/src/analyzer/visitors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class _LibraryVisitor extends RecursiveElementVisitor<Null> {
List<SymbolPath> _extractModules(ClassElement clazz) {
ElementAnnotation annotation = getInjectorAnnotation(clazz);
List<DartObject> modules =
annotation.constantValue.getField('modules').toListValue();
annotation.computeConstantValue().getField('modules').toListValue();
if (modules == null) {
return const <SymbolPath>[];
}
Expand All @@ -140,7 +140,7 @@ abstract class InjectClassVisitor {

/// Call to start visiting [clazz].
void visitClass(ClassElement clazz) {
for (var supertype in clazz.allSupertypes.where((t) => !t.isObject)) {
for (var supertype in clazz.allSupertypes.where((t) => !t.isDartCoreObject)) {
new _AnnotatedClassVisitor(this).visitClassElement(supertype.element);
}
new _AnnotatedClassVisitor(this).visitClassElement(clazz);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ class _ProviderSummaryVisitor extends InjectClassVisitor {

ProviderSummary _createConstructorProviderSummary(
ConstructorElement element, bool isSingleton) {
// TODO 'type' is marked as deprecated and removed in future analyzer releases
var returnType = element.enclosingElement.type;
return new ProviderSummary(
getInjectedType(returnType), element.name, ProviderKind.constructor,
Expand Down
6 changes: 1 addition & 5 deletions package/inject_generator/lib/src/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
import 'dart:async';
import 'package:analyzer/dart/analysis/results.dart';

// <TRANSITIONAL_API>
import 'package:analyzer/src/dart/analysis/results.dart';
// </TRANSITIONAL_API>

import 'package:analyzer/dart/element/element.dart';
import 'package:build/build.dart';
import 'package:build/build.dart' as build show log;
Expand Down Expand Up @@ -103,7 +99,7 @@ class BuilderLogger {
// <TRANSITIONAL_API>
ElementDeclarationResult elementDeclaration;
if (element.kind != ElementKind.DYNAMIC) {
var parsedLibrary = ParsedLibraryResultImpl.tmp(element.library);
var parsedLibrary = element.library.session.getParsedLibraryByElement(element.library);
if (parsedLibrary.state == ResultState.VALID) {
elementDeclaration = parsedLibrary.getElementDeclaration(element);
}
Expand Down
28 changes: 14 additions & 14 deletions package/inject_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ authors:
homepage: https://pub.dartlang.org/packages/inject

environment:
sdk: '>=2.0.0 <3.0.0'
sdk: '>=2.10.0 <3.0.0'

dependencies:
analyzer: ^0.34.0
build: ^1.0.0
code_builder: ^3.0.3
collection: ^1.14.7
dart_style: ^1.0.10
logging: ^0.11.3+1
meta: ^1.1.2
path: ^1.5.1
quiver: ^2.0.0
stack_trace: ^1.9.2
analyzer: ^0.39.14
build: ^1.3.0
code_builder: ^3.4.1
collection: ^1.14.13
dart_style: ^1.3.0
logging: ^0.11.4
meta: ^1.2.3
path: ^1.7.0
quiver: ^2.1.3
stack_trace: ^1.9.5

dev_dependencies:
build_runner: ^1.0.0
build_test: ^0.10.0
build_runner: ^1.2.3
build_test: ^1.1.0
inject:
path: ../inject
test: ^1.5.0
test: ^1.15.4