Skip to content

Commit 8c22ab8

Browse files
authored
Include the source file name in the generated header (flutter#125)
1 parent ed85e03 commit 8c22ab8

20 files changed

+24
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
## 0.10.2
2+
3+
* Add link to source file in generated code.
4+
15
## 0.10.1
26

3-
* Breaking change: Prefix generated Dart proto imports by proto file path instead of by package.
7+
* Prefix generated Dart proto imports by proto file path instead of by package.
48
Tighten up member name checks for generated enum classes.
5-
Requires package:protobuf version 0.10.2 or newer.
69

710
## 0.10.0
811

lib/file_generator.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ import 'package:grpc/grpc.dart';
510510
out.println('''
511511
///
512512
// Generated code. Do not modify.
513+
// source: ${descriptor.name}
513514
///
514515
// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
515516
''');

lib/src/dart_options.pb.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
///
22
// Generated code. Do not modify.
3+
// source: dart_options.proto
34
///
45
// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
56

lib/src/descriptor.pb.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
///
22
// Generated code. Do not modify.
3+
// source: descriptor.proto
34
///
45
// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
56

lib/src/descriptor.pbenum.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
///
22
// Generated code. Do not modify.
3+
// source: descriptor.proto
34
///
45
// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
56

lib/src/plugin.pb.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
///
22
// Generated code. Do not modify.
3+
// source: plugin.proto
34
///
45
// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
56

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: protoc_plugin
2-
version: 0.10.1
2+
version: 0.10.2
33
author: Dart Team <[email protected]>
44
description: Protoc compiler plugin to generate Dart code
55
homepage: https://github.com/dart-lang/dart-protoc-plugin

test/goldens/grpc_service.pb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
///
22
// Generated code. Do not modify.
3+
// source: test
34
///
45
// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
56

test/goldens/grpc_service.pbgrpc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
///
22
// Generated code. Do not modify.
3+
// source: test
34
///
45
// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
56

test/goldens/header_in_package.pb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
///
22
// Generated code. Do not modify.
3+
// source: test
34
///
45
// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
56

0 commit comments

Comments
 (0)