aiyanbo / sbt-protoc   1.0.19

Apache License 2.0 GitHub

🔢 A plugin for sbt that transforms *.proto files to Java source files

Scala versions: 2.12
sbt plugins: 1.0

sbt-protoc

A plugin for sbt that transforms *.proto files to Java source files.

Build Status GitHub release

Features

  • Support protobuf3
  • Support gRPC
  • Auto upgrade gRPC and protobuf-java libs

Usage

Adding the plugin dependency

In your project, create a file for plugin library dependencies project/plugins.sbt and add the following line:

addSbtPlugin("org.jmotor.sbt" % "sbt-protoc" % "1.0.16")

Enabled sbt-protc plugin

build.sbt

enablePlugins(ProtocPlugin)

Additional protobuf sources in your project


|- project
|---- src/mian/proto
|-------- hello.proto

Settings

Add settings like this:

protocIncludeStdTypes in ProtocConfig := false
name default description
protocVersion latest protoc version
protocGrpcVersion latest grpc version, if you not set used the latest.
protocIncludeStdTypes true include google/protobuf protos.

Credits