Rename C# files to indicate generated code (#10801)

* Change C# generation script to use .pb.cs extension

* Rename generated C# files

This was performed by running generate_protos.sh and then removing the old files.

Notes:
- This does not change the conformance test generated C# code
- This does not change the compatibility C# code
- There's currently no clean-up operation in generate_protos.sh to remove old .pb.cs files (which would now be feasible)
- The changes to TestMessagesProto2.pb.cs are just due to formatting and a new Objective-C option

* Fix well-known type source files for C# Bazel build
pull/10821/head
Jon Skeet 2 years ago committed by GitHub
parent 3b4fdac42a
commit 5c6c868588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      csharp/.gitignore
  2. 22
      csharp/BUILD.bazel
  3. 3
      csharp/generate_protos.sh
  4. 0
      csharp/src/AddressBook/Addressbook.pb.cs
  5. 0
      csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.pb.cs
  6. 0
      csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.pb.cs
  7. 0
      csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.pb.cs
  8. 0
      csharp/src/Google.Protobuf.Test.TestProtos/Unittest.pb.cs
  9. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.pb.cs
  10. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.pb.cs
  11. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.pb.cs
  12. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.pb.cs
  13. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.pb.cs
  14. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.pb.cs
  15. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.pb.cs
  16. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.pb.cs
  17. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.pb.cs
  18. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.pb.cs
  19. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.pb.cs
  20. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.pb.cs
  21. 0
      csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.pb.cs
  22. 0
      csharp/src/Google.Protobuf/Compiler/Plugin.pb.cs
  23. 0
      csharp/src/Google.Protobuf/Reflection/Descriptor.pb.cs
  24. 0
      csharp/src/Google.Protobuf/WellKnownTypes/Any.pb.cs
  25. 0
      csharp/src/Google.Protobuf/WellKnownTypes/Api.pb.cs
  26. 0
      csharp/src/Google.Protobuf/WellKnownTypes/Duration.pb.cs
  27. 0
      csharp/src/Google.Protobuf/WellKnownTypes/Empty.pb.cs
  28. 0
      csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.pb.cs
  29. 0
      csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.pb.cs
  30. 0
      csharp/src/Google.Protobuf/WellKnownTypes/Struct.pb.cs
  31. 0
      csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.pb.cs
  32. 0
      csharp/src/Google.Protobuf/WellKnownTypes/Type.pb.cs
  33. 0
      csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.pb.cs

5
csharp/.gitignore vendored

@ -33,3 +33,8 @@ lib/protoc.exe
# Benchmark output
BenchmarkDotNet.Artifacts/
# Reinstate generated code for test files
!any_test.pb.*
!map*unittest.pb.*
!unittest*.pb.*

@ -45,17 +45,17 @@ filegroup(
filegroup(
name = "wkt_cs_srcs",
srcs = [
"src/Google.Protobuf/Reflection/Descriptor.cs",
"src/Google.Protobuf/WellKnownTypes/Any.cs",
"src/Google.Protobuf/WellKnownTypes/Api.cs",
"src/Google.Protobuf/WellKnownTypes/Duration.cs",
"src/Google.Protobuf/WellKnownTypes/Empty.cs",
"src/Google.Protobuf/WellKnownTypes/FieldMask.cs",
"src/Google.Protobuf/WellKnownTypes/SourceContext.cs",
"src/Google.Protobuf/WellKnownTypes/Struct.cs",
"src/Google.Protobuf/WellKnownTypes/Timestamp.cs",
"src/Google.Protobuf/WellKnownTypes/Type.cs",
"src/Google.Protobuf/WellKnownTypes/Wrappers.cs",
"src/Google.Protobuf/Reflection/Descriptor.pb.cs",
"src/Google.Protobuf/WellKnownTypes/Any.pb.cs",
"src/Google.Protobuf/WellKnownTypes/Api.pb.cs",
"src/Google.Protobuf/WellKnownTypes/Duration.pb.cs",
"src/Google.Protobuf/WellKnownTypes/Empty.pb.cs",
"src/Google.Protobuf/WellKnownTypes/FieldMask.pb.cs",
"src/Google.Protobuf/WellKnownTypes/SourceContext.pb.cs",
"src/Google.Protobuf/WellKnownTypes/Struct.pb.cs",
"src/Google.Protobuf/WellKnownTypes/Timestamp.pb.cs",
"src/Google.Protobuf/WellKnownTypes/Type.pb.cs",
"src/Google.Protobuf/WellKnownTypes/Wrappers.pb.cs",
],
visibility = ["//src/google/protobuf/compiler/csharp:__pkg__"],
)

@ -32,6 +32,7 @@ fi
# descriptor.proto and well-known types
$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf \
--csharp_opt=base_namespace=Google.Protobuf \
--csharp_opt=file_extension=.pb.cs \
src/google/protobuf/descriptor.proto \
src/google/protobuf/any.proto \
src/google/protobuf/api.proto \
@ -52,6 +53,7 @@ $PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf \
$PROTOC -Isrc -Icsharp/protos \
--experimental_allow_proto3_optional \
--csharp_out=csharp/src/Google.Protobuf.Test.TestProtos \
--csharp_opt=file_extension=.pb.cs \
--descriptor_set_out=csharp/src/Google.Protobuf.Test/testprotos.pb \
--include_source_info \
--include_imports \
@ -75,4 +77,5 @@ $PROTOC -Isrc -Icsharp/protos \
# AddressBook sample protos
$PROTOC -Iexamples -Isrc --csharp_out=csharp/src/AddressBook \
--csharp_opt=file_extension=.pb.cs \
examples/addressbook.proto

Loading…
Cancel
Save