aiyanbo / sbt-protoc

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

GitHub

sbt-protoc

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

Build Status GitHub release

Features

  • Support protobuf3
  • Support gRPC

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.9")

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