Skip to content

Commit

Permalink
Regenerate protos and update protobuf constraint (dart-archive/appeng…
Browse files Browse the repository at this point in the history
…ine#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
  • Loading branch information
sigurdm authored Sep 10, 2024
1 parent fd100a9 commit 4c24e1b
Show file tree
Hide file tree
Showing 819 changed files with 89,928 additions and 39,311 deletions.
1 change: 1 addition & 0 deletions pkgs/appengine/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.packages
.pub/
pubspec.lock
tmp/
3 changes: 3 additions & 0 deletions pkgs/appengine/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.13.8
* Require `package:protobuf` ^3.1.0.

## 0.13.7
* Widen dependency constraint on `package:http`.

Expand Down
5 changes: 5 additions & 0 deletions pkgs/appengine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,8 @@ This will perform a remote docker build in the cloud and deploy a new version.
You can find the URL to the version that got deployed
in the output of `gcloud app deploy` (as well as via the
[Cloud Console](https://console.cloud.google.com) under `AppEngine > Versions`).

## Regenerating protobuf

You need to have protoc in `$PATH`.
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`.
3 changes: 3 additions & 0 deletions pkgs/appengine/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ analyzer:
errors:
# This is triggered in generated code.
unnecessary_import: ignore

exclude:
- tmp/**
28 changes: 16 additions & 12 deletions pkgs/appengine/lib/src/grpc_api/dart/google/api/annotations.pb.dart
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
///
//
// Generated code. Do not modify.
// source: google/api/annotations.proto
//
// @dart = 2.12
// 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

// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names, library_prefixes
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import

import 'dart:core' as $core;

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

import 'http.pb.dart' as $0;
import 'http.pb.dart' as $55;

class Annotations {
static final http = $pb.Extension<$0.HttpRule>(
const $core.bool.fromEnvironment('protobuf.omit_message_names')
? ''
: 'google.protobuf.MethodOptions',
const $core.bool.fromEnvironment('protobuf.omit_field_names')
? ''
: 'http',
static final http = $pb.Extension<$55.HttpRule>(
_omitMessageNames ? '' : 'google.protobuf.MethodOptions',
_omitFieldNames ? '' : 'http',
72295728,
$pb.PbFieldType.OM,
defaultOrMaker: $0.HttpRule.getDefault,
subBuilder: $0.HttpRule.create);
defaultOrMaker: $55.HttpRule.getDefault,
subBuilder: $55.HttpRule.create);
static void registerAllExtensions($pb.ExtensionRegistry registry) {
registry.add(http);
}
}

const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
const _omitMessageNames =
$core.bool.fromEnvironment('protobuf.omit_message_names');
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
///
//
// Generated code. Do not modify.
// source: google/api/annotations.proto
//
// @dart = 2.12
// 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

// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names, library_prefixes
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
///
//
// Generated code. Do not modify.
// source: google/api/annotations.proto
//
// @dart = 2.12
// 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

import 'dart:core' as $core;
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names, library_prefixes
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import

import 'dart:convert' as $convert;
import 'dart:core' as $core;
import 'dart:typed_data' as $typed_data;
Loading

0 comments on commit 4c24e1b

Please sign in to comment.