Skip to content

Commit

Permalink
Merge branch 'master' into 1380
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfccp committed Dec 17, 2024
2 parents 54ff615 + d8311be commit f97850f
Show file tree
Hide file tree
Showing 34 changed files with 130 additions and 94 deletions.
86 changes: 43 additions & 43 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: stable
- id: checkout
Expand All @@ -40,23 +40,23 @@ jobs:
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "analyzer_and_format; Dart 3.5.0; PKGS: _test_yaml, checked_yaml, example, json_annotation, json_serializable; `dart analyze`"
name: "analyzer_and_format; Dart 3.6.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@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable;commands:analyze_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable;commands:analyze_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "3.5.0"
sdk: "3.6.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: dev
- id: checkout
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.5.0; PKGS: _test_yaml, checked_yaml, example, json_serializable; `dart test`"
name: "unit_test; Dart 3.6.0; PKGS: _test_yaml, checked_yaml, example, json_serializable; `dart test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:_test_yaml-checked_yaml-example-json_serializable;commands:test_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:_test_yaml-checked_yaml-example-json_serializable;commands:test_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:_test_yaml-checked_yaml-example-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:_test_yaml-checked_yaml-example-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "3.5.0"
sdk: "3.6.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -253,23 +253,23 @@ jobs:
- job_002
- job_003
job_005:
name: "unit_test; Dart 3.5.0; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/annotation_version_test.dart`"
name: "unit_test; Dart 3.6.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@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:json_serializable;commands:test_3"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:json_serializable;commands:test_3"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "3.5.0"
sdk: "3.6.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand All @@ -287,23 +287,23 @@ jobs:
- job_002
- job_003
job_006:
name: "unit_test; Dart 3.5.0; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
name: "unit_test; Dart 3.6.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@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:json_serializable;commands:test_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:json_serializable;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "3.5.0"
sdk: "3.6.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand All @@ -321,23 +321,23 @@ jobs:
- job_002
- job_003
job_007:
name: "unit_test; Dart 3.5.0; PKG: json_serializable; `dart test -p chrome`"
name: "unit_test; Dart 3.6.0; PKG: json_serializable; `dart test -p chrome`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:json_serializable;commands:test_2"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:json_serializable;commands:test_2"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "3.5.0"
sdk: "3.6.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -369,7 +369,7 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: dev
- id: checkout
Expand Down Expand Up @@ -430,7 +430,7 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: dev
- id: checkout
Expand Down Expand Up @@ -464,7 +464,7 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: dev
- id: checkout
Expand Down Expand Up @@ -498,7 +498,7 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: dev
- id: checkout
Expand All @@ -518,23 +518,23 @@ jobs:
- job_002
- job_003
job_012:
name: "ensure_build; Dart 3.5.0; PKGS: _test_yaml, checked_yaml, example; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
name: "ensure_build; Dart 3.6.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@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:_test_yaml-checked_yaml-example;commands:test_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:_test_yaml-checked_yaml-example;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:_test_yaml-checked_yaml-example
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:_test_yaml-checked_yaml-example
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "3.5.0"
sdk: "3.6.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -592,7 +592,7 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: dev
- id: checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown_linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: DavidAnson/markdownlint-cli2-action@db43aef879112c3119a410d69f66701e0d530809
- uses: DavidAnson/markdownlint-cli2-action@eb5ca3ab411449c66620fe7f1b3c9e10547144b0
2 changes: 1 addition & 1 deletion _test_yaml/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: _test_yaml
publish_to: none

environment:
sdk: ^3.5.0
sdk: ^3.6.0

resolution: workspace

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.5
- Require Dart 3.6

## 2.0.3

Expand Down
2 changes: 1 addition & 1 deletion checked_yaml/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ topics:
- codegen

environment:
sdk: ^3.5.0
sdk: ^3.6.0

resolution: workspace

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: example
publish_to: none

environment:
sdk: ^3.5.0
sdk: ^3.6.0

resolution: workspace

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

- Require Dart 3.5
- Require Dart 3.6

## 4.9.0

Expand Down
2 changes: 1 addition & 1 deletion json_annotation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ topics:
- codegen

environment:
sdk: ^3.5.0
sdk: ^3.6.0

resolution: workspace

Expand Down
9 changes: 9 additions & 0 deletions json_serializable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 6.9.2

- Support the latest `package:analyzer`.

## 6.9.1

- Support the latest `package:source_gen`.
- Require Dart 3.6

## 6.9.0

- Use conditional map syntax to clean up `null` handling in `toJson` functions.
Expand Down
7 changes: 1 addition & 6 deletions json_serializable/lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ Builder jsonSerializable(BuilderOptions options) {
lines.add(e.innerError.toString());
}

throw StateError(
lines
.join('\n')
// TODO(kevmoo) remove when dart-lang/sdk#50756 is fixed!
.replaceAll(" of ' in type cast'", ' in type cast'),
);
throw StateError(lines.join('\n'));
}
}
16 changes: 6 additions & 10 deletions json_serializable/lib/src/field_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// TODO: Waiting until Dart 3.6 so we can pin a stable Dart SDK compatible w/ latest
// analyzer
// ignore_for_file: deprecated_member_use

import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/dart/element/inheritance_manager3.dart' // ignore: implementation_imports
show
Expand Down Expand Up @@ -41,21 +37,21 @@ class _FieldSet implements Comparable<_FieldSet> {

static int _sortByLocation(FieldElement a, FieldElement b) {
final checkerA = TypeChecker.fromStatic(
(a.enclosingElement as InterfaceElement).thisType,
(a.enclosingElement3 as InterfaceElement).thisType,
);

if (!checkerA.isExactly(b.enclosingElement)) {
if (!checkerA.isExactly(b.enclosingElement3)) {
// in this case, you want to prioritize the enclosingElement that is more
// "super".

if (checkerA.isAssignableFrom(b.enclosingElement)) {
if (checkerA.isAssignableFrom(b.enclosingElement3)) {
return -1;
}

final checkerB = TypeChecker.fromStatic(
(b.enclosingElement as InterfaceElement).thisType);
(b.enclosingElement3 as InterfaceElement).thisType);

if (checkerB.isAssignableFrom(a.enclosingElement)) {
if (checkerB.isAssignableFrom(a.enclosingElement3)) {
return 1;
}
}
Expand Down Expand Up @@ -87,7 +83,7 @@ List<FieldElement> createSortedFieldSet(ClassElement element) {

for (final v in manager.getInheritedConcreteMap2(element).values) {
assert(v is! FieldElement);
if (_dartCoreObjectChecker.isExactly(v.enclosingElement)) {
if (_dartCoreObjectChecker.isExactly(v.enclosingElement3)) {
continue;
}

Expand Down
Loading

0 comments on commit f97850f

Please sign in to comment.