Skip to content

Instantly share code, notes, and snippets.

@hoangong
Last active January 17, 2019 14:20
Show Gist options
  • Save hoangong/0aad5400e064cd1dd7de3eef885ad8a0 to your computer and use it in GitHub Desktop.
Save hoangong/0aad5400e064cd1dd7de3eef885ad8a0 to your computer and use it in GitHub Desktop.
Build scala case class from proto file #scala #proto #rpc
rm -rf output && mkdir output
bin/./scalapbc \
--proto_path=/path/your/proto \
--proto_path=/path/to/googleapis-master/ \ # download from https://github.com/googleapis/googleapis
--proto_path=/path/to/protobuf-master/src/ \ # download from https://github.com/protocolbuffers/protobuf
--scala_out=output rpc.proto
create project/scalapb.sbt
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.16")
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.7.0"
in build.sbt
libraryDependencies += "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment