Use scalapb-protoc with Dotty
See original GitHub issueI’m trying to set up a project with Dotty.
Currently my project/protoc.sbt
looks like this:
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.19")
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.8.3"
I’m using libraries compiled to Scala 2.12 by using withDottyCompat
in my build.sbt
, as explained in the Dotty docs:
lazy val root = project
.in(file("."))
.settings(
libraryDependencies ++= scalaDeps.map(_.withDottyCompat(scalaVersion.value))
++ javaDeps
)
Unfortunately, it appears that sbt-protoc
is adding runtime dependencies using %%
, which makes it pick up the Dotty version (currently 0.13
):
[error] (update) sbt.librarymanagement.ResolveException: unresolved dependency:
com.thesamet.scalapb#scalapb-runtime_0.13;0.8.3: not found
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Using with Dotty - ScalaPB
There is no need to use withDottyCompat to get the runtime dependencies correctly added. To use ScalaPB with dotty, ensure you use a...
Read more >ScalaPB/community - Gitter
I have a question about tesing setup, is there a way to have a test proto definitions that will be available in tests,...
Read more >Nadav Samet (@thesamet) / Twitter
Nadav Samet's Tweets ... Released ScalaPB 0.11.0-M3, which is the first version of ScalaPB that comes with full compatibility with Dotty for both...
Read more >sbt-protoc - Scaladex
x of ScalaPB will strip out the -v part (a behavior that will be deprecated later), however it does not take version numbers...
Read more >Access protobuf field name dynamically with scala
Although it's been a long from the question date, I don't think it is answerless. Actually, I have one: Using toPMessage method, you'll...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure thing. Note that current snapshot versions of ScalaPB support Dotty 0.27, so the workaround is not necessary in that case, see for example https://oss.sonatype.org/content/repositories/snapshots/com/thesamet/scalapb/scalapb-runtime_0.27/
I believe this issue can be closed. ScalaPB 0.11.x is tested and released with Scala 3. Usage is documented in https://scalapb.github.io/docs/dotty