-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
45 lines (41 loc) · 1.61 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import sbt.Keys._
lazy val commonSettings = Seq(
scalaVersion := "2.12.1",
version := "0.1.0",
organization := "com.github.baccata"
)
lazy val GOPATH = "/Users/oliviermelois/go"
lazy val googleApi = project
.in(file("third_party"))
.settings(commonSettings)
.settings(
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value
),
PB.protoSources in Compile ++= Seq(file(
s"$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/")),
libraryDependencies += "com.trueaccord.scalapb" %% "scalapb-runtime" % com.trueaccord.scalapb.compiler.Version.scalapbVersion % "protobuf"
)
lazy val grpcDemo = project
.in(file("."))
.settings(commonSettings)
.dependsOn(googleApi)
.aggregate(googleApi)
.settings(
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value
),
PB.protocOptions in Compile ++= Seq(
"-I/usr/local/include",
s"-I$GOPATH/src",
s"-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis",
"--go_out=Mgoogle/api/annotations.proto=github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api,plugins=grpc:./gateway",
"--grpc-gateway_out=logtostderr=true:./gateway",
"--swagger_out=logtostderr=true:./gateway"
),
libraryDependencies ++= Seq(
"io.grpc" % "grpc-all" % "1.1.2",
"com.trueaccord.scalapb" %% "scalapb-runtime" % com.trueaccord.scalapb.compiler.Version.scalapbVersion % "protobuf",
"com.trueaccord.scalapb" %% "scalapb-runtime-grpc" % com.trueaccord.scalapb.compiler.Version.scalapbVersion
)
)