I have been using sbt-protobuf to generate Java classes from proto definition files. I now want to generate Scala classes as well. To do that, I try to use the ScalaPB plugin. The goal is to have one src/main/protobuf/
directory in the project and generate both Java and Scala classes from those definitions.
The problem is that when I add the ScalaPB dependency in my project it stops generating the Java classes (it only generate Scala case classes).
In fact, trying to modify any traditional sbt-protobuf settings, always results in this (or similar) error message:
build.sbt:YYY: error: reference to protocOptions is ambiguous;
it is imported twice in the same scope by
import _root_.sbtprotobuf.ProtobufPlugin._
and import _root_.com.trueaccord.scalapb.ScalaPbPlugin._
protocOptions in SPB.protobufConfig ++= Seq(..)
I am not sure if these two issues are related. The idea was to change the protocOptions
to enforce the generation of the Java classes.