addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.11" exclude ("com.trueaccord.scalapb", "protoc-bridge_2.10"))
libraryDependencies += "com.trueaccord.scalapb" %% "compilerplugin-shaded" % "0.6.1"
In build.sbt:
libraryDependencies += "com.trueaccord.scalapb" %% "scalapb-runtime" % com.trueaccord.scalapb.compiler.Version.scalapbVersion % "protobuf"
PB.targets in Compile := Seq(
scalapb.gen() -> //(sourceManaged in Compile).value
baseDirectory.value / "app/data/generated"
)
lazy val protoFolders = Seq(
file("app/models"),
file("app/models/events")
)
PB.protoSources in Compile := protoFolders
--
You received this message because you are subscribed to the Google Groups "ScalaPB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+unsubscribe@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/eace7573-f8da-4763-ac51-1f03f51a9dca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Looks like you are generating into a directory that's under your main source tree. The result of this, like you observed, is that the compiler sees each file twice: first time because it under sourceDirectory and second time because it's on the list returned by the generator. The easiest solution would be to generate it to a different directory (not under app). There may be another solution related to excludeFilter (see http://www.scala-sbt.org/0.13.2/docs/Howto/defaultpaths.html) but I haven't tried that.
On Fri, Jul 21, 2017 at 2:43 PM, Francis <francis...@adendamedia.com> wrote:
I'm having problem migrating from sbt-scalapb to sbt-protoc.The first time building the Protobuf files yields a bunch of errors of the type of: "object XXX is not a member of package YYYY". Compiling a second time seems to find the scala files in question, but instead throws a bunch of errors similar to "XXX is already defined as object XXX" or "YYY is already defined as case class YYY".It seems like the compile is either having a hard time finding the compile files, or tries to call them twice. Any ideas?My scalapb.sbt:addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.11" exclude ("com.trueaccord.scalapb", "protoc-bridge_2.10"))
libraryDependencies += "com.trueaccord.scalapb" %% "compilerplugin-shaded" % "0.6.1"In build.sbt:libraryDependencies += "com.trueaccord.scalapb" %% "scalapb-runtime" % com.trueaccord.scalapb.compiler.Version.scalapbVersion % "protobuf"
PB.targets in Compile := Seq(
scalapb.gen() -> //(sourceManaged in Compile).value
baseDirectory.value / "app/data/generated"
)
lazy val protoFolders = Seq(
file("app/models"),
file("app/models/events")
)
PB.protoSources in Compile := protoFolders
--
You received this message because you are subscribed to the Google Groups "ScalaPB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+u...@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/eace7573-f8da-4763-ac51-1f03f51a9dca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
---Nadav
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+unsubscribe@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/71b30fc1-636b-47a5-812a-e0065321f392%40googlegroups.com.