Last active
January 17, 2019 14:20
-
-
Save hoangong/0aad5400e064cd1dd7de3eef885ad8a0 to your computer and use it in GitHub Desktop.
Build scala case class from proto file #scala #proto #rpc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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