From e7edc92799550af73327e4049c23b42f89128fda Mon Sep 17 00:00:00 2001 From: Bouke van der Bijl Date: Sat, 20 Mar 2021 14:24:52 +0100 Subject: [PATCH] Commit generated ruby protobufs --- .gitignore | 1 - ruby/ext/google/protobuf_c/extconf.rb | 2 + ruby/google-protobuf.gemspec | 2 +- ruby/lib/google/protobuf/any_pb.rb | 19 ++++ ruby/lib/google/protobuf/api_pb.rb | 41 +++++++++ ruby/lib/google/protobuf/duration_pb.rb | 19 ++++ ruby/lib/google/protobuf/empty_pb.rb | 17 ++++ ruby/lib/google/protobuf/field_mask_pb.rb | 18 ++++ ruby/lib/google/protobuf/source_context_pb.rb | 18 ++++ ruby/lib/google/protobuf/struct_pb.rb | 37 ++++++++ ruby/lib/google/protobuf/timestamp_pb.rb | 19 ++++ ruby/lib/google/protobuf/type_pb.rb | 91 +++++++++++++++++++ ruby/lib/google/protobuf/wrappers_pb.rb | 50 ++++++++++ 13 files changed, 332 insertions(+), 2 deletions(-) create mode 100644 ruby/lib/google/protobuf/any_pb.rb create mode 100644 ruby/lib/google/protobuf/api_pb.rb create mode 100644 ruby/lib/google/protobuf/duration_pb.rb create mode 100644 ruby/lib/google/protobuf/empty_pb.rb create mode 100644 ruby/lib/google/protobuf/field_mask_pb.rb create mode 100644 ruby/lib/google/protobuf/source_context_pb.rb create mode 100644 ruby/lib/google/protobuf/struct_pb.rb create mode 100644 ruby/lib/google/protobuf/timestamp_pb.rb create mode 100644 ruby/lib/google/protobuf/type_pb.rb create mode 100644 ruby/lib/google/protobuf/wrappers_pb.rb diff --git a/.gitignore b/.gitignore index 44ab2d49ef48..7019860e04a8 100644 --- a/.gitignore +++ b/.gitignore @@ -185,7 +185,6 @@ js/testproto_libs2.js /bazel-* # ruby test output -ruby/lib/ ruby/tests/basic_test_pb.rb ruby/tests/basic_test_proto2_pb.rb ruby/tests/generated_code_pb.rb diff --git a/ruby/ext/google/protobuf_c/extconf.rb b/ruby/ext/google/protobuf_c/extconf.rb index ec17787f79fd..f14fa3b3e0d9 100755 --- a/ruby/ext/google/protobuf_c/extconf.rb +++ b/ruby/ext/google/protobuf_c/extconf.rb @@ -17,4 +17,6 @@ $objs = ["protobuf.o", "convert.o", "defs.o", "message.o", "repeated_field.o", "map.o", "ruby-upb.o", "wrap_memcpy.o"] +find_header('third_party/wyhash/wyhash.h', '../../../..') + create_makefile("google/protobuf_c") diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index a280ddbf9731..7149cf4b2dc3 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |s| s.files += ["lib/google/protobuf_java.jar"] else s.files += Dir.glob('ext/**/*') - s.extensions << 'Rakefile' + s.extensions= ["ext/google/protobuf_c/extconf.rb"] s.add_development_dependency "rake-compiler-dock", ">= 1.1.0", "< 2.0" end s.test_files = ["tests/basic.rb", diff --git a/ruby/lib/google/protobuf/any_pb.rb b/ruby/lib/google/protobuf/any_pb.rb new file mode 100644 index 000000000000..9c4ea74f2b25 --- /dev/null +++ b/ruby/lib/google/protobuf/any_pb.rb @@ -0,0 +1,19 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/any.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/protobuf/any.proto", :syntax => :proto3) do + add_message "google.protobuf.Any" do + optional :type_url, :string, 1 + optional :value, :bytes, 2 + end + end +end + +module Google + module Protobuf + Any = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Any").msgclass + end +end diff --git a/ruby/lib/google/protobuf/api_pb.rb b/ruby/lib/google/protobuf/api_pb.rb new file mode 100644 index 000000000000..3090b25181c1 --- /dev/null +++ b/ruby/lib/google/protobuf/api_pb.rb @@ -0,0 +1,41 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/api.proto + +require 'google/protobuf' + +require 'google/protobuf/source_context_pb' +require 'google/protobuf/type_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/protobuf/api.proto", :syntax => :proto3) do + add_message "google.protobuf.Api" do + optional :name, :string, 1 + repeated :methods, :message, 2, "google.protobuf.Method" + repeated :options, :message, 3, "google.protobuf.Option" + optional :version, :string, 4 + optional :source_context, :message, 5, "google.protobuf.SourceContext" + repeated :mixins, :message, 6, "google.protobuf.Mixin" + optional :syntax, :enum, 7, "google.protobuf.Syntax" + end + add_message "google.protobuf.Method" do + optional :name, :string, 1 + optional :request_type_url, :string, 2 + optional :request_streaming, :bool, 3 + optional :response_type_url, :string, 4 + optional :response_streaming, :bool, 5 + repeated :options, :message, 6, "google.protobuf.Option" + optional :syntax, :enum, 7, "google.protobuf.Syntax" + end + add_message "google.protobuf.Mixin" do + optional :name, :string, 1 + optional :root, :string, 2 + end + end +end + +module Google + module Protobuf + Api = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Api").msgclass + Method = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Method").msgclass + Mixin = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Mixin").msgclass + end +end diff --git a/ruby/lib/google/protobuf/duration_pb.rb b/ruby/lib/google/protobuf/duration_pb.rb new file mode 100644 index 000000000000..1203576272b5 --- /dev/null +++ b/ruby/lib/google/protobuf/duration_pb.rb @@ -0,0 +1,19 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/duration.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/protobuf/duration.proto", :syntax => :proto3) do + add_message "google.protobuf.Duration" do + optional :seconds, :int64, 1 + optional :nanos, :int32, 2 + end + end +end + +module Google + module Protobuf + Duration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Duration").msgclass + end +end diff --git a/ruby/lib/google/protobuf/empty_pb.rb b/ruby/lib/google/protobuf/empty_pb.rb new file mode 100644 index 000000000000..452c66069f5b --- /dev/null +++ b/ruby/lib/google/protobuf/empty_pb.rb @@ -0,0 +1,17 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/empty.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/protobuf/empty.proto", :syntax => :proto3) do + add_message "google.protobuf.Empty" do + end + end +end + +module Google + module Protobuf + Empty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Empty").msgclass + end +end diff --git a/ruby/lib/google/protobuf/field_mask_pb.rb b/ruby/lib/google/protobuf/field_mask_pb.rb new file mode 100644 index 000000000000..abe99a09d243 --- /dev/null +++ b/ruby/lib/google/protobuf/field_mask_pb.rb @@ -0,0 +1,18 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/field_mask.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/protobuf/field_mask.proto", :syntax => :proto3) do + add_message "google.protobuf.FieldMask" do + repeated :paths, :string, 1 + end + end +end + +module Google + module Protobuf + FieldMask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldMask").msgclass + end +end diff --git a/ruby/lib/google/protobuf/source_context_pb.rb b/ruby/lib/google/protobuf/source_context_pb.rb new file mode 100644 index 000000000000..f8b7e4e85317 --- /dev/null +++ b/ruby/lib/google/protobuf/source_context_pb.rb @@ -0,0 +1,18 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/source_context.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/protobuf/source_context.proto", :syntax => :proto3) do + add_message "google.protobuf.SourceContext" do + optional :file_name, :string, 1 + end + end +end + +module Google + module Protobuf + SourceContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceContext").msgclass + end +end diff --git a/ruby/lib/google/protobuf/struct_pb.rb b/ruby/lib/google/protobuf/struct_pb.rb new file mode 100644 index 000000000000..3cac4b39b28c --- /dev/null +++ b/ruby/lib/google/protobuf/struct_pb.rb @@ -0,0 +1,37 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/struct.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/protobuf/struct.proto", :syntax => :proto3) do + add_message "google.protobuf.Struct" do + map :fields, :string, :message, 1, "google.protobuf.Value" + end + add_message "google.protobuf.Value" do + oneof :kind do + optional :null_value, :enum, 1, "google.protobuf.NullValue" + optional :number_value, :double, 2 + optional :string_value, :string, 3 + optional :bool_value, :bool, 4 + optional :struct_value, :message, 5, "google.protobuf.Struct" + optional :list_value, :message, 6, "google.protobuf.ListValue" + end + end + add_message "google.protobuf.ListValue" do + repeated :values, :message, 1, "google.protobuf.Value" + end + add_enum "google.protobuf.NullValue" do + value :NULL_VALUE, 0 + end + end +end + +module Google + module Protobuf + Struct = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Struct").msgclass + Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Value").msgclass + ListValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ListValue").msgclass + NullValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.NullValue").enummodule + end +end diff --git a/ruby/lib/google/protobuf/timestamp_pb.rb b/ruby/lib/google/protobuf/timestamp_pb.rb new file mode 100644 index 000000000000..58f69ddfb675 --- /dev/null +++ b/ruby/lib/google/protobuf/timestamp_pb.rb @@ -0,0 +1,19 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/timestamp.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/protobuf/timestamp.proto", :syntax => :proto3) do + add_message "google.protobuf.Timestamp" do + optional :seconds, :int64, 1 + optional :nanos, :int32, 2 + end + end +end + +module Google + module Protobuf + Timestamp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Timestamp").msgclass + end +end diff --git a/ruby/lib/google/protobuf/type_pb.rb b/ruby/lib/google/protobuf/type_pb.rb new file mode 100644 index 000000000000..6475a62458b1 --- /dev/null +++ b/ruby/lib/google/protobuf/type_pb.rb @@ -0,0 +1,91 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/type.proto + +require 'google/protobuf' + +require 'google/protobuf/any_pb' +require 'google/protobuf/source_context_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/protobuf/type.proto", :syntax => :proto3) do + add_message "google.protobuf.Type" do + optional :name, :string, 1 + repeated :fields, :message, 2, "google.protobuf.Field" + repeated :oneofs, :string, 3 + repeated :options, :message, 4, "google.protobuf.Option" + optional :source_context, :message, 5, "google.protobuf.SourceContext" + optional :syntax, :enum, 6, "google.protobuf.Syntax" + end + add_message "google.protobuf.Field" do + optional :kind, :enum, 1, "google.protobuf.Field.Kind" + optional :cardinality, :enum, 2, "google.protobuf.Field.Cardinality" + optional :number, :int32, 3 + optional :name, :string, 4 + optional :type_url, :string, 6 + optional :oneof_index, :int32, 7 + optional :packed, :bool, 8 + repeated :options, :message, 9, "google.protobuf.Option" + optional :json_name, :string, 10 + optional :default_value, :string, 11 + end + add_enum "google.protobuf.Field.Kind" do + value :TYPE_UNKNOWN, 0 + value :TYPE_DOUBLE, 1 + value :TYPE_FLOAT, 2 + value :TYPE_INT64, 3 + value :TYPE_UINT64, 4 + value :TYPE_INT32, 5 + value :TYPE_FIXED64, 6 + value :TYPE_FIXED32, 7 + value :TYPE_BOOL, 8 + value :TYPE_STRING, 9 + value :TYPE_GROUP, 10 + value :TYPE_MESSAGE, 11 + value :TYPE_BYTES, 12 + value :TYPE_UINT32, 13 + value :TYPE_ENUM, 14 + value :TYPE_SFIXED32, 15 + value :TYPE_SFIXED64, 16 + value :TYPE_SINT32, 17 + value :TYPE_SINT64, 18 + end + add_enum "google.protobuf.Field.Cardinality" do + value :CARDINALITY_UNKNOWN, 0 + value :CARDINALITY_OPTIONAL, 1 + value :CARDINALITY_REQUIRED, 2 + value :CARDINALITY_REPEATED, 3 + end + add_message "google.protobuf.Enum" do + optional :name, :string, 1 + repeated :enumvalue, :message, 2, "google.protobuf.EnumValue" + repeated :options, :message, 3, "google.protobuf.Option" + optional :source_context, :message, 4, "google.protobuf.SourceContext" + optional :syntax, :enum, 5, "google.protobuf.Syntax" + end + add_message "google.protobuf.EnumValue" do + optional :name, :string, 1 + optional :number, :int32, 2 + repeated :options, :message, 3, "google.protobuf.Option" + end + add_message "google.protobuf.Option" do + optional :name, :string, 1 + optional :value, :message, 2, "google.protobuf.Any" + end + add_enum "google.protobuf.Syntax" do + value :SYNTAX_PROTO2, 0 + value :SYNTAX_PROTO3, 1 + end + end +end + +module Google + module Protobuf + Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Type").msgclass + Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field").msgclass + Field::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field.Kind").enummodule + Field::Cardinality = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field.Cardinality").enummodule + Enum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Enum").msgclass + EnumValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValue").msgclass + Option = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Option").msgclass + Syntax = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Syntax").enummodule + end +end diff --git a/ruby/lib/google/protobuf/wrappers_pb.rb b/ruby/lib/google/protobuf/wrappers_pb.rb new file mode 100644 index 000000000000..27cdbd323a39 --- /dev/null +++ b/ruby/lib/google/protobuf/wrappers_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/wrappers.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/protobuf/wrappers.proto", :syntax => :proto3) do + add_message "google.protobuf.DoubleValue" do + optional :value, :double, 1 + end + add_message "google.protobuf.FloatValue" do + optional :value, :float, 1 + end + add_message "google.protobuf.Int64Value" do + optional :value, :int64, 1 + end + add_message "google.protobuf.UInt64Value" do + optional :value, :uint64, 1 + end + add_message "google.protobuf.Int32Value" do + optional :value, :int32, 1 + end + add_message "google.protobuf.UInt32Value" do + optional :value, :uint32, 1 + end + add_message "google.protobuf.BoolValue" do + optional :value, :bool, 1 + end + add_message "google.protobuf.StringValue" do + optional :value, :string, 1 + end + add_message "google.protobuf.BytesValue" do + optional :value, :bytes, 1 + end + end +end + +module Google + module Protobuf + DoubleValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DoubleValue").msgclass + FloatValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FloatValue").msgclass + Int64Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Int64Value").msgclass + UInt64Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UInt64Value").msgclass + Int32Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Int32Value").msgclass + UInt32Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UInt32Value").msgclass + BoolValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.BoolValue").msgclass + StringValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.StringValue").msgclass + BytesValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.BytesValue").msgclass + end +end