Skip to content

Commit

Permalink
Fix missing protobuf import in grpc files (#845)
Browse files Browse the repository at this point in the history
Fixes #844.
  • Loading branch information
osa1 authored Jun 16, 2023
1 parent a9bf79f commit f4ffa1d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions protoc_plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 21.0.1

* Fix missing protobuf import in generated grpc files. ([#844])

[#844]: https://github.com/google/protobuf.dart/issues/844

## 21.0.0

* Identifiers `fromBuffer`, `fromJson`, `$_defaultFor`, `initByValue` are no
Expand Down
Binary file added protoc_plugin/bin/protoc_plugin.exe
Binary file not shown.
1 change: 1 addition & 0 deletions protoc_plugin/lib/src/file_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ class FileGenerator extends ProtobufContainer {
importWriter.addImport(_asyncImportUrl, prefix: asyncImportPrefix);
importWriter.addImport(_coreImportUrl, prefix: coreImportPrefix);
importWriter.addImport(_grpcImportUrl, prefix: grpcImportPrefix);
importWriter.addImport(_protobufImportUrl, prefix: protobufImportPrefix);

// Import .pb.dart files needed for requests and responses.
final imports = <FileGenerator>{};
Expand Down
2 changes: 1 addition & 1 deletion protoc_plugin/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: protoc_plugin
version: 21.0.0
version: 21.0.1
description: A protobuf protoc compiler plugin used to generate Dart code.
repository: https://github.com/google/protobuf.dart/tree/master/protoc_plugin

Expand Down
1 change: 1 addition & 0 deletions protoc_plugin/test/goldens/grpc_service.pbgrpc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'dart:async' as $async;
import 'dart:core' as $core;

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

import 'test.pb.dart' as $0;

Expand Down

0 comments on commit f4ffa1d

Please sign in to comment.