Skip to content

Conversation

lizziepaquette
Copy link

Adds the parameter using_module so that one can switch out the using macro and take over code generation. 💪

Example:
myproto.proto

syntax = "proto3";

package my.proto.bar;

message Foo{
  string field1 = 1;
}

protoc --elixir_out=./lib --plugin=./protoc-gen-elixir --elixir_opt=using_module=MyMod.MyProtobuf myproto.proto

defmodule My.Proto.Bar.Foo do
  @moduledoc false
  use MyMod.MyProtobuf, syntax: :proto3

  @type t :: %__MODULE__{
          field1: String.t()
        }
  defstruct [:field1]

  field :field1, 1, type: :string
end

@lizziepaquette lizziepaquette force-pushed the cmd-line-opts-for-macro branch from 81115ae to 3de30a6 Compare March 19, 2020 23:53
@lizziepaquette
Copy link
Author

I am flexible on the option label.

@lizziepaquette
Copy link
Author

@tony612 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant