-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
87 lines (81 loc) · 2.8 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import sbtprotoc.ProtocPlugin.autoImport.PB
import scalapb.compiler.Version.scalapbVersion
inThisBuild(
Seq(
scalaVersion := versions.scala212,
crossScalaVersions := List(versions.scala213, versions.scala212),
organization := "kr.ikhoon.scalapb-reactor",
homepage := Some(url("https://github.com/ikhoon/scalapb-reactor")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
"ikhoon",
"Ikhun Um",
url("https://github.com/ikhoon")
)
),
startYear := Some(2020),
scalacOptions := Seq(
"-Xsource:2.13"
) ++ Seq("-deprecation", "-encoding", "UTF-8", "-feature", "-unchecked")
)
)
lazy val versions = new {
val armeria = "1.17.0"
val collectionCompat = "2.7.0"
val munit = "1.0.1"
val reactor = "0.8.0"
val reactorGrpc = "1.2.3"
val scala212 = "2.12.16"
val scala213 = "2.13.8"
}
lazy val root = project
.in(file("."))
.settings(
sonatypeProfileName := "kr.ikhoon",
publish / skip := true,
name := "scalapb-reactor",
description := "ScalaPB gRPC generator for Project Reactor"
)
.aggregate(protocGen.agg)
.aggregate(codeGen, e2e)
lazy val codeGen = (project in file("code-gen"))
.enablePlugins(BuildInfoPlugin)
.settings(
name := "scalapb-reactor-codegen",
scalaVersion := versions.scala212,
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "scalapb.reactor",
libraryDependencies ++= Seq(
"com.thesamet.scalapb" %% "compilerplugin" % scalapbVersion,
"org.scala-lang.modules" %% "scala-collection-compat" % versions.collectionCompat
)
)
lazy val protocGen = protocGenProject("protoc-gen-scalapb-reactor", codeGen)
.settings(
Compile / mainClass := Some("scalapb.reactor.ReactorCodeGenerator"),
publishTo := sonatypePublishToBundle.value,
scalaVersion := versions.scala212
)
lazy val e2e = project
.in(file("e2e"))
.enablePlugins(LocalCodeGenPlugin)
.settings(
crossScalaVersions := Seq(versions.scala212, versions.scala213),
publish / skip := true,
libraryDependencies ++= Seq(
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapbVersion,
"io.projectreactor" %% "reactor-scala-extensions" % versions.reactor,
"com.salesforce.servicelibs" % "reactor-grpc-stub" % versions.reactorGrpc,
"com.linecorp.armeria" % "armeria-grpc" % versions.armeria % Test,
"org.scalameta" %% "munit" % versions.munit % Test
),
Compile / PB.targets := Seq(
scalapb.gen(grpc = true) -> (Compile / sourceManaged).value,
genModule(
"scalapb.reactor.ReactorCodeGenerator$"
) -> (Compile / sourceManaged).value
),
codeGenClasspath := (codeGen / Compile / fullClasspath).value
)