Skip to content

Update SDK version to 3.7, reformat with 3.7 formatter #1024

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

Merged
merged 6 commits into from
Jul 11, 2025
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
44 changes: 22 additions & 22 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ jobs:
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "format_analyze; linux; Dart 3.6.0; PKG: protobuf; `dart analyze lib`, `dart analyze test`"
name: "format_analyze; linux; Dart 3.7.0; PKG: protobuf; `dart analyze lib`, `dart analyze test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf;commands:analyze_1-analyze_2"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf;commands:analyze_1-analyze_2"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: "3.6.0"
sdk: "3.7.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -191,23 +191,23 @@ jobs:
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
working-directory: protoc_plugin
job_006:
name: "run_tests; linux; Dart 3.6.0; PKG: protobuf; `dart test`"
name: "run_tests; linux; Dart 3.7.0; PKG: protobuf; `dart test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf;commands:test"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf;commands:test"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: "3.6.0"
sdk: "3.7.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand All @@ -227,23 +227,23 @@ jobs:
- job_004
- job_005
job_007:
name: "run_tests; linux; Dart 3.6.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test`"
name: "run_tests; linux; Dart 3.7.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protoc_plugin;commands:command_0-command_2-test"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protoc_plugin;commands:command_0-command_2-test"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:protoc_plugin
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protoc_plugin
os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: "3.6.0"
sdk: "3.7.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -351,23 +351,23 @@ jobs:
- job_004
- job_005
job_010:
name: "run_tests; osx; Dart 3.6.0; PKG: protobuf; `dart test`"
name: "run_tests; osx; Dart 3.7.0; PKG: protobuf; `dart test`"
runs-on: macos-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:macos-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf;commands:test"
key: "os:macos-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf;commands:test"
restore-keys: |
os:macos-latest;pub-cache-hosted;sdk:3.6.0;packages:protobuf
os:macos-latest;pub-cache-hosted;sdk:3.6.0
os:macos-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf
os:macos-latest;pub-cache-hosted;sdk:3.7.0
os:macos-latest;pub-cache-hosted
os:macos-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: "3.6.0"
sdk: "3.7.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -423,13 +423,13 @@ jobs:
- job_004
- job_005
job_012:
name: "run_tests; windows; Dart 3.6.0; PKG: protobuf; `dart test`"
name: "run_tests; windows; Dart 3.7.0; PKG: protobuf; `dart test`"
runs-on: windows-latest
steps:
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: "3.6.0"
sdk: "3.7.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down
30 changes: 19 additions & 11 deletions benchmarks/bin/deep_copy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ class Benchmark extends BenchmarkBase {
final p3.GoogleMessage1 _message1Proto3;
final GoogleMessage2 _message2;

Benchmark(super.name, List<int> message1Proto2Input,
List<int> message1Proto3Input, List<int> message2Input)
: _message1Proto2 = p2.GoogleMessage1.fromBuffer(message1Proto2Input),
_message1Proto3 = p3.GoogleMessage1.fromBuffer(message1Proto3Input),
_message2 = GoogleMessage2.fromBuffer(message2Input);
Benchmark(
super.name,
List<int> message1Proto2Input,
List<int> message1Proto3Input,
List<int> message2Input,
) : _message1Proto2 = p2.GoogleMessage1.fromBuffer(message1Proto2Input),
_message1Proto3 = p3.GoogleMessage1.fromBuffer(message1Proto3Input),
_message2 = GoogleMessage2.fromBuffer(message2Input);

@override
void run() {
Expand All @@ -33,12 +36,17 @@ class Benchmark extends BenchmarkBase {
}

void main() {
final List<int> message1Proto2Input =
readfile('datasets/google_message1_proto2.pb');
final List<int> message1Proto3Input =
readfile('datasets/google_message1_proto3.pb');
final List<int> message1Proto2Input = readfile(
'datasets/google_message1_proto2.pb',
);
final List<int> message1Proto3Input = readfile(
'datasets/google_message1_proto3.pb',
);
final List<int> message2Input = readfile('datasets/google_message2.pb');
Benchmark(
'deep_copy', message1Proto2Input, message1Proto3Input, message2Input)
.report();
'deep_copy',
message1Proto2Input,
message1Proto3Input,
message2Input,
).report();
}
32 changes: 20 additions & 12 deletions benchmarks/bin/from_binary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ class Benchmark extends BenchmarkBase {
final Uint8List _message1Proto3Input;
final Uint8List _message2Input;

Benchmark(super.name, List<int> message1Proto2Input,
List<int> message1Proto3Input, List<int> message2Input)
: _message1Proto2Input = Uint8List.fromList(message1Proto2Input),
_message1Proto3Input = Uint8List.fromList(message1Proto3Input),
_message2Input = Uint8List.fromList(message2Input);
Benchmark(
super.name,
List<int> message1Proto2Input,
List<int> message1Proto3Input,
List<int> message2Input,
) : _message1Proto2Input = Uint8List.fromList(message1Proto2Input),
_message1Proto3Input = Uint8List.fromList(message1Proto3Input),
_message2Input = Uint8List.fromList(message2Input);

@override
void run() {
Expand All @@ -32,12 +35,17 @@ class Benchmark extends BenchmarkBase {
}

void main() {
final List<int> message1Proto2Input =
readfile('datasets/google_message1_proto2.pb');
final List<int> message1Proto3Input =
readfile('datasets/google_message1_proto3.pb');
final List<int> message1Proto2Input = readfile(
'datasets/google_message1_proto2.pb',
);
final List<int> message1Proto3Input = readfile(
'datasets/google_message1_proto3.pb',
);
final List<int> message2Input = readfile('datasets/google_message2.pb');
Benchmark('from_binary', message1Proto2Input, message1Proto3Input,
message2Input)
.report();
Benchmark(
'from_binary',
message1Proto2Input,
message1Proto3Input,
message2Input,
).report();
}
38 changes: 23 additions & 15 deletions benchmarks/bin/from_json_string.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ class Benchmark extends BenchmarkBase {
final String _message1Proto3JsonString;
final String _message2JsonString;

Benchmark(super.name, List<int> message1Proto2Input,
List<int> message1Proto3Input, List<int> message2Input)
: _message1Proto2JsonString =
p2.GoogleMessage1.fromBuffer(message1Proto2Input).writeToJson(),
_message1Proto3JsonString =
p3.GoogleMessage1.fromBuffer(message1Proto3Input).writeToJson(),
_message2JsonString =
GoogleMessage2.fromBuffer(message2Input).writeToJson();
Benchmark(
super.name,
List<int> message1Proto2Input,
List<int> message1Proto3Input,
List<int> message2Input,
) : _message1Proto2JsonString =
p2.GoogleMessage1.fromBuffer(message1Proto2Input).writeToJson(),
_message1Proto3JsonString =
p3.GoogleMessage1.fromBuffer(message1Proto3Input).writeToJson(),
_message2JsonString =
GoogleMessage2.fromBuffer(message2Input).writeToJson();

@override
void run() {
Expand All @@ -33,12 +36,17 @@ class Benchmark extends BenchmarkBase {
}

void main() {
final List<int> message1Proto2Input =
readfile('datasets/google_message1_proto2.pb');
final List<int> message1Proto3Input =
readfile('datasets/google_message1_proto3.pb');
final List<int> message1Proto2Input = readfile(
'datasets/google_message1_proto2.pb',
);
final List<int> message1Proto3Input = readfile(
'datasets/google_message1_proto3.pb',
);
final List<int> message2Input = readfile('datasets/google_message2.pb');
Benchmark('from_json_string', message1Proto2Input, message1Proto3Input,
message2Input)
.report();
Benchmark(
'from_json_string',
message1Proto2Input,
message1Proto3Input,
message2Input,
).report();
}
48 changes: 29 additions & 19 deletions benchmarks/bin/from_proto3_json_object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,42 @@ class Benchmark extends BenchmarkBase {
final Object? _message1Proto3Proto3JsonObject;
final Object? _message2Proto3JsonObject;

Benchmark(super.name, List<int> message1Proto2Input,
List<int> message1Proto3Input, List<int> message2Input)
: _message1Proto2Proto3JsonObject =
p2.GoogleMessage1.fromBuffer(message1Proto2Input).toProto3Json(),
_message1Proto3Proto3JsonObject =
p3.GoogleMessage1.fromBuffer(message1Proto3Input).toProto3Json(),
_message2Proto3JsonObject =
GoogleMessage2.fromBuffer(message2Input).toProto3Json();
Benchmark(
super.name,
List<int> message1Proto2Input,
List<int> message1Proto3Input,
List<int> message2Input,
) : _message1Proto2Proto3JsonObject =
p2.GoogleMessage1.fromBuffer(message1Proto2Input).toProto3Json(),
_message1Proto3Proto3JsonObject =
p3.GoogleMessage1.fromBuffer(message1Proto3Input).toProto3Json(),
_message2Proto3JsonObject =
GoogleMessage2.fromBuffer(message2Input).toProto3Json();

@override
void run() {
p2.GoogleMessage1.create()
.mergeFromProto3Json(_message1Proto2Proto3JsonObject);
p3.GoogleMessage1.create()
.mergeFromProto3Json(_message1Proto3Proto3JsonObject);
p2.GoogleMessage1.create().mergeFromProto3Json(
_message1Proto2Proto3JsonObject,
);
p3.GoogleMessage1.create().mergeFromProto3Json(
_message1Proto3Proto3JsonObject,
);
GoogleMessage2.create().mergeFromProto3Json(_message2Proto3JsonObject);
}
}

void main() {
final List<int> message1Proto2Input =
readfile('datasets/google_message1_proto2.pb');
final List<int> message1Proto3Input =
readfile('datasets/google_message1_proto3.pb');
final List<int> message1Proto2Input = readfile(
'datasets/google_message1_proto2.pb',
);
final List<int> message1Proto3Input = readfile(
'datasets/google_message1_proto3.pb',
);
final List<int> message2Input = readfile('datasets/google_message2.pb');
Benchmark('from_proto3_json_object', message1Proto2Input, message1Proto3Input,
message2Input)
.report();
Benchmark(
'from_proto3_json_object',
message1Proto2Input,
message1Proto3Input,
message2Input,
).report();
}
Loading