Back to directory

Protobuf.Generate

An Elixir mix task that generates Elixir code from Protocol Buffers definitions by calling protoc directly, running in the local project's context instead of as a global protoc-gen-elixir plugin.

Protobuf.Generate

protobuf.generate is a mix task that generates Elixir code from .proto files without going through the protoc-gen-elixir plugin. It calls protoc with descriptor_set_out to produce a FileDescriptorSet in a temporary file, which it then feeds to the Protobuf library to generate code, running inside the local project's context rather than protoc-gen-elixir's global plugin context.

Because it runs locally, extensions that need to be populated during code generation are picked up automatically through Protobuf.load_extensions, which protoc-gen-elixir cannot do, and generator plugins can hook into the codegen process through a documented plugin behaviour.

It requires the protoc compiler to be installed separately, is added to a project's mix.exs dependencies, and supports the same command-line options as protoc-gen-elixir, including output and include paths, a transform module for custom encoding and decoding, a package prefix, raw descriptor inclusion, one-file-per-module output, documentation visibility, and a gRPC generator plugin.

More in Languages

See all 48
  • QBasic Web Editor

    vahidyousefzadeh.com

    A browser-based QBasic 1.1 editor and interpreter that runs classic QBasic programs with DOSBox-accurate behavior, including text-mode graphics commands such as PRINT, COLOR and LOCATE, with sample programs and keyboard shortcuts to run and save.

  • A Brainfuck-inspired esoteric programming language adding absolute memory navigation, multiplier arithmetic, non-destructive inspection and inline conditionals, with its own interpreter.

  • C3 Playground

    play.c3-lang.org

    An in-browser playground that compiles and runs the C3 programming language entirely in WebAssembly, with no backend server, alongside its standard library and documentation.