Skip to content

Commit

Permalink
Update dependencies to null-safe versions (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitusortner authored Mar 21, 2021
1 parent b0601d8 commit 2a76267
Show file tree
Hide file tree
Showing 45 changed files with 694 additions and 204 deletions.
12 changes: 6 additions & 6 deletions example/lib/database.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "17.0.0"
version: "18.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -42,14 +42,14 @@ packages:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.3"
version: "2.0.0"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.6"
version: "0.4.7"
build_daemon:
dependency: transitive
description:
Expand All @@ -63,21 +63,21 @@ packages:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.4"
version: "2.0.0"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.5"
version: "1.12.2"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.10"
version: "6.1.12"
built_collection:
dependency: transitive
description:
Expand Down Expand Up @@ -112,7 +112,7 @@ packages:
name: checked_yaml
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "2.0.1"
cli_util:
dependency: transitive
description:
Expand All @@ -133,7 +133,7 @@ packages:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.0"
version: "3.7.0"
collection:
dependency: transitive
description:
Expand Down Expand Up @@ -161,7 +161,7 @@ packages:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.14"
version: "2.0.0"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -234,7 +234,7 @@ packages:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
version: "1.0.0"
http_multi_server:
dependency: transitive
description:
Expand Down Expand Up @@ -269,14 +269,14 @@ packages:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
version: "4.0.1"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "0.11.4"
version: "1.0.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -339,7 +339,7 @@ packages:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.8"
version: "1.0.0"
quiver:
dependency: transitive
description:
Expand Down Expand Up @@ -372,7 +372,7 @@ packages:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.10+3"
version: "1.0.0"
source_span:
dependency: transitive
description:
Expand All @@ -386,7 +386,7 @@ packages:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0+2"
version: "2.0.0+3"
sqflite_common:
dependency: transitive
description:
Expand Down
32 changes: 16 additions & 16 deletions floor/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "17.0.0"
version: "18.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -42,14 +42,14 @@ packages:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.3"
version: "2.0.0"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.6"
version: "0.4.7"
build_daemon:
dependency: transitive
description:
Expand All @@ -63,21 +63,21 @@ packages:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.4"
version: "2.0.0"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.5"
version: "1.12.2"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.10"
version: "6.1.12"
built_collection:
dependency: transitive
description:
Expand Down Expand Up @@ -112,7 +112,7 @@ packages:
name: checked_yaml
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "2.0.1"
cli_util:
dependency: transitive
description:
Expand All @@ -133,7 +133,7 @@ packages:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.0"
version: "3.7.0"
collection:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -161,7 +161,7 @@ packages:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.14"
version: "2.0.0"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -227,7 +227,7 @@ packages:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
version: "1.0.0"
http_multi_server:
dependency: transitive
description:
Expand Down Expand Up @@ -297,7 +297,7 @@ packages:
name: mockito
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
version: "5.0.2"
package_config:
dependency: transitive
description:
Expand Down Expand Up @@ -339,7 +339,7 @@ packages:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.8"
version: "1.0.0"
shelf:
dependency: transitive
description:
Expand All @@ -360,12 +360,12 @@ packages:
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
dependency: "direct overridden"
description:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.10+3"
version: "1.0.0"
source_span:
dependency: transitive
description:
Expand All @@ -379,7 +379,7 @@ packages:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0+2"
version: "2.0.0+3"
sqflite_common:
dependency: transitive
description:
Expand Down
11 changes: 8 additions & 3 deletions floor/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@ dependencies:
sdk: flutter
meta: ^1.3.0
path: ^1.8.0
sqflite: ^2.0.0+2
sqflite: ^2.0.0+3
sqflite_common_ffi: ^2.0.0

dev_dependencies:
build_runner: ^1.11.5
build_runner: ^1.12.2
collection: ^1.15.0
floor_generator:
path: ../floor_generator/
flutter_test:
sdk: flutter
matcher: ^0.12.10
mockito: ^5.0.0
mockito: ^5.0.2

dependency_overrides:
# necessary for mockito 5.0.2 as its source_gen dependency is constrained to be below 1.0.0
# as this override only affects test dependencies, there is not too much to worry about
source_gen: '1.0.0'
1 change: 0 additions & 1 deletion floor_generator/lib/builder.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ignore_for_file: import_of_legacy_library_into_null_safe
import 'package:build/build.dart';
import 'package:floor_generator/generator.dart';
import 'package:source_gen/source_gen.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ignore_for_file: import_of_legacy_library_into_null_safe
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:floor_generator/misc/type_utils.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extension TypeConverterElementExtension on Element {
Set<TypeConverter> getTypeConverters(final TypeConverterScope scope) {
if (hasAnnotation(annotations.TypeConverters)) {
final typeConverterElements = getAnnotation(annotations.TypeConverters)
.getField(AnnotationField.typeConverterValue)
?.getField(AnnotationField.typeConverterValue)
?.toListValue()
?.mapNotNull((object) => object.toTypeValue()?.element);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ignore_for_file: import_of_legacy_library_into_null_safe
import 'package:analyzer/dart/element/type.dart';
import 'package:collection/collection.dart';
import 'package:floor_generator/misc/extension/iterable_extension.dart';
Expand Down
6 changes: 3 additions & 3 deletions floor_generator/lib/misc/type_utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ignore_for_file: import_of_legacy_library_into_null_safe
import 'dart:typed_data';

import 'package:analyzer/dart/constant/value.dart';
Expand Down Expand Up @@ -44,8 +43,9 @@ extension AnnotationChecker on Element {
return _typeChecker(type).hasAnnotationOfExact(this);
}

/// Returns the first annotation object found on [type]
DartObject getAnnotation(final Type type) {
/// Returns the first annotation object found of [type]
/// or `null` if annotation of [type] not found
DartObject? getAnnotation(final Type type) {
return _typeChecker(type).firstAnnotationOfExact(this);
}
}
Expand Down
6 changes: 3 additions & 3 deletions floor_generator/lib/processor/database_processor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class DatabaseProcessor extends Processor<Database> {
int _getDatabaseVersion() {
final version = _classElement
.getAnnotation(annotations.Database)
.getField(AnnotationField.databaseVersion)
?.getField(AnnotationField.databaseVersion)
?.toIntValue();

if (version == null) throw _processorError.versionIsMissing;
Expand Down Expand Up @@ -108,7 +108,7 @@ class DatabaseProcessor extends Processor<Database> {
) {
final entities = _classElement
.getAnnotation(annotations.Database)
.getField(AnnotationField.databaseEntities)
?.getField(AnnotationField.databaseEntities)
?.toListValue()
?.mapNotNull((object) => object.toTypeValue()?.element)
.whereType<ClassElement>()
Expand All @@ -132,7 +132,7 @@ class DatabaseProcessor extends Processor<Database> {
) {
return _classElement
.getAnnotation(annotations.Database)
.getField(AnnotationField.databaseViews)
?.getField(AnnotationField.databaseViews)
?.toListValue()
?.mapNotNull((object) => object.toTypeValue()?.element)
.whereType<ClassElement>()
Expand Down
Loading

0 comments on commit 2a76267

Please sign in to comment.