Upgrade to the null safe versions of all dependencies (#2913)
diff --git a/lib/src/validator/dependency.dart b/lib/src/validator/dependency.dart
index 054fe9c..3e2f7b2 100644
--- a/lib/src/validator/dependency.dart
+++ b/lib/src/validator/dependency.dart
@@ -140,9 +140,8 @@
}
String constraint;
- var primary = Version.primary(versions);
- if (primary != null) {
- constraint = '^$primary';
+ if (versions.isNotEmpty) {
+ constraint = '^${Version.primary(versions)}';
} else {
constraint = dep.constraint.toString();
if (!dep.constraint.isAny && dep.constraint is! Version) {
diff --git a/lib/src/validator/relative_version_numbering.dart b/lib/src/validator/relative_version_numbering.dart
index fa3ae53..e0b7d70 100644
--- a/lib/src/validator/relative_version_numbering.dart
+++ b/lib/src/validator/relative_version_numbering.dart
@@ -32,7 +32,7 @@
} on PackageNotFoundException {
existingVersions = [];
}
- existingVersions..sort((a, b) => a.version.compareTo(b.version));
+ existingVersions.sort((a, b) => a.version.compareTo(b.version));
final previousVersion = existingVersions.lastWhere(
(id) => id.version < entrypoint.root.version,
orElse: () => null);
diff --git a/pubspec.yaml b/pubspec.yaml
index b0b64d2..d9970e3 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -6,29 +6,29 @@
dependencies:
# Note: Pub's test infrastructure assumes that any dependencies used in tests
# will be hosted dependencies.
- analyzer: ^0.40.0
- args: ^1.4.1
- async: ^2.0.0
- cli_util: ^0.2.0
- collection: ^1.8.0
- crypto: ^2.0.0
- http: ^0.12.0
- http_multi_server: ^2.0.0
- http_retry: ^0.1.1
- meta: ^1.1.0
- oauth2: ^1.0.0
- path: ^1.2.0
- pedantic: ^1.9.0
- pool: ^1.0.0
- pub_semver: ^1.4.4
- shelf: ^0.7.0
- source_span: ^1.4.0
- stack_trace: ^1.0.0
- tar: ^0.3.0-nullsafety
- yaml: ^2.2.0
+ analyzer: ^1.0.0
+ args: ^2.0.0
+ async: ^2.5.0
+ cli_util: ^0.3.0
+ collection: ^1.15.0
+ crypto: ^3.0.0
+ http: ^0.13.0
+ http_multi_server: ^3.0.0
+ http_retry: ^0.2.0
+ meta: ^1.3.0
+ oauth2: ^2.0.0
+ path: ^1.8.0
+ pedantic: ^1.10.0
+ pool: ^1.5.0
+ pub_semver: ^2.0.0
+ shelf: ^1.0.0
+ source_span: ^1.8.0
+ stack_trace: ^1.10.0
+ tar: ^0.3.0
+ yaml: ^3.0.0
dev_dependencies:
- shelf_test_handler: ^1.0.0
- test: ^1.3.0
- test_descriptor: ^1.0.0
- test_process: ^1.0.0
+ shelf_test_handler: ^2.0.0
+ test: ^1.16.0
+ test_descriptor: ^2.0.0
+ test_process: ^2.0.0
diff --git a/tool/extract_all_pub_dev.dart b/tool/extract_all_pub_dev.dart
index 9f18c99..1f79517 100644
--- a/tool/extract_all_pub_dev.dart
+++ b/tool/extract_all_pub_dev.dart
@@ -18,13 +18,13 @@
const statusFilename = 'extract_all_pub_status.json';
Future<List<String>> allPackageNames() async {
- var nextUrl = 'https://pub.dev/api/packages?compact=1';
+ var nextUrl = Uri.https('pub.dev', 'api/packages?compact=1');
final result = json.decode(await httpClient.read(nextUrl));
return List<String>.from(result['packages']);
}
Future<List<String>> versionArchiveUrls(String packageName) async {
- final url = 'https://pub.dev/api/packages/$packageName';
+ final url = Uri.https('pub.dev', 'api/packages/$packageName');
final result = json.decode(await httpClient.read(url));
return List<String>.from(result['versions'].map((v) => v['archive_url']));
}