Skip to content

Commit 04bd6ac

Browse files
authored
Update SDK version to 3.7, reformat with 3.7 formatter (#1024)
Internally we're at SDK 3.7. Because it's difficult to make changes *without* formatting in g3, contributors create CLs with accidental formatting fixes. In cl/781448639 we format the internal code, and this PR updates to the same SDK version with g3 and formats the code, making the internal and external versions of the code meet at the same SDK version and formatting settings. Manual changes in this PR: - Update pubspec.yaml files: - Bump minor versions - Bump SDK versions - Update CHANGELOGs - Update dart_style used in protoc_plugin golden tests - Regenerate mono_repo setup with `mono_repo generate` Rest of the changes are generated by `dart format`.
1 parent bce362d commit 04bd6ac

File tree

124 files changed

+7155
-4346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+7155
-4346
lines changed

.github/workflows/dart.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,23 @@ jobs:
3939
- name: mono_repo self validate
4040
run: dart pub global run mono_repo generate --validate
4141
job_002:
42-
name: "format_analyze; linux; Dart 3.6.0; PKG: protobuf; `dart analyze lib`, `dart analyze test`"
42+
name: "format_analyze; linux; Dart 3.7.0; PKG: protobuf; `dart analyze lib`, `dart analyze test`"
4343
runs-on: ubuntu-latest
4444
steps:
4545
- name: Cache Pub hosted dependencies
4646
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
4747
with:
4848
path: "~/.pub-cache/hosted"
49-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf;commands:analyze_1-analyze_2"
49+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf;commands:analyze_1-analyze_2"
5050
restore-keys: |
51-
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf
52-
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
51+
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf
52+
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0
5353
os:ubuntu-latest;pub-cache-hosted
5454
os:ubuntu-latest
5555
- name: Setup Dart SDK
5656
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
5757
with:
58-
sdk: "3.6.0"
58+
sdk: "3.7.0"
5959
- id: checkout
6060
name: Checkout repository
6161
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
@@ -191,23 +191,23 @@ jobs:
191191
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
192192
working-directory: protoc_plugin
193193
job_006:
194-
name: "run_tests; linux; Dart 3.6.0; PKG: protobuf; `dart test`"
194+
name: "run_tests; linux; Dart 3.7.0; PKG: protobuf; `dart test`"
195195
runs-on: ubuntu-latest
196196
steps:
197197
- name: Cache Pub hosted dependencies
198198
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
199199
with:
200200
path: "~/.pub-cache/hosted"
201-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf;commands:test"
201+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf;commands:test"
202202
restore-keys: |
203-
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf
204-
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
203+
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf
204+
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0
205205
os:ubuntu-latest;pub-cache-hosted
206206
os:ubuntu-latest
207207
- name: Setup Dart SDK
208208
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
209209
with:
210-
sdk: "3.6.0"
210+
sdk: "3.7.0"
211211
- id: checkout
212212
name: Checkout repository
213213
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
@@ -227,23 +227,23 @@ jobs:
227227
- job_004
228228
- job_005
229229
job_007:
230-
name: "run_tests; linux; Dart 3.6.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test`"
230+
name: "run_tests; linux; Dart 3.7.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test`"
231231
runs-on: ubuntu-latest
232232
steps:
233233
- name: Cache Pub hosted dependencies
234234
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
235235
with:
236236
path: "~/.pub-cache/hosted"
237-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protoc_plugin;commands:command_0-command_2-test"
237+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protoc_plugin;commands:command_0-command_2-test"
238238
restore-keys: |
239-
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protoc_plugin
240-
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
239+
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protoc_plugin
240+
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0
241241
os:ubuntu-latest;pub-cache-hosted
242242
os:ubuntu-latest
243243
- name: Setup Dart SDK
244244
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
245245
with:
246-
sdk: "3.6.0"
246+
sdk: "3.7.0"
247247
- id: checkout
248248
name: Checkout repository
249249
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
@@ -351,23 +351,23 @@ jobs:
351351
- job_004
352352
- job_005
353353
job_010:
354-
name: "run_tests; osx; Dart 3.6.0; PKG: protobuf; `dart test`"
354+
name: "run_tests; osx; Dart 3.7.0; PKG: protobuf; `dart test`"
355355
runs-on: macos-latest
356356
steps:
357357
- name: Cache Pub hosted dependencies
358358
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
359359
with:
360360
path: "~/.pub-cache/hosted"
361-
key: "os:macos-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf;commands:test"
361+
key: "os:macos-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf;commands:test"
362362
restore-keys: |
363-
os:macos-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf
364-
os:macos-latest;pub-cache-hosted;sdk:3.6.0
363+
os:macos-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf
364+
os:macos-latest;pub-cache-hosted;sdk:3.7.0
365365
os:macos-latest;pub-cache-hosted
366366
os:macos-latest
367367
- name: Setup Dart SDK
368368
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
369369
with:
370-
sdk: "3.6.0"
370+
sdk: "3.7.0"
371371
- id: checkout
372372
name: Checkout repository
373373
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
@@ -423,13 +423,13 @@ jobs:
423423
- job_004
424424
- job_005
425425
job_012:
426-
name: "run_tests; windows; Dart 3.6.0; PKG: protobuf; `dart test`"
426+
name: "run_tests; windows; Dart 3.7.0; PKG: protobuf; `dart test`"
427427
runs-on: windows-latest
428428
steps:
429429
- name: Setup Dart SDK
430430
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
431431
with:
432-
sdk: "3.6.0"
432+
sdk: "3.7.0"
433433
- id: checkout
434434
name: Checkout repository
435435
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

benchmarks/bin/deep_copy.dart

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ class Benchmark extends BenchmarkBase {
1515
final p3.GoogleMessage1 _message1Proto3;
1616
final GoogleMessage2 _message2;
1717

18-
Benchmark(super.name, List<int> message1Proto2Input,
19-
List<int> message1Proto3Input, List<int> message2Input)
20-
: _message1Proto2 = p2.GoogleMessage1.fromBuffer(message1Proto2Input),
21-
_message1Proto3 = p3.GoogleMessage1.fromBuffer(message1Proto3Input),
22-
_message2 = GoogleMessage2.fromBuffer(message2Input);
18+
Benchmark(
19+
super.name,
20+
List<int> message1Proto2Input,
21+
List<int> message1Proto3Input,
22+
List<int> message2Input,
23+
) : _message1Proto2 = p2.GoogleMessage1.fromBuffer(message1Proto2Input),
24+
_message1Proto3 = p3.GoogleMessage1.fromBuffer(message1Proto3Input),
25+
_message2 = GoogleMessage2.fromBuffer(message2Input);
2326

2427
@override
2528
void run() {
@@ -33,12 +36,17 @@ class Benchmark extends BenchmarkBase {
3336
}
3437

3538
void main() {
36-
final List<int> message1Proto2Input =
37-
readfile('datasets/google_message1_proto2.pb');
38-
final List<int> message1Proto3Input =
39-
readfile('datasets/google_message1_proto3.pb');
39+
final List<int> message1Proto2Input = readfile(
40+
'datasets/google_message1_proto2.pb',
41+
);
42+
final List<int> message1Proto3Input = readfile(
43+
'datasets/google_message1_proto3.pb',
44+
);
4045
final List<int> message2Input = readfile('datasets/google_message2.pb');
4146
Benchmark(
42-
'deep_copy', message1Proto2Input, message1Proto3Input, message2Input)
43-
.report();
47+
'deep_copy',
48+
message1Proto2Input,
49+
message1Proto3Input,
50+
message2Input,
51+
).report();
4452
}

benchmarks/bin/from_binary.dart

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ class Benchmark extends BenchmarkBase {
1717
final Uint8List _message1Proto3Input;
1818
final Uint8List _message2Input;
1919

20-
Benchmark(super.name, List<int> message1Proto2Input,
21-
List<int> message1Proto3Input, List<int> message2Input)
22-
: _message1Proto2Input = Uint8List.fromList(message1Proto2Input),
23-
_message1Proto3Input = Uint8List.fromList(message1Proto3Input),
24-
_message2Input = Uint8List.fromList(message2Input);
20+
Benchmark(
21+
super.name,
22+
List<int> message1Proto2Input,
23+
List<int> message1Proto3Input,
24+
List<int> message2Input,
25+
) : _message1Proto2Input = Uint8List.fromList(message1Proto2Input),
26+
_message1Proto3Input = Uint8List.fromList(message1Proto3Input),
27+
_message2Input = Uint8List.fromList(message2Input);
2528

2629
@override
2730
void run() {
@@ -32,12 +35,17 @@ class Benchmark extends BenchmarkBase {
3235
}
3336

3437
void main() {
35-
final List<int> message1Proto2Input =
36-
readfile('datasets/google_message1_proto2.pb');
37-
final List<int> message1Proto3Input =
38-
readfile('datasets/google_message1_proto3.pb');
38+
final List<int> message1Proto2Input = readfile(
39+
'datasets/google_message1_proto2.pb',
40+
);
41+
final List<int> message1Proto3Input = readfile(
42+
'datasets/google_message1_proto3.pb',
43+
);
3944
final List<int> message2Input = readfile('datasets/google_message2.pb');
40-
Benchmark('from_binary', message1Proto2Input, message1Proto3Input,
41-
message2Input)
42-
.report();
45+
Benchmark(
46+
'from_binary',
47+
message1Proto2Input,
48+
message1Proto3Input,
49+
message2Input,
50+
).report();
4351
}

benchmarks/bin/from_json_string.dart

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ class Benchmark extends BenchmarkBase {
1515
final String _message1Proto3JsonString;
1616
final String _message2JsonString;
1717

18-
Benchmark(super.name, List<int> message1Proto2Input,
19-
List<int> message1Proto3Input, List<int> message2Input)
20-
: _message1Proto2JsonString =
21-
p2.GoogleMessage1.fromBuffer(message1Proto2Input).writeToJson(),
22-
_message1Proto3JsonString =
23-
p3.GoogleMessage1.fromBuffer(message1Proto3Input).writeToJson(),
24-
_message2JsonString =
25-
GoogleMessage2.fromBuffer(message2Input).writeToJson();
18+
Benchmark(
19+
super.name,
20+
List<int> message1Proto2Input,
21+
List<int> message1Proto3Input,
22+
List<int> message2Input,
23+
) : _message1Proto2JsonString =
24+
p2.GoogleMessage1.fromBuffer(message1Proto2Input).writeToJson(),
25+
_message1Proto3JsonString =
26+
p3.GoogleMessage1.fromBuffer(message1Proto3Input).writeToJson(),
27+
_message2JsonString =
28+
GoogleMessage2.fromBuffer(message2Input).writeToJson();
2629

2730
@override
2831
void run() {
@@ -33,12 +36,17 @@ class Benchmark extends BenchmarkBase {
3336
}
3437

3538
void main() {
36-
final List<int> message1Proto2Input =
37-
readfile('datasets/google_message1_proto2.pb');
38-
final List<int> message1Proto3Input =
39-
readfile('datasets/google_message1_proto3.pb');
39+
final List<int> message1Proto2Input = readfile(
40+
'datasets/google_message1_proto2.pb',
41+
);
42+
final List<int> message1Proto3Input = readfile(
43+
'datasets/google_message1_proto3.pb',
44+
);
4045
final List<int> message2Input = readfile('datasets/google_message2.pb');
41-
Benchmark('from_json_string', message1Proto2Input, message1Proto3Input,
42-
message2Input)
43-
.report();
46+
Benchmark(
47+
'from_json_string',
48+
message1Proto2Input,
49+
message1Proto3Input,
50+
message2Input,
51+
).report();
4452
}

benchmarks/bin/from_proto3_json_object.dart

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,42 @@ class Benchmark extends BenchmarkBase {
1515
final Object? _message1Proto3Proto3JsonObject;
1616
final Object? _message2Proto3JsonObject;
1717

18-
Benchmark(super.name, List<int> message1Proto2Input,
19-
List<int> message1Proto3Input, List<int> message2Input)
20-
: _message1Proto2Proto3JsonObject =
21-
p2.GoogleMessage1.fromBuffer(message1Proto2Input).toProto3Json(),
22-
_message1Proto3Proto3JsonObject =
23-
p3.GoogleMessage1.fromBuffer(message1Proto3Input).toProto3Json(),
24-
_message2Proto3JsonObject =
25-
GoogleMessage2.fromBuffer(message2Input).toProto3Json();
18+
Benchmark(
19+
super.name,
20+
List<int> message1Proto2Input,
21+
List<int> message1Proto3Input,
22+
List<int> message2Input,
23+
) : _message1Proto2Proto3JsonObject =
24+
p2.GoogleMessage1.fromBuffer(message1Proto2Input).toProto3Json(),
25+
_message1Proto3Proto3JsonObject =
26+
p3.GoogleMessage1.fromBuffer(message1Proto3Input).toProto3Json(),
27+
_message2Proto3JsonObject =
28+
GoogleMessage2.fromBuffer(message2Input).toProto3Json();
2629

2730
@override
2831
void run() {
29-
p2.GoogleMessage1.create()
30-
.mergeFromProto3Json(_message1Proto2Proto3JsonObject);
31-
p3.GoogleMessage1.create()
32-
.mergeFromProto3Json(_message1Proto3Proto3JsonObject);
32+
p2.GoogleMessage1.create().mergeFromProto3Json(
33+
_message1Proto2Proto3JsonObject,
34+
);
35+
p3.GoogleMessage1.create().mergeFromProto3Json(
36+
_message1Proto3Proto3JsonObject,
37+
);
3338
GoogleMessage2.create().mergeFromProto3Json(_message2Proto3JsonObject);
3439
}
3540
}
3641

3742
void main() {
38-
final List<int> message1Proto2Input =
39-
readfile('datasets/google_message1_proto2.pb');
40-
final List<int> message1Proto3Input =
41-
readfile('datasets/google_message1_proto3.pb');
43+
final List<int> message1Proto2Input = readfile(
44+
'datasets/google_message1_proto2.pb',
45+
);
46+
final List<int> message1Proto3Input = readfile(
47+
'datasets/google_message1_proto3.pb',
48+
);
4249
final List<int> message2Input = readfile('datasets/google_message2.pb');
43-
Benchmark('from_proto3_json_object', message1Proto2Input, message1Proto3Input,
44-
message2Input)
45-
.report();
50+
Benchmark(
51+
'from_proto3_json_object',
52+
message1Proto2Input,
53+
message1Proto3Input,
54+
message2Input,
55+
).report();
4656
}

0 commit comments

Comments
 (0)