Protocol buffer compiler for Scala. Consider sponsoring ScalaPB: https://github.com/sponsors/thesamet
mergify[bot] on master
Update scalapb-runtime to 0.11.… (compare)
mergify[bot] on master
Update compilerplugin, scalapb-… (compare)
thesamet on v0.11.13
thesamet on master
Update CHANGELOG.md (compare)
thesamet on master
fix make_plugin_proto.sh and re… (compare)
dependabot[bot] on npm_and_yarn
thesamet on master
Bump eventsource from 1.1.0 to … (compare)
sparksql-scalapb-test
project to reproduce the issue. Here's the draft PR: thesamet/sparksql-scalapb-test#5
def fromRawEventDS[A <: GeneratedMessage : GeneratedMessageCompanion : Encoder](
ds: Dataset[RawEvent]
) = ...
Hi everyone,
I am new to ScalaPB and started by using the tutorial by downloading the project from github: https://scalapb.github.io/docs/getting-started.
I managed to generate the codes after sbt compile in:
target/scala-2.13/src_managed/main/scalapb/com/example/tutorial/addressbook
My main question is how to use the generated codes (case classes for each message) obtained after compiling since they are in ..\target\scala-2.13\src_managed\main\scalapb\tutorial\addressbook\
Also, in the codes from github, there is no tutorial package in /scr/main/scala/: I tried to refactor and create a tutorial package as
\basic\src\main\scala\tutorial\AddressBookMain.scala but I got the same errors: Person and AddressBook are not found (cannot resolve symbol AddressBook and Person).
Coud someone help me with those please, I am really stuck with this (I use IntelliJ IDEA)
Thank you very much,
Best regards.
Maia
target/.../src_managed
is one of them. If you type in sbt sourceDirectories
it will print out this list.
Hi commnunity, I try to implement a server with ScalaPB by following this: https://medium.com/rahasak/reactive-microservices-with-grpc-and-scala-e4767ca2d34a. I got a red highligted error on build() , on server != null, and awaitTermination() is not recognized :val server = ServerBuilder
.forPort(9000)
.addService(ProtoReflectionService.newInstance())
.addService(DocumentServiceGrpc.bindService(new DocumentServiceImpl, ExecutionContext.global))
.build()
.start()
// block until shutdown
if (server != null) {
server.awaitTermination()
}
val server: Server = ...
Hello
Are there any examples of Mill builds using ScalaPB? I'm trying to migrate from SBT
I'm getting File not found
errors for every import I have (including scalapb/scalapb.proto
, validate/validate.proto
, and my own proto files)
This is my build.sc
:
import $ivy.`com.lihaoyi::mill-contrib-scalapblib:$MILL_VERSION`
import mill._, scalalib._, contrib.scalapblib._
object core extends ScalaModule with ScalaPBModule {
override def scalaVersion = common.scalaVersion
override def scalacOptions = common.scalacOptions
override def ivyDeps = Agg(
deps.refined,
deps.scalapbRuntime,
deps.scalapbValidateCore,
deps.scalapbValidateCats,
deps.scalapbJson4s,
)
override def scalacPluginIvyDeps = Agg(
ivy"com.thesamet.scalapb::compilerplugin:0.11.5",
ivy"com.thesamet.scalapb::scalapb-validate-codegen:0.3.2"
)
override def scalaPBVersion = deps.ScalaPBVersion
}
object common {
val scalaVersion = "3.1.0"
val scalacOptions = Seq(
"-deprecation",
"-feature",
"-unchecked",
"-Xmax-inlines",
"10000",
"-Wconf:any:error"
)
val dependencies = Seq(
deps.munit + "test",
deps.pprint + "test"
)
}
object deps {
val ScalaPBVersion = "0.11.6"
val ScalaPBValidateVersion = "0.3.2"
val scalapbRuntime =
ivy"com.thesamet.scalapb::scalapb-runtime:$ScalaPBVersion"
val scalapbValidateCore =
ivy"com.thesamet.scalapb::scalapb-validate-core:$ScalaPBValidateVersion"
val scalapbValidateCats =
ivy"com.thesamet.scalapb::scalapb-validate-cats:$ScalaPBValidateVersion"
val scalapbJson4s = ivy"com.thesamet.scalapb::scalapb-json4s:0.12.0"
val refined = ivy"eu.timepit::refined:0.9.27"
val munit = ivy"org.scalameta::munit:0.7.27"
val pprint = ivy"com.lihaoyi::pprint:0.6.6"
}
With project tree:
.
├── build.sc
└── core
├── protobuf
│ ├── common.proto
│ ├── domain.proto
│ └── options.proto
└── src
└── main.scala
Any hints or links are greatly appreciated!
```
scalaPBUnpackProto
, so there's hope: https://github.com/com-lihaoyi/mill/blob/4f91313aade92016231b7ce260940e10547cb50c/contrib/scalapblib/src/ScalaPBModule.scala#L92