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

⬆️ Bump Dart SDK constraint to ">=2.17.0 <4.0.0" #417

Merged
merged 3 commits into from
May 12, 2023
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
98 changes: 50 additions & 48 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.4.2
# Created with package:mono_repo v6.5.5
name: Dart CI
on:
push:
Expand All @@ -22,30 +22,66 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: stable
- id: checkout
name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: mono_repo self validate
run: dart pub global activate mono_repo 6.4.2
run: dart pub global activate mono_repo 6.5.5
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "analyze_and_format; PKG: chopper; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper;commands:format-analyze"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper
os:ubuntu-latest;pub-cache-hosted;sdk:stable
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: stable
- id: checkout
name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- id: chopper_pub_upgrade
name: chopper; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: chopper
- name: "chopper; dart format --output=none --set-exit-if-changed ."
run: "dart format --output=none --set-exit-if-changed ."
if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'"
working-directory: chopper
- name: "chopper; dart analyze --fatal-infos ."
run: dart analyze --fatal-infos .
if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'"
working-directory: chopper
needs:
- job_001
job_003:
name: "analyzer_and_format; PKGS: chopper_built_value, chopper_generator; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper_built_value-chopper_generator;commands:format-analyze"
Expand All @@ -55,12 +91,12 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: stable
- id: checkout
name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- id: chopper_built_value_pub_upgrade
name: chopper_built_value; dart pub upgrade
run: dart pub upgrade
Expand All @@ -87,40 +123,6 @@ jobs:
run: dart analyze --fatal-infos .
if: "always() && steps.chopper_generator_pub_upgrade.conclusion == 'success'"
working-directory: chopper_generator
job_003:
name: "analyze_and_format; PKG: chopper; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper;commands:format-analyze"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper
os:ubuntu-latest;pub-cache-hosted;sdk:stable
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
with:
sdk: stable
- id: checkout
name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- id: chopper_pub_upgrade
name: chopper; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: chopper
- name: "chopper; dart format --output=none --set-exit-if-changed ."
run: "dart format --output=none --set-exit-if-changed ."
if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'"
working-directory: chopper
- name: "chopper; dart analyze --fatal-infos ."
run: dart analyze --fatal-infos .
if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'"
working-directory: chopper
needs:
- job_001
- job_002
Expand All @@ -129,7 +131,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value;commands:test_1"
Expand All @@ -139,12 +141,12 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: stable
- id: checkout
name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- id: chopper_pub_upgrade
name: chopper; dart pub upgrade
run: dart pub upgrade
Expand Down Expand Up @@ -172,7 +174,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value;commands:test_0"
Expand All @@ -182,12 +184,12 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: stable
- id: checkout
name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- id: chopper_pub_upgrade
name: chopper; dart pub upgrade
run: dart pub upgrade
Expand Down
4 changes: 2 additions & 2 deletions chopper/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: chopper
description: Chopper is an http client generator using source_gen, inspired by Retrofit
version: 6.0.0
version: 6.1.2
documentation: https://hadrien-lejard.gitbook.io/chopper
repository: https://github.com/lejard-h/chopper

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=2.17.0 <4.0.0"

dependencies:
equatable: ^2.0.5
Expand Down
6 changes: 3 additions & 3 deletions chopper_built_value/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: chopper_built_value
description: A built_value based Converter for Chopper.
version: 1.1.0
version: 1.2.1
documentation: https://hadrien-lejard.gitbook.io/chopper/converters/built-value-converter
repository: https://github.com/lejard-h/chopper

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=2.17.0 <4.0.0"

dependencies:
built_value: ^8.0.0
Expand All @@ -18,7 +18,7 @@ dev_dependencies:
build_runner: ^2.0.0
build_test: ^2.0.0
built_value_generator: ^8.0.6
dart_code_metrics: ^4.8.1
dart_code_metrics: '>=4.8.1 <6.0.0'
lints: ^2.0.0

dependency_overrides:
Expand Down
13 changes: 10 additions & 3 deletions chopper_built_value/test/data.g.dart

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

4 changes: 2 additions & 2 deletions chopper_built_value/test/serializers.g.dart

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

4 changes: 4 additions & 0 deletions chopper_generator/lib/src/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,12 @@ class ChopperGenerator extends GeneratorForAnnotation<chopper.ChopperApi> {
});
}

/// TODO: Upgrade to `Element.enclosingElement` when analyzer 6.0.0 is released; in the mean time ignore the deprecation warning
/// https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/CHANGELOG.md#520
String _factoryForFunction(FunctionTypedElement function) =>
// ignore: deprecated_member_use
function.enclosingElement3 is ClassElement
// ignore: deprecated_member_use
? '${function.enclosingElement3!.name}.${function.name}'
: function.name!;

Expand Down
6 changes: 3 additions & 3 deletions chopper_generator/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: chopper_generator
description: Chopper is an http client generator using source_gen, inspired by Retrofit
version: 6.0.0
version: 6.0.1
documentation: https://hadrien-lejard.gitbook.io/chopper
repository: https://github.com/lejard-h/chopper

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=2.17.0 <4.0.0"

dependencies:
analyzer: '>=4.4.0 <6.0.0'
Expand All @@ -20,7 +20,7 @@ dependencies:

dev_dependencies:
test: ^1.16.4
dart_code_metrics: ^4.8.1
dart_code_metrics: '>=4.8.1 <6.0.0'
lints: ^2.0.0

dependency_overrides:
Expand Down
2 changes: 1 addition & 1 deletion example/lib/built_value_resource.chopper.dart

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

16 changes: 12 additions & 4 deletions example/lib/built_value_resource.g.dart

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

4 changes: 2 additions & 2 deletions example/lib/built_value_serializers.g.dart

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

2 changes: 1 addition & 1 deletion example/lib/json_decode_service.activator.g.dart

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

4 changes: 2 additions & 2 deletions example/lib/json_decode_service.vm.g.dart

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

Loading