Skip to content

Commit

Permalink
Include descriptor when generating google_protos (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasdarruda authored Jan 18, 2025
1 parent 6c53c49 commit cbb4c91
Show file tree
Hide file tree
Showing 12 changed files with 848 additions and 77 deletions.
2 changes: 1 addition & 1 deletion lib/elixirpb.pb.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Elixirpb.FileOptions do
@moduledoc false

use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto2

field :module_prefix, 1, optional: true, type: :string, json_name: "modulePrefix"
end
2 changes: 1 addition & 1 deletion lib/elixirpb/pb_extension.pb.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Elixirpb.PbExtension do
@moduledoc false

use Protobuf, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0"

extend Google.Protobuf.FileOptions, :file, 1047, optional: true, type: Elixirpb.FileOptions
end
48 changes: 47 additions & 1 deletion lib/google/protobuf/any.pb.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,53 @@
defmodule Google.Protobuf.Any do
@moduledoc false

use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto3
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
%Google.Protobuf.DescriptorProto{
name: "Any",
field: [
%Google.Protobuf.FieldDescriptorProto{
name: "type_url",
extendee: nil,
number: 1,
label: :LABEL_OPTIONAL,
type: :TYPE_STRING,
type_name: nil,
default_value: nil,
options: nil,
oneof_index: nil,
json_name: "typeUrl",
proto3_optional: nil,
__unknown_fields__: []
},
%Google.Protobuf.FieldDescriptorProto{
name: "value",
extendee: nil,
number: 2,
label: :LABEL_OPTIONAL,
type: :TYPE_BYTES,
type_name: nil,
default_value: nil,
options: nil,
oneof_index: nil,
json_name: "value",
proto3_optional: nil,
__unknown_fields__: []
}
],
nested_type: [],
enum_type: [],
extension_range: [],
extension: [],
options: nil,
oneof_decl: [],
reserved_range: [],
reserved_name: [],
__unknown_fields__: []
}
end

field :type_url, 1, type: :string, json_name: "typeUrl"
field :value, 2, type: :bytes
Expand Down
10 changes: 5 additions & 5 deletions lib/google/protobuf/compiler/plugin.pb.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Google.Protobuf.Compiler.CodeGeneratorResponse.Feature do
@moduledoc false

use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2
use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto2

field :FEATURE_NONE, 0
field :FEATURE_PROTO3_OPTIONAL, 1
Expand All @@ -11,7 +11,7 @@ end
defmodule Google.Protobuf.Compiler.Version do
@moduledoc false

use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto2

field :major, 1, optional: true, type: :int32
field :minor, 2, optional: true, type: :int32
Expand All @@ -22,7 +22,7 @@ end
defmodule Google.Protobuf.Compiler.CodeGeneratorRequest do
@moduledoc false

use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto2

field :file_to_generate, 1, repeated: true, type: :string, json_name: "fileToGenerate"
field :parameter, 2, optional: true, type: :string
Expand All @@ -46,7 +46,7 @@ end
defmodule Google.Protobuf.Compiler.CodeGeneratorResponse.File do
@moduledoc false

use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto2

field :name, 1, optional: true, type: :string
field :insertion_point, 2, optional: true, type: :string, json_name: "insertionPoint"
Expand All @@ -61,7 +61,7 @@ end
defmodule Google.Protobuf.Compiler.CodeGeneratorResponse do
@moduledoc false

use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto2

field :error, 1, optional: true, type: :string
field :supported_features, 2, optional: true, type: :uint64, json_name: "supportedFeatures"
Expand Down
Loading

0 comments on commit cbb4c91

Please sign in to comment.