nscn.polaris2.mill
Members list
Packages
Type members
Classlikes
Generates http4s-grpc service bindings, alongside the messages nscn.polaris2.protoc.mill.ProtocModule generates from the same .proto files.
Generates http4s-grpc service bindings, alongside the messages nscn.polaris2.protoc.mill.ProtocModule generates from the same .proto files.
This is the Mill counterpart of org.http4s.grpc.sbt.Http4sGrpcPlugin. Everything to do with finding .proto files, resolving protoc and putting the Well-Known Types on its include path comes from ProtocModule; this trait contributes one more generator to the same protoc invocation, writing into a http4s-grpc/ subdirectory of the generated-sources root so a service file cannot collide with a message file of the same name.
object api extends ScalaModule, Http4sGrpcModule {
def scalaVersion = "3.9.0"
def jvmVersion = "25"
// .proto files live in `api/protobuf` by default
}
Configuration is ProtocModule's: protocProtoSources, protocVersion, protocPath, protocFlatPackage, protocOptions, protocArgs. The service generator receives the same options as the message generator, which is not optional - flat_package and (nscn.polaris2.protoc.file).package_name change where the message types land, and a binding referring to the wrong name does not compile.
Both mill-protoc-runtime and mill-http4s-grpc-core are added to mvnDeps through super, so a module that adds its own dependencies must do the same:
def mvnDeps = Task { super.mvnDeps() ++ Seq(mvn"org.typelevel::cats-core:2.13.0") }
A bare def mvnDeps = Seq(...) compiles cleanly - Mill's build-file compiler inserts override for you - and silently drops both runtimes.
Both artifacts live in a self-hosted registry rather than Maven Central, so the consuming module also needs def repositories = Seq("https://forgejo.wolf109909.top/api/packages/NorthstarCN/maven") (additive: Mill appends Coursier's defaults), in addition to the //| repositories: header that resolves the plugin itself.
Attributes
- Companion
- object
- Supertypes
-
trait ProtocModuletrait ScalaModuletrait ScalaModuleApitrait ScalaModuleBasetrait JavaModuletrait JavaModuleApitrait JdkCommandsModuletrait AssemblyModuletrait SemanticDbJavaModuletrait SemanticDbJavaModuleApitrait OfflineSupportModuletrait GenIdeaModuletrait GenIdeaModuleApitrait RunModuletrait RunModuleApitrait DefaultTaskModuletrait JavaModuleBasetrait BspModuletrait BspModuleApitrait WithJvmWorkerModuletrait JavaHomeModuletrait CoursierModuletrait Moduletrait ModuleApitrait Wrapperclass BaseClasstrait Cachertrait Cacherclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Http4sGrpcModule.type