Skip to content

Commit c1db6ba

Browse files
authored
Require analyzer ^6.9.0, switch to using 'enclosingElement3'. (#722)
Prepare for https://dart-review.googlesource.com/c/sdk/+/385100
1 parent d4a1f27 commit c1db6ba

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

.github/workflows/dart.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,23 @@ jobs:
4040
- name: mono_repo self validate
4141
run: dart pub global run mono_repo generate --validate
4242
job_002:
43-
name: "analyze_format; linux; Dart 3.5.0; PKG: source_gen; `dart analyze`"
43+
name: "analyze_format; linux; Dart 3.6.0-270.0.dev; PKG: source_gen; `dart analyze`"
4444
runs-on: ubuntu-latest
4545
steps:
4646
- name: Cache Pub hosted dependencies
4747
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
4848
with:
4949
path: "~/.pub-cache/hosted"
50-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:source_gen;commands:analyze_1"
50+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:source_gen;commands:analyze_1"
5151
restore-keys: |
52-
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:source_gen
53-
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
52+
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:source_gen
53+
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev
5454
os:ubuntu-latest;pub-cache-hosted
5555
os:ubuntu-latest
5656
- name: Setup Dart SDK
5757
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
5858
with:
59-
sdk: "3.5.0"
59+
sdk: "3.6.0-270.0.dev"
6060
- id: checkout
6161
name: Checkout repository
6262
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
@@ -143,23 +143,23 @@ jobs:
143143
if: "always() && steps.source_gen_pub_upgrade.conclusion == 'success'"
144144
working-directory: source_gen
145145
job_004:
146-
name: "unit_test; linux; Dart 3.5.0; PKG: example_usage; `dart test --run-skipped`"
146+
name: "unit_test; linux; Dart 3.6.0-270.0.dev; PKG: example_usage; `dart test --run-skipped`"
147147
runs-on: ubuntu-latest
148148
steps:
149149
- name: Cache Pub hosted dependencies
150150
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
151151
with:
152152
path: "~/.pub-cache/hosted"
153-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:example_usage;commands:test_0"
153+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:example_usage;commands:test_0"
154154
restore-keys: |
155-
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:example_usage
156-
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
155+
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:example_usage
156+
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev
157157
os:ubuntu-latest;pub-cache-hosted
158158
os:ubuntu-latest
159159
- name: Setup Dart SDK
160160
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
161161
with:
162-
sdk: "3.5.0"
162+
sdk: "3.6.0-270.0.dev"
163163
- id: checkout
164164
name: Checkout repository
165165
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
@@ -177,23 +177,23 @@ jobs:
177177
- job_002
178178
- job_003
179179
job_005:
180-
name: "unit_test; linux; Dart 3.5.0; PKG: source_gen; `dart test`"
180+
name: "unit_test; linux; Dart 3.6.0-270.0.dev; PKG: source_gen; `dart test`"
181181
runs-on: ubuntu-latest
182182
steps:
183183
- name: Cache Pub hosted dependencies
184184
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
185185
with:
186186
path: "~/.pub-cache/hosted"
187-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:source_gen;commands:test_1"
187+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:source_gen;commands:test_1"
188188
restore-keys: |
189-
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:source_gen
190-
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0
189+
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev;packages:source_gen
190+
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0-270.0.dev
191191
os:ubuntu-latest;pub-cache-hosted
192192
os:ubuntu-latest
193193
- name: Setup Dart SDK
194194
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
195195
with:
196-
sdk: "3.5.0"
196+
sdk: "3.6.0-270.0.dev"
197197
- id: checkout
198198
name: Checkout repository
199199
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
@@ -279,13 +279,13 @@ jobs:
279279
- job_002
280280
- job_003
281281
job_008:
282-
name: "unit_test; windows; Dart 3.5.0; PKG: source_gen; `dart test`"
282+
name: "unit_test; windows; Dart 3.6.0-270.0.dev; PKG: source_gen; `dart test`"
283283
runs-on: windows-latest
284284
steps:
285285
- name: Setup Dart SDK
286286
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
287287
with:
288-
sdk: "3.5.0"
288+
sdk: "3.6.0-270.0.dev"
289289
- id: checkout
290290
name: Checkout repository
291291
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

example_usage/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ publish_to: none
33
resolution: workspace
44

55
environment:
6-
sdk: ^3.5.0
6+
sdk: ^3.6.0-270.0.dev
77

88
dependencies:
99
source_gen_example:

source_gen/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
`GeneratorForAnnotation.generateForAnnotatedElement`.
1010
- Support all the glob quotes.
1111
- Require `analyzer: ^6.9.0`
12-
- Require Dart 3.5.0
12+
- Require Dart 3.6.0-270.0.dev
1313
- `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.
1414

1515
## 1.5.0

source_gen/lib/src/constants/revive.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Revivable reviveInstance(DartObject object, [LibraryElement? origin]) {
4343
if (element is MethodElement && element.isStatic) {
4444
return Revivable._(
4545
source: url.removeFragment(),
46-
accessor: '${element.enclosingElement.name}.${element.name}',
46+
accessor: '${element.enclosingElement3.name}.${element.name}',
4747
);
4848
}
4949

@@ -81,7 +81,7 @@ Revivable reviveInstance(DartObject object, [LibraryElement? origin]) {
8181
}
8282
final i = (object as DartObjectImpl).getInvocation();
8383
if (i != null) {
84-
url = Uri.parse(urlOfElement(i.constructor.enclosingElement));
84+
url = Uri.parse(urlOfElement(i.constructor.enclosingElement3));
8585
final result = Revivable._(
8686
source: url,
8787
accessor: i.constructor.name,

source_gen/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ repository: https://github.com/dart-lang/source_gen/tree/master/source_gen
66
resolution: workspace
77

88
environment:
9-
sdk: ^3.5.0
9+
sdk: ^3.6.0-270.0.dev
1010

1111
dependencies:
12-
analyzer: ^6.4.0
12+
analyzer: ^6.9.0
1313
async: ^2.5.0
1414
build: ^2.1.0
1515
dart_style: ^2.3.7

0 commit comments

Comments
 (0)