Skip to content

Commit 4c24e1b

Browse files
authored
Regenerate protos and update protobuf constraint (dart-archive/appengine#182)
* Allow newer protobuf versions * Regenerate protos and update protobuf constraint Improves/changes the regeneration script: * Use the protoc_plugin from the pubspec.yaml - so the constraint is fixed * Move it to `tool/` for better discovery. * Mention in `README.md` for better discovery. * Clone into `tmp/` so we don't have to redownload everything * Compile all protos in one command (much faster) * Use `dart format` instead of `dartfmt` (actually works on modern SDK). Prepares for a new publication. * Remove obsolete test script * Fix tests
1 parent fd100a9 commit 4c24e1b

File tree

819 files changed

+89928
-39311
lines changed

Some content is hidden

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

819 files changed

+89928
-39311
lines changed

pkgs/appengine/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.packages
33
.pub/
44
pubspec.lock
5+
tmp/

pkgs/appengine/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.13.8
2+
* Require `package:protobuf` ^3.1.0.
3+
14
## 0.13.7
25
* Widen dependency constraint on `package:http`.
36

pkgs/appengine/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,8 @@ This will perform a remote docker build in the cloud and deploy a new version.
166166
You can find the URL to the version that got deployed
167167
in the output of `gcloud app deploy` (as well as via the
168168
[Cloud Console](https://console.cloud.google.com) under `AppEngine > Versions`).
169+
170+
## Regenerating protobuf
171+
172+
You need to have protoc in `$PATH`.
173+
Run the `tool/fetch_protos_and_regenerate_dart.sh` script. It will fetch the latest protos and compile them for dart using the protoc_plugin in `dev_dependencies`.

pkgs/appengine/analysis_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ analyzer:
44
errors:
55
# This is triggered in generated code.
66
unnecessary_import: ignore
7+
8+
exclude:
9+
- tmp/**
Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
1-
///
1+
//
22
// Generated code. Do not modify.
33
// source: google/api/annotations.proto
44
//
55
// @dart = 2.12
6-
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
6+
7+
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
8+
// ignore_for_file: constant_identifier_names, library_prefixes
9+
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
10+
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
711

812
import 'dart:core' as $core;
913

1014
import 'package:protobuf/protobuf.dart' as $pb;
1115

12-
import 'http.pb.dart' as $0;
16+
import 'http.pb.dart' as $55;
1317

1418
class Annotations {
15-
static final http = $pb.Extension<$0.HttpRule>(
16-
const $core.bool.fromEnvironment('protobuf.omit_message_names')
17-
? ''
18-
: 'google.protobuf.MethodOptions',
19-
const $core.bool.fromEnvironment('protobuf.omit_field_names')
20-
? ''
21-
: 'http',
19+
static final http = $pb.Extension<$55.HttpRule>(
20+
_omitMessageNames ? '' : 'google.protobuf.MethodOptions',
21+
_omitFieldNames ? '' : 'http',
2222
72295728,
2323
$pb.PbFieldType.OM,
24-
defaultOrMaker: $0.HttpRule.getDefault,
25-
subBuilder: $0.HttpRule.create);
24+
defaultOrMaker: $55.HttpRule.getDefault,
25+
subBuilder: $55.HttpRule.create);
2626
static void registerAllExtensions($pb.ExtensionRegistry registry) {
2727
registry.add(http);
2828
}
2929
}
30+
31+
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
32+
const _omitMessageNames =
33+
$core.bool.fromEnvironment('protobuf.omit_message_names');
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
///
1+
//
22
// Generated code. Do not modify.
33
// source: google/api/annotations.proto
44
//
55
// @dart = 2.12
6-
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
6+
7+
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
8+
// ignore_for_file: constant_identifier_names, library_prefixes
9+
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
10+
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
///
1+
//
22
// Generated code. Do not modify.
33
// source: google/api/annotations.proto
44
//
55
// @dart = 2.12
6-
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
76

8-
import 'dart:core' as $core;
7+
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
8+
// ignore_for_file: constant_identifier_names, library_prefixes
9+
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
10+
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
11+
912
import 'dart:convert' as $convert;
13+
import 'dart:core' as $core;
1014
import 'dart:typed_data' as $typed_data;

0 commit comments

Comments
 (0)