diff --git a/benchmarks/google_size.proto b/benchmarks/google_size.proto index 3e6fbdbc7a..e0fcb2e096 100644 --- a/benchmarks/google_size.proto +++ b/benchmarks/google_size.proto @@ -1,7 +1,10 @@ +syntax = "proto2"; + package benchmarks; option java_outer_classname = "GoogleSize"; option optimize_for = CODE_SIZE; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; message SizeMessage1 { required string field1 = 1; diff --git a/benchmarks/google_speed.proto b/benchmarks/google_speed.proto index d6cd0321d2..3bc5fd2dad 100644 --- a/benchmarks/google_speed.proto +++ b/benchmarks/google_speed.proto @@ -1,7 +1,10 @@ +syntax = "proto2"; + package benchmarks; option java_outer_classname = "GoogleSpeed"; option optimize_for = SPEED; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; message SpeedMessage1 { required string field1 = 1; diff --git a/src/google/protobuf/any.proto b/src/google/protobuf/any.proto index bf2aa0a930..5f29e01e93 100644 --- a/src/google/protobuf/any.proto +++ b/src/google/protobuf/any.proto @@ -35,7 +35,7 @@ option java_generate_equals_and_hash = true; option java_multiple_files = true; option java_outer_classname = "AnyProto"; option java_package = "com.google.protobuf"; - +option csharp_namespace = "Google.ProtocolBuffers"; // `Any` contains an arbitrary serialized message along with a URL // that describes the type of the serialized message. diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 9e703d963b..d7100370e7 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -719,8 +719,9 @@ void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() { "path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005B\002\020\001\022\030\n\020lead" "ing_comments\030\003 \001(\t\022\031\n\021trailing_comments\030" "\004 \001(\t\022!\n\031leading_detached_comments\030\006 \003(\t" - "B)\n\023com.google.protobufB\020DescriptorProto" - "sH\001", 4643); + "BS\n\023com.google.protobufB\020DescriptorProto" + "sH\001\252\002\'Google.ProtocolBuffers.DescriptorP" + "rotos", 4685); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/descriptor.proto", &protobuf_RegisterTypes); FileDescriptorSet::default_instance_ = new FileDescriptorSet(); diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index a4b64f65d9..375814c9c0 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -42,6 +42,7 @@ syntax = "proto2"; package google.protobuf; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.ProtocolBuffers.DescriptorProtos"; // descriptor.proto must be optimized for speed because reflection-based // algorithms don't work during bootstrapping. diff --git a/src/google/protobuf/duration.proto b/src/google/protobuf/duration.proto index 868c732fb4..59420cc07c 100644 --- a/src/google/protobuf/duration.proto +++ b/src/google/protobuf/duration.proto @@ -35,7 +35,7 @@ option java_generate_equals_and_hash = true; option java_multiple_files = true; option java_outer_classname = "DurationProto"; option java_package = "com.google.protobuf"; - +option csharp_namespace = "Google.ProtocolBuffers"; // A Duration represents a signed, fixed-length span of time represented // as a count of seconds and fractions of seconds at nanosecond diff --git a/src/google/protobuf/field_mask.proto b/src/google/protobuf/field_mask.proto index 492d4b0613..0b98411c46 100644 --- a/src/google/protobuf/field_mask.proto +++ b/src/google/protobuf/field_mask.proto @@ -34,7 +34,7 @@ package google.protobuf; option java_multiple_files = true; option java_outer_classname = "FieldMaskProto"; option java_package = "com.google.protobuf"; - +option csharp_namespace = "Google.ProtocolBuffers"; // `FieldMask` represents a set of symbolic field paths, for example: // diff --git a/src/google/protobuf/map_lite_unittest.proto b/src/google/protobuf/map_lite_unittest.proto index c69e8d9456..febfe5f6b8 100644 --- a/src/google/protobuf/map_lite_unittest.proto +++ b/src/google/protobuf/map_lite_unittest.proto @@ -32,6 +32,7 @@ syntax = "proto2"; option cc_enable_arenas = true; option optimize_for = LITE_RUNTIME; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; import "google/protobuf/unittest_lite.proto"; diff --git a/src/google/protobuf/map_proto2_unittest.proto b/src/google/protobuf/map_proto2_unittest.proto index 3d4af28efe..04ca6170c3 100644 --- a/src/google/protobuf/map_proto2_unittest.proto +++ b/src/google/protobuf/map_proto2_unittest.proto @@ -36,6 +36,8 @@ syntax = "proto2"; // In map_test_util.h we do "using namespace unittest = protobuf_unittest". package protobuf_unittest; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; + enum Proto2MapEnum { PROTO2_MAP_ENUM_FOO = 0; PROTO2_MAP_ENUM_BAR = 1; diff --git a/src/google/protobuf/map_unittest.proto b/src/google/protobuf/map_unittest.proto index 830f672b5b..b6a988b316 100644 --- a/src/google/protobuf/map_unittest.proto +++ b/src/google/protobuf/map_unittest.proto @@ -31,6 +31,7 @@ syntax = "proto3"; option cc_enable_arenas = true; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; import "google/protobuf/unittest.proto"; diff --git a/src/google/protobuf/struct.proto b/src/google/protobuf/struct.proto index 9f27eb4354..cfe010c2e0 100644 --- a/src/google/protobuf/struct.proto +++ b/src/google/protobuf/struct.proto @@ -35,7 +35,7 @@ option java_generate_equals_and_hash = true; option java_multiple_files = true; option java_outer_classname = "StructProto"; option java_package = "com.google.protobuf"; - +option csharp_namespace = "Google.ProtocolBuffers"; // `Struct` represents a structured data value, consisting of fields // which map to dynamically typed values. In some languages, `Struct` diff --git a/src/google/protobuf/timestamp.proto b/src/google/protobuf/timestamp.proto index ac8e009cfc..94386de12e 100644 --- a/src/google/protobuf/timestamp.proto +++ b/src/google/protobuf/timestamp.proto @@ -35,7 +35,7 @@ option java_generate_equals_and_hash = true; option java_multiple_files = true; option java_outer_classname = "TimestampProto"; option java_package = "com.google.protobuf"; - +option csharp_namespace = "Google.ProtocolBuffers"; // A Timestamp represents a point in time independent of any time zone // or calendar, represented as seconds and fractions of seconds at diff --git a/src/google/protobuf/unittest.proto b/src/google/protobuf/unittest.proto index 745f77c542..a32291e000 100644 --- a/src/google/protobuf/unittest.proto +++ b/src/google/protobuf/unittest.proto @@ -42,6 +42,7 @@ option cc_generic_services = true; // auto-added option java_generic_services = true; // auto-added option py_generic_services = true; // auto-added option cc_enable_arenas = true; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; import "google/protobuf/unittest_import.proto"; diff --git a/src/google/protobuf/unittest_custom_options.proto b/src/google/protobuf/unittest_custom_options.proto index d4d6e869a2..8f9fb58237 100644 --- a/src/google/protobuf/unittest_custom_options.proto +++ b/src/google/protobuf/unittest_custom_options.proto @@ -41,6 +41,7 @@ syntax = "proto2"; option cc_generic_services = true; // auto-added option java_generic_services = true; // auto-added option py_generic_services = true; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; // A custom file option (defined below). option (file_opt1) = 9876543210; diff --git a/src/google/protobuf/unittest_drop_unknown_fields.proto b/src/google/protobuf/unittest_drop_unknown_fields.proto index 66b31acf9a..1bb168f26d 100644 --- a/src/google/protobuf/unittest_drop_unknown_fields.proto +++ b/src/google/protobuf/unittest_drop_unknown_fields.proto @@ -32,6 +32,8 @@ syntax = "proto3"; package unittest_drop_unknown_fields; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; + message Foo { enum NestedEnum { FOO = 0; diff --git a/src/google/protobuf/unittest_embed_optimize_for.proto b/src/google/protobuf/unittest_embed_optimize_for.proto index d8b0f9b94f..c4ccccb756 100644 --- a/src/google/protobuf/unittest_embed_optimize_for.proto +++ b/src/google/protobuf/unittest_embed_optimize_for.proto @@ -39,6 +39,8 @@ import "google/protobuf/unittest_optimize_for.proto"; package protobuf_unittest; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; + // We optimize for speed here, but we are importing a proto that is optimized // for code size. option optimize_for = SPEED; diff --git a/src/google/protobuf/unittest_enormous_descriptor.proto b/src/google/protobuf/unittest_enormous_descriptor.proto index 2250261d9c..f8fcc9c0da 100644 --- a/src/google/protobuf/unittest_enormous_descriptor.proto +++ b/src/google/protobuf/unittest_enormous_descriptor.proto @@ -33,12 +33,14 @@ // Sanjay Ghemawat, Jeff Dean, and others. // // A proto file that has an extremely large descriptor. Used to test that -// descriptors over 64k don't break the string literal length limit in Java. +// descriptors over 64k don't break language-specific limits in generated code, +// such as the string literal length limit in Java. syntax = "proto2"; package google.protobuf; option java_package = "com.google.protobuf"; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; // Avoid generating insanely long methods. option optimize_for = CODE_SIZE; diff --git a/src/google/protobuf/unittest_import.proto b/src/google/protobuf/unittest_import.proto index 7e16522033..ae2e90b805 100644 --- a/src/google/protobuf/unittest_import.proto +++ b/src/google/protobuf/unittest_import.proto @@ -47,6 +47,7 @@ option cc_enable_arenas = true; // Exercise the java_package option. option java_package = "com.google.protobuf.test"; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; // Do not set a java_outer_classname here to verify that Proto2 works without // one. diff --git a/src/google/protobuf/unittest_import_lite.proto b/src/google/protobuf/unittest_import_lite.proto index a7afa45233..ca208582b4 100644 --- a/src/google/protobuf/unittest_import_lite.proto +++ b/src/google/protobuf/unittest_import_lite.proto @@ -38,6 +38,7 @@ package protobuf_unittest_import; option optimize_for = LITE_RUNTIME; option java_package = "com.google.protobuf"; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; import public "google/protobuf/unittest_import_public_lite.proto"; diff --git a/src/google/protobuf/unittest_import_public.proto b/src/google/protobuf/unittest_import_public.proto index ffaf773698..0bc5d61768 100644 --- a/src/google/protobuf/unittest_import_public.proto +++ b/src/google/protobuf/unittest_import_public.proto @@ -35,6 +35,7 @@ syntax = "proto2"; package protobuf_unittest_import; option java_package = "com.google.protobuf.test"; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; message PublicImportMessage { optional int32 e = 1; diff --git a/src/google/protobuf/unittest_import_public_lite.proto b/src/google/protobuf/unittest_import_public_lite.proto index 33549c2279..231ab9dd26 100644 --- a/src/google/protobuf/unittest_import_public_lite.proto +++ b/src/google/protobuf/unittest_import_public_lite.proto @@ -37,6 +37,7 @@ package protobuf_unittest_import; option optimize_for = LITE_RUNTIME; option java_package = "com.google.protobuf"; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; message PublicImportMessageLite { optional int32 e = 1; diff --git a/src/google/protobuf/unittest_lite.proto b/src/google/protobuf/unittest_lite.proto index 662c0e461f..0040874baf 100644 --- a/src/google/protobuf/unittest_lite.proto +++ b/src/google/protobuf/unittest_lite.proto @@ -40,6 +40,7 @@ import "google/protobuf/unittest_import_lite.proto"; option optimize_for = LITE_RUNTIME; option java_package = "com.google.protobuf"; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; // Same as TestAllTypes but with the lite runtime. message TestAllTypesLite { diff --git a/src/google/protobuf/unittest_lite_imports_nonlite.proto b/src/google/protobuf/unittest_lite_imports_nonlite.proto index 132d6a82d2..d955cc142c 100644 --- a/src/google/protobuf/unittest_lite_imports_nonlite.proto +++ b/src/google/protobuf/unittest_lite_imports_nonlite.proto @@ -38,6 +38,7 @@ package protobuf_unittest; import "google/protobuf/unittest.proto"; option optimize_for = LITE_RUNTIME; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; message TestLiteImportsNonlite { optional TestAllTypes message = 1; diff --git a/src/google/protobuf/unittest_mset.proto b/src/google/protobuf/unittest_mset.proto index 3aa31fa9dd..425c9a5a20 100644 --- a/src/google/protobuf/unittest_mset.proto +++ b/src/google/protobuf/unittest_mset.proto @@ -39,6 +39,7 @@ package protobuf_unittest; option cc_enable_arenas = true; option optimize_for = SPEED; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; // A message with message_set_wire_format. message TestMessageSet { diff --git a/src/google/protobuf/unittest_no_field_presence.proto b/src/google/protobuf/unittest_no_field_presence.proto index e04da0ac30..6e71517cbe 100644 --- a/src/google/protobuf/unittest_no_field_presence.proto +++ b/src/google/protobuf/unittest_no_field_presence.proto @@ -37,6 +37,8 @@ import "google/protobuf/unittest.proto"; package proto2_nofieldpresence_unittest; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; + // This proto includes every type of field in both singular and repeated // forms. message TestAllTypes { diff --git a/src/google/protobuf/unittest_optimize_for.proto b/src/google/protobuf/unittest_optimize_for.proto index ee9cc7bd49..2bcd16e415 100644 --- a/src/google/protobuf/unittest_optimize_for.proto +++ b/src/google/protobuf/unittest_optimize_for.proto @@ -40,6 +40,7 @@ import "google/protobuf/unittest.proto"; package protobuf_unittest; option optimize_for = CODE_SIZE; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; message TestOptimizedForSize { optional int32 i = 1; diff --git a/src/google/protobuf/unittest_preserve_unknown_enum.proto b/src/google/protobuf/unittest_preserve_unknown_enum.proto index 67e574991a..5214247ead 100644 --- a/src/google/protobuf/unittest_preserve_unknown_enum.proto +++ b/src/google/protobuf/unittest_preserve_unknown_enum.proto @@ -32,6 +32,8 @@ syntax = "proto3"; package proto3_preserve_unknown_enum_unittest; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; + enum MyEnum { FOO = 0; BAR = 1; diff --git a/src/google/protobuf/unittest_preserve_unknown_enum2.proto b/src/google/protobuf/unittest_preserve_unknown_enum2.proto index adf42968aa..168b24073e 100644 --- a/src/google/protobuf/unittest_preserve_unknown_enum2.proto +++ b/src/google/protobuf/unittest_preserve_unknown_enum2.proto @@ -32,6 +32,8 @@ syntax = "proto2"; package proto2_preserve_unknown_enum_unittest; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; + enum MyEnum { FOO = 0; BAR = 1; diff --git a/src/google/protobuf/unknown_enum_test.proto b/src/google/protobuf/unknown_enum_test.proto index caafadcda6..3c549cc780 100644 --- a/src/google/protobuf/unknown_enum_test.proto +++ b/src/google/protobuf/unknown_enum_test.proto @@ -36,6 +36,7 @@ syntax = "proto2"; package google.protobuf.util; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; message DownRevision { enum Enum { diff --git a/src/google/protobuf/wrappers.proto b/src/google/protobuf/wrappers.proto index 5164c24c51..28657fbf08 100644 --- a/src/google/protobuf/wrappers.proto +++ b/src/google/protobuf/wrappers.proto @@ -40,7 +40,7 @@ package google.protobuf; option java_multiple_files = true; option java_outer_classname = "WrappersProto"; option java_package = "com.google.protobuf"; - +option csharp_namespace = "Google.ProtocolBuffers"; // Wrapper message for double. message DoubleValue {