Installing ScalaPB
#
Installing in SBT (Recommended!)To automatically generate Scala case classes for your messages add ScalaPB's
sbt plugin to your project. Create a file named project/scalapb.sbt
containing the following lines:
Add the following line to your build.sbt
:
ScalaPB will look for protocol buffer (.proto
) files under src/main/protobuf
, which can be customized. Running the compile
command in sbt will generate Scala
sources for your protos and compile them.
For additional configuration options, see ScalaPB SBT Settings.
#
Running Standalone Using scalapbcIf you would like to compile protocol buffers into Scala outside SBT, you can use scalapbc (ScalaPB compiler).
See ScalaPBC.
#
Running from MavenUsing ScalaPBC, you can get maven to generate the code for you. Check out the ScalaPB Maven example.
#
Next:Read about the Generated Code.