This repository has been archived by the owner on Dec 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
84 lines (75 loc) · 2.75 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
// *****************************************************************************
// Projects
// *****************************************************************************
lazy val `hello-grpc-proto` =
project
.in(file("."))
.enablePlugins(AutomateHeaderPlugin, GitVersioning)
.settings(settings)
.settings(
libraryDependencies ++= Seq(
library.grpcNetty,
library.scalaPbRuntime,
library.scalaPbRuntimeGrpc,
library.scalaCheck % Test,
library.scalaTest % Test
)
)
// *****************************************************************************
// Library dependencies
// *****************************************************************************
import com.trueaccord.scalapb.compiler.{ Version => VersionPb }
lazy val library =
new {
object Version {
val scalaCheck = "1.13.5"
val scalaTest = "3.0.3"
}
val grpcNetty = "io.grpc" % "grpc-netty" % VersionPb.grpcJavaVersion
val scalaCheck = "org.scalacheck" %% "scalacheck" % Version.scalaCheck
val scalaPbRuntime = "com.trueaccord.scalapb" %% "scalapb-runtime" % VersionPb.scalapbVersion % "protobuf"
val scalaPbRuntimeGrpc = "com.trueaccord.scalapb" %% "scalapb-runtime-grpc" % VersionPb.scalapbVersion
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
}
// *****************************************************************************
// Settings
// *****************************************************************************
lazy val settings =
commonSettings ++
gitSettings ++
headerSettings ++
scalaPbSettings
lazy val commonSettings =
Seq(
// scalaVersion from .travis.yml via sbt-travisci
// scalaVersion := "2.12.2",
organization := "io.ontherocks",
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")),
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-target:jvm-1.8",
"-encoding", "UTF-8",
"-Ywarn-unused-import"
),
unmanagedSourceDirectories.in(Compile) := Seq(scalaSource.in(Compile).value),
unmanagedSourceDirectories.in(Test) := Seq(scalaSource.in(Test).value),
shellPrompt in ThisBuild := { state =>
val project = Project.extract(state).currentRef.project
s"[$project]> "
}
)
lazy val gitSettings =
Seq(
git.useGitDescribe := true
)
import de.heikoseeberger.sbtheader.HeaderPattern
import de.heikoseeberger.sbtheader.license._
lazy val headerSettings =
Seq(
headers := Map("scala" -> Apache2_0("2017", "Petra Bierleutgeb"))
)
lazy val scalaPbSettings = Seq(
PB.targets in Compile := Seq(scalapb.gen() -> (sourceManaged in Compile).value)
)