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

Require analyzer ^6.9.0, switch to using 'enclosingElement3'. #722

Merged
merged 6 commits into from
Sep 25, 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
34 changes: 17 additions & 17 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ jobs:
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "analyze_format; linux; Dart 3.5.0; PKG: source_gen; `dart analyze`"
name: "analyze_format; linux; Dart 3.6.0-270.0.dev; PKG: source_gen; `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.5.0;packages:source_gen;commands:analyze_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:source_gen;commands:analyze_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:source_gen
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:source_gen
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: "3.5.0"
sdk: "3.6.0-270.0.dev"
- id: checkout
name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down Expand Up @@ -143,23 +143,23 @@ jobs:
if: "always() && steps.source_gen_pub_upgrade.conclusion == 'success'"
working-directory: source_gen
job_004:
name: "unit_test; linux; Dart 3.5.0; PKG: example_usage; `dart test --run-skipped`"
name: "unit_test; linux; Dart 3.6.0-270.0.dev; PKG: example_usage; `dart test --run-skipped`"
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.5.0;packages:example_usage;commands:test_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:example_usage;commands:test_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:example_usage
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:example_usage
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: "3.5.0"
sdk: "3.6.0-270.0.dev"
- id: checkout
name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand All @@ -177,23 +177,23 @@ jobs:
- job_002
- job_003
job_005:
name: "unit_test; linux; Dart 3.5.0; PKG: source_gen; `dart test`"
name: "unit_test; linux; Dart 3.6.0-270.0.dev; PKG: source_gen; `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.5.0;packages:source_gen;commands:test_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:source_gen;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:source_gen
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:source_gen
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: "3.5.0"
sdk: "3.6.0-270.0.dev"
- id: checkout
name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down Expand Up @@ -279,13 +279,13 @@ jobs:
- job_002
- job_003
job_008:
name: "unit_test; windows; Dart 3.5.0; PKG: source_gen; `dart test`"
name: "unit_test; windows; Dart 3.6.0-270.0.dev; PKG: source_gen; `dart test`"
runs-on: windows-latest
steps:
- name: Setup Dart SDK
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: "3.5.0"
sdk: "3.6.0-270.0.dev"
- id: checkout
name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down
2 changes: 1 addition & 1 deletion example_usage/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ publish_to: none
resolution: workspace

environment:
sdk: ^3.5.0
sdk: ^3.6.0-270.0.dev

dependencies:
source_gen_example:
Expand Down
2 changes: 1 addition & 1 deletion source_gen/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
`GeneratorForAnnotation.generateForAnnotatedElement`.
- Support all the glob quotes.
- Require `analyzer: ^6.9.0`
- Require Dart 3.5.0
- Require Dart 3.6.0-270.0.dev
- `LibraryBuilder`, `PartBuilder`, and `SharedPartBuilder` now take an optional `writeDescriptions` boolean. When set to `false`, headers and generator descriptions for the files will not be included in the builder output.

## 1.5.0
Expand Down
4 changes: 2 additions & 2 deletions source_gen/lib/src/constants/revive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Revivable reviveInstance(DartObject object, [LibraryElement? origin]) {
if (element is MethodElement && element.isStatic) {
return Revivable._(
source: url.removeFragment(),
accessor: '${element.enclosingElement.name}.${element.name}',
accessor: '${element.enclosingElement3.name}.${element.name}',
);
}

Expand Down Expand Up @@ -81,7 +81,7 @@ Revivable reviveInstance(DartObject object, [LibraryElement? origin]) {
}
final i = (object as DartObjectImpl).getInvocation();
if (i != null) {
url = Uri.parse(urlOfElement(i.constructor.enclosingElement));
url = Uri.parse(urlOfElement(i.constructor.enclosingElement3));
final result = Revivable._(
source: url,
accessor: i.constructor.name,
Expand Down
4 changes: 2 additions & 2 deletions source_gen/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ repository: https://github.com/dart-lang/source_gen/tree/master/source_gen
resolution: workspace

environment:
sdk: ^3.5.0
sdk: ^3.6.0-270.0.dev

dependencies:
analyzer: ^6.4.0
analyzer: ^6.9.0
async: ^2.5.0
build: ^2.1.0
dart_style: ^2.3.7
Expand Down