aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jon Skeet <jonskeet@google.com>2015-05-06 15:25:03 +0100
committerGravatar Jon Skeet <jonskeet@google.com>2015-05-06 19:07:14 +0100
commit7879f82ddceb76c2b6710e240a91f0eabf494c33 (patch)
tree208562e7acec9a9456560f0756d87bbbc7c56dd4
parente0afc0028f88c2e1e8ac5a053717cd3e0c8cc9cb (diff)
Add C# namespace to .proto files (e.g. descriptors, unit tests)
-rw-r--r--benchmarks/google_size.proto3
-rw-r--r--benchmarks/google_speed.proto3
-rw-r--r--src/google/protobuf/any.proto2
-rw-r--r--src/google/protobuf/descriptor.proto1
-rw-r--r--src/google/protobuf/duration.proto2
-rw-r--r--src/google/protobuf/field_mask.proto2
-rw-r--r--src/google/protobuf/map_lite_unittest.proto1
-rw-r--r--src/google/protobuf/map_proto2_unittest.proto2
-rw-r--r--src/google/protobuf/map_unittest.proto1
-rw-r--r--src/google/protobuf/struct.proto2
-rw-r--r--src/google/protobuf/timestamp.proto2
-rw-r--r--src/google/protobuf/unittest.proto1
-rw-r--r--src/google/protobuf/unittest_custom_options.proto1
-rw-r--r--src/google/protobuf/unittest_drop_unknown_fields.proto2
-rw-r--r--src/google/protobuf/unittest_embed_optimize_for.proto2
-rw-r--r--src/google/protobuf/unittest_enormous_descriptor.proto4
-rw-r--r--src/google/protobuf/unittest_import.proto1
-rw-r--r--src/google/protobuf/unittest_import_lite.proto1
-rw-r--r--src/google/protobuf/unittest_import_public.proto1
-rw-r--r--src/google/protobuf/unittest_import_public_lite.proto1
-rw-r--r--src/google/protobuf/unittest_lite.proto1
-rw-r--r--src/google/protobuf/unittest_lite_imports_nonlite.proto1
-rw-r--r--src/google/protobuf/unittest_mset.proto1
-rw-r--r--src/google/protobuf/unittest_no_field_presence.proto2
-rw-r--r--src/google/protobuf/unittest_optimize_for.proto1
-rw-r--r--src/google/protobuf/unittest_preserve_unknown_enum.proto2
-rw-r--r--src/google/protobuf/unittest_preserve_unknown_enum2.proto2
-rw-r--r--src/google/protobuf/unknown_enum_test.proto1
-rw-r--r--src/google/protobuf/wrappers.proto2
29 files changed, 41 insertions, 7 deletions
diff --git a/benchmarks/google_size.proto b/benchmarks/google_size.proto
index 3e6fbdbc..e0fcb2e0 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 d6cd0321..3bc5fd2d 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 bf2aa0a9..5f29e01e 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.proto b/src/google/protobuf/descriptor.proto
index a4b64f65..375814c9 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 868c732f..59420cc0 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 492d4b06..0b98411c 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 c69e8d94..febfe5f6 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 3d4af28e..04ca6170 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 830f672b..b6a988b3 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 9f27eb43..cfe010c2 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 ac8e009c..94386de1 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 745f77c5..a32291e0 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 d4d6e869..8f9fb582 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 66b31acf..1bb168f2 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 d8b0f9b9..c4ccccb7 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 2250261d..f8fcc9c0 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 7e165220..ae2e90b8 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 a7afa452..ca208582 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 ffaf7736..0bc5d617 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 33549c22..231ab9dd 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 662c0e46..0040874b 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 132d6a82..d955cc14 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 3aa31fa9..425c9a5a 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 e04da0ac..6e71517c 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 ee9cc7bd..2bcd16e4 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 67e57499..5214247e 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 adf42968..168b2407 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 caafadcd..3c549cc7 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 5164c24c..28657fbf 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 {