Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update analyzer version and min SDK constraint and fix analysis issues #1428

Merged
merged 4 commits into from
May 20, 2024
Merged
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
64 changes: 32 additions & 32 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Created with package:mono_repo v6.5.7
# Created with package:mono_repo v6.6.1
name: Dart CI
on:
push:
Expand Down Expand Up @@ -36,27 +36,27 @@ jobs:
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: mono_repo self validate
run: dart pub global activate mono_repo 6.5.7
run: dart pub global activate mono_repo 6.6.1
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "analyzer_and_format; Dart 3.0.0; PKGS: _test_yaml, checked_yaml, example, json_annotation, json_serializable; `dart analyze`"
name: "analyzer_and_format; Dart 3.4.0; PKGS: _test_yaml, checked_yaml, example, json_annotation, json_serializable; `dart analyze`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable;commands:analyze_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable;commands:analyze_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: "3.0.0"
sdk: "3.4.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
Expand Down Expand Up @@ -192,23 +192,23 @@ jobs:
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
working-directory: json_serializable
job_004:
name: "unit_test; Dart 3.0.0; PKGS: _test_yaml, checked_yaml, example, json_serializable; `dart test`"
name: "unit_test; Dart 3.4.0; PKGS: _test_yaml, checked_yaml, example, json_serializable; `dart test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:_test_yaml-checked_yaml-example-json_serializable;commands:test_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:_test_yaml-checked_yaml-example-json_serializable;commands:test_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:_test_yaml-checked_yaml-example-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:_test_yaml-checked_yaml-example-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: "3.0.0"
sdk: "3.4.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
Expand Down Expand Up @@ -253,23 +253,23 @@ jobs:
- job_002
- job_003
job_005:
name: "unit_test; Dart 3.0.0; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/annotation_version_test.dart`"
name: "unit_test; Dart 3.4.0; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/annotation_version_test.dart`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:json_serializable;commands:test_3"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:json_serializable;commands:test_3"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: "3.0.0"
sdk: "3.4.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
Expand All @@ -287,23 +287,23 @@ jobs:
- job_002
- job_003
job_006:
name: "unit_test; Dart 3.0.0; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
name: "unit_test; Dart 3.4.0; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:json_serializable;commands:test_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:json_serializable;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: "3.0.0"
sdk: "3.4.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
Expand All @@ -321,23 +321,23 @@ jobs:
- job_002
- job_003
job_007:
name: "unit_test; Dart 3.0.0; PKG: json_serializable; `dart test -p chrome`"
name: "unit_test; Dart 3.4.0; PKG: json_serializable; `dart test -p chrome`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:json_serializable;commands:test_2"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:json_serializable;commands:test_2"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: "3.0.0"
sdk: "3.4.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
Expand Down Expand Up @@ -518,23 +518,23 @@ jobs:
- job_002
- job_003
job_012:
name: "ensure_build; Dart 3.0.0; PKGS: _test_yaml, checked_yaml, example; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
name: "ensure_build; Dart 3.4.0; PKGS: _test_yaml, checked_yaml, example; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:_test_yaml-checked_yaml-example;commands:test_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:_test_yaml-checked_yaml-example;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:_test_yaml-checked_yaml-example
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:_test_yaml-checked_yaml-example
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: "3.0.0"
sdk: "3.4.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
Expand Down
14 changes: 7 additions & 7 deletions _test_yaml/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ name: _test_yaml
publish_to: none

environment:
sdk: ^3.0.0
sdk: ^3.4.0

dev_dependencies:
_json_serial_shared_test:
path: ../shared_test
build_runner: ^2.0.0
build_runner: ^2.2.1
build_verify: ^3.0.0
checked_yaml: any
dart_flutter_team_lints: ^2.0.0
json_annotation: ^4.8.1
json_serializable: any
checked_yaml: ^2.0.4-wip
dart_flutter_team_lints: ^3.0.0
json_annotation: ^4.9.0
json_serializable: ^6.8.0
path: ^1.8.2
test: ^1.6.0
test: ^1.21.6
yaml: ^3.0.0

dependency_overrides:
Expand Down
2 changes: 1 addition & 1 deletion _test_yaml/test/ensure_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@TestOn('vm')
@Tags(['presubmit-only'])
library test;
library;

import 'package:build_verify/build_verify.dart';
import 'package:test/test.dart';
Expand Down
2 changes: 1 addition & 1 deletion _test_yaml/test/yaml_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

@TestOn('vm')
library test;
library;

import 'dart:io';

Expand Down
2 changes: 1 addition & 1 deletion checked_yaml/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 2.0.4-wip

- Require Dart 3.0
- Require Dart 3.4

## 2.0.3

Expand Down
10 changes: 5 additions & 5 deletions checked_yaml/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ topics:
- codegen

environment:
sdk: ^3.0.0
sdk: ^3.4.0

dependencies:
json_annotation: ^4.3.0
source_span: ^1.8.0
yaml: ^3.0.0

dev_dependencies:
build_runner: ^2.0.0
build_runner: ^2.0.6
build_verify: ^3.0.0
dart_flutter_team_lints: ^2.0.0
dart_flutter_team_lints: ^3.0.0
json_serializable: ^6.0.0
path: ^1.0.0
test: ^1.16.0
path: ^1.8.0
test: ^1.17.10
test_process: ^2.0.0

#dependency_overrides:
Expand Down
2 changes: 1 addition & 1 deletion checked_yaml/test/ensure_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@TestOn('vm')
@Tags(['presubmit-only'])
library test;
library;

import 'package:build_verify/build_verify.dart';
import 'package:test/test.dart';
Expand Down
4 changes: 2 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ dependencies to your `pubspec.yaml`.

```yaml
dependencies:
json_annotation: ^4.8.0
json_annotation: ^4.9.0

dev_dependencies:
build_runner: ^2.3.3
json_serializable: ^6.6.0
json_serializable: ^6.8.0
```

Annotate your code with classes defined in
Expand Down
10 changes: 5 additions & 5 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: example
publish_to: none

environment:
sdk: ^3.0.0
sdk: ^3.4.0

dependencies:
json_annotation: ^4.8.0
json_annotation: ^4.9.0

dev_dependencies:
# Used by tests. Not required to use `json_serializable`.
Expand All @@ -19,14 +19,14 @@ dev_dependencies:
build_verify: ^3.0.0

# Not required to use `json_serializable`.
dart_flutter_team_lints: ^2.0.0
dart_flutter_team_lints: ^3.0.0

# REQUIRED!
json_serializable: ^6.6.0
json_serializable: ^6.8.0

# Not required to use `json_serializable`.
path: ^1.8.0
test: ^1.16.0
test: ^1.21.6

# This section is used to verify changes to these packages. Do not include in
# your code!
Expand Down
2 changes: 1 addition & 1 deletion example/test/ensure_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

@Tags(['presubmit-only'])
library test;
library;

import 'package:build_verify/build_verify.dart';
import 'package:test/test.dart';
Expand Down
4 changes: 2 additions & 2 deletions example/test/readme_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ void _expect(String fileName) {

const _pubspecContent = r'''
dependencies:
json_annotation: ^4.8.0
json_annotation: ^4.9.0

dev_dependencies:
build_runner: ^2.3.3
json_serializable: ^6.6.0
json_serializable: ^6.8.0
''';
4 changes: 4 additions & 0 deletions json_annotation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.9.1-wip

- Require Dart 3.4

## 4.9.0

- Require Dart 3.0
Expand Down
2 changes: 1 addition & 1 deletion json_annotation/lib/json_annotation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// Also contains helper functions and classes – prefixed with `$` used by
/// `json_serializable` when the `use_wrappers` or `checked` options are
/// enabled.
library json_annotation;
library;

export 'src/allowed_keys_helpers.dart';
export 'src/checked_helpers.dart';
Expand Down
6 changes: 3 additions & 3 deletions json_annotation/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: json_annotation
version: 4.9.0
version: 4.9.1-wip
description: >-
Classes and helper functions that support JSON code generation via the
`json_serializable` package.
Expand All @@ -11,13 +11,13 @@ topics:
- codegen

environment:
sdk: ^3.0.0
sdk: ^3.4.0

dependencies:
meta: ^1.4.0

dev_dependencies:
dart_flutter_team_lints: ^2.0.0
dart_flutter_team_lints: ^3.0.0
# When changing JsonSerializable class.
# build_runner: ^2.0.0
# json_serializable: any
4 changes: 4 additions & 0 deletions json_serializable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.8.1-wip

- Require Dart 3.4

## 6.8.0

- Add type arguments to `Map` literals used for `Record` serialization.
Expand Down
2 changes: 1 addition & 1 deletion json_serializable/lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/// This library is **not** intended to be imported by typical end-users unless
/// you are creating a custom compilation pipeline. See documentation for
/// details, and `build.yaml` for how these builders are configured by default.
library json_serializable.builder;
library;

import 'package:build/build.dart';
import 'package:json_annotation/json_annotation.dart';
Expand Down
Loading