All Projects → square → Goprotowrap

square / Goprotowrap

Licence: apache-2.0
A package-at-a-time wrapper for protoc, for generating Go protobuf code.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Goprotowrap

docker-protobuf
An all-inclusive protoc Docker image
Stars: ✭ 105 (-28.57%)
Mutual labels:  protobuf, protoc
Protobuf
A pure Elixir implementation of Google Protobuf
Stars: ✭ 442 (+200.68%)
Mutual labels:  protobuf, protoc
protoc-gen-kit
Protoc compiler for Go kit code
Stars: ✭ 17 (-88.44%)
Mutual labels:  protobuf, protoc
protobuf-d
Protocol Buffers Compiler Plugin and Support Library for D
Stars: ✭ 32 (-78.23%)
Mutual labels:  protobuf, protoc
Protoc Jar
Protocol Buffers protobuf compiler - multi-platform executable protoc JAR and API
Stars: ✭ 103 (-29.93%)
Mutual labels:  protobuf, protoc
protocell
Conjures up convenient OCaml types and serialization functions based on protobuf definition files
Stars: ✭ 18 (-87.76%)
Mutual labels:  protobuf, protoc
Protolock
Protocol Buffer companion tool. Track your .proto files and prevent changes to messages and services which impact API compatibility.
Stars: ✭ 394 (+168.03%)
Mutual labels:  protobuf, protoc
powerproto
🎉 An awesome version control tool for protoc and its related plugins.
Stars: ✭ 161 (+9.52%)
Mutual labels:  protobuf, protoc
Pb And K
Kotlin Code Generator and Runtime for Protocol Buffers
Stars: ✭ 137 (-6.8%)
Mutual labels:  protobuf, protoc
Protobuf Swift
Google ProtocolBuffers for Apple Swift
Stars: ✭ 925 (+529.25%)
Mutual labels:  protobuf, protoc
gosproto
基于云风的sproto二进制标准上的描述文件及代码生成工具
Stars: ✭ 52 (-64.63%)
Mutual labels:  protobuf, protoc
Protodot
transforming your .proto files into .dot files (and .svg, .png if you happen to have graphviz installed)
Stars: ✭ 107 (-27.21%)
Mutual labels:  protobuf, protoc
makego
Makefile setup for our Golang projects.
Stars: ✭ 65 (-55.78%)
Mutual labels:  protobuf, protoc
protopatch
protoc-gen-go patch utility
Stars: ✭ 58 (-60.54%)
Mutual labels:  protobuf, protoc
proto2gql
The project has been migrated to https://github.com/EGT-Ukraine/go2gql.
Stars: ✭ 21 (-85.71%)
Mutual labels:  protobuf, protoc
Protoc Gen Gotemplate
📂 generic protocol generator based on golang's text/template (grpc/protobuf)
Stars: ✭ 284 (+93.2%)
Mutual labels:  protobuf, protoc
go2gql
graphql-go schema generator by proto files
Stars: ✭ 33 (-77.55%)
Mutual labels:  protobuf, protoc
protobuf-maven-plugin
Maven Plugin that executes the Protocol Buffers (protoc) compiler
Stars: ✭ 204 (+38.78%)
Mutual labels:  protobuf, protoc
Prototool
Your Swiss Army Knife for Protocol Buffers
Stars: ✭ 4,932 (+3255.1%)
Mutual labels:  protobuf, protoc
Protobuf
Protocol Buffers - Google's data interchange format
Stars: ✭ 52,305 (+35481.63%)
Mutual labels:  protobuf, protoc

goprotowrap

A package-at-a-time wrapper for protoc, for generating Go protobuf code.

Build Status

protowrap is a small tool we found helpful when working with protocol buffers in Go at Square. We're publishing it in the hope that others find it useful too. Contributions are welcome.

Install

go get -u github.com/square/goprotowrap/cmd/protowrap

Philosophy

Unlike other language plugins, the Go protobuf plugin expects to be called separately for each package, and given all files in that package.

protowrap is called instead of protoc, and ensures that .proto files are processed one Go package at a time.

It parses out the flags it understands, passing the rest through to protoc unchanged.

Operation

  • search for all .proto files under the same import paths as the .proto file arguments
  • call protoc to generate FileDescriptorProtos
  • inspect the FileDescriptorProtos to deduce package information
  • group .proto files into packages
  • call protoc once for each package

TODOs

  • [x] Replace square-specific handling of go_package with recently updated upstream logic.
  • [ ] In the initial call to protoc for generating FileDescriptorProtos, pass .proto files to protoc in batches instead of all at once.
  • [ ] Better tests, especially of the code paths not exercised by our build process.

License

Copyright 2016 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].