mix protox.generate (Protox v2.0.4)
View SourceGenerate Elixir code from .proto
files.
Example:
mix protox.generate --output-path=lib/message.ex --include-path=. message.proto
The generated file will be usable in any project as long as protox is declared in the dependencies (the generated code still needs functions from the protox runtime).
You can use the --namespace
option to prepend a namespace to all generated modules.
If you have large protobuf files, you can use the --multiple-files
option to generate
one file per module (it will leverage parallel compilation).