Skip to content

Conversation

@lizziepaquette
Copy link
Collaborator

@lizziepaquette lizziepaquette commented Apr 7, 2020

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

@mairbek
Copy link

mairbek commented Apr 7, 2020

let's not use master, rather a different branch?

@lizziepaquette lizziepaquette changed the base branch from master to brex-head April 8, 2020 19:16
@lizziepaquette lizziepaquette merged commit c8e0a52 into brex-head Apr 8, 2020
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.

2 participants