-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
227 lines (203 loc) · 9.29 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
ThisBuild / name := "chestnut-flow"
ThisBuild / organization := "org.moda"
ThisBuild / scalaVersion := "2.13.1"
lazy val root = project
.in(file("."))
.settings(name := (name in ThisBuild).value)
.settings(version := (version in ThisBuild).value)
.settings(coverageSettings)
.enablePlugins(JavaAppPackaging)
.enablePlugins(UniversalPlugin)
.aggregate(core)
lazy val idl = project
.in(file("idl"))
.settings(name := "chestnut-idl")
.settings(version := (version in ThisBuild).value)
.settings(scalacOptions ++= commonScalacOptions)
.settings(Seq(jettyAlpnAgent, scalapbDeps))
.enablePlugins(AkkaGrpcPlugin)
.enablePlugins(JavaAgent)
.enablePlugins(JavaAppPackaging)
.enablePlugins(UniversalPlugin)
.settings(depOverrides)
lazy val common = project
.in(file("common"))
.dependsOn(idl)
.settings(name := "chestnut-common")
.settings(version := (version in ThisBuild).value)
.settings(scalacOptions ++= commonScalacOptions)
.settings(Seq(jettyAlpnAgent, scalapbDeps))
.enablePlugins(AkkaGrpcPlugin)
.enablePlugins(JavaAgent)
.enablePlugins(JavaAppPackaging)
.enablePlugins(UniversalPlugin)
.settings(commonDeps, depOverrides)
.settings(silencerSettings)
lazy val auth = project
.in(file("auth"))
.dependsOn(common)
.settings(name := "chestnut-auth")
.settings(version := (version in ThisBuild).value)
.settings(scalacOptions ++= commonScalacOptions)
.settings(Seq(jettyAlpnAgent, scalapbDeps))
.enablePlugins(AkkaGrpcPlugin)
.enablePlugins(JavaAgent)
.enablePlugins(JavaAppPackaging)
.enablePlugins(UniversalPlugin)
.settings(depOverrides)
lazy val mongo = project
.in(file("mongo"))
.dependsOn(common)
.settings(name := "chestnut-mongo")
.settings(version := (version in ThisBuild).value)
.settings(scalacOptions ++= commonScalacOptions)
.settings(Seq(jettyAlpnAgent, scalapbDeps))
.enablePlugins(AkkaGrpcPlugin)
.enablePlugins(JavaAgent)
.enablePlugins(JavaAppPackaging)
.enablePlugins(UniversalPlugin)
.settings(depOverrides)
lazy val core = project
.in(file("core"))
.dependsOn(auth, common, idl, mongo)
.settings(name := "chestnut-core")
.settings(version := (version in ThisBuild).value)
.settings(scalacOptions ++= commonScalacOptions)
.settings(addKinkProjector)
.enablePlugins(AkkaGrpcPlugin)
.enablePlugins(JavaAgent)
.enablePlugins(JavaAppPackaging)
.enablePlugins(UniversalPlugin)
.settings(depOverrides)
// .settings(clusterDeps)
.settings(chestnutCoreDeps)
.settings(packagerSettings)
lazy val wartRemoverSettings = Seq(
wartremoverWarnings ++= Warts.allBut(Wart.Equals)
)
val akkaV = "2.6.4"
val akkaHttpV = "10.1.11"
val akkaHttpJsonV = "1.29.1"
val slickV = "3.3.2"
val catsV = "2.1.0"
val circeV = "0.13.0"
val prometheusV = "0.8.0"
val nettyV = "4.1.38.Final"
val silencerV = "1.6.0"
val akkaDiscoveryV = "0.0.7"
lazy val jettyAlpnAgent = javaAgents += "org.mortbay.jetty.alpn" % "jetty-alpn-agent" % "2.0.9" % "runtime;test"
lazy val scalapbDeps = libraryDependencies += "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
lazy val addKinkProjector = addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3")
lazy val akka = libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-http" % akkaHttpV,
"com.typesafe.akka" %% "akka-stream" % akkaV
)
lazy val commonScalacOptions = Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-unchecked",
"-Ywarn-dead-code",
"-language:postfixOps",
"-language:higherKinds",
"-language:existentials"
)
lazy val coverageSettings = Seq(
coverageEnabled := false,
coverageFailOnMinimum := true,
coverageMinimum := 80,
coverageOutputCobertura := false,
coverageOutputXML := false
)
lazy val silencerSettings = libraryDependencies ++= Seq(
compilerPlugin("com.github.ghik" % "silencer-plugin" % silencerV cross CrossVersion.full),
"com.github.ghik" % "silencer-lib" % silencerV % Provided cross CrossVersion.full
)
addCommandAlias("validate", ";clean;protobuf:protobufGenerate;coverage;test;coverageReport")
addCommandAlias("package", ";core/universal:packageZipTarball")
addCommandAlias("stage", ";core/stage")
addCommandAlias("build", ";validate;coverageOff;package")
addCommandAlias("run", ";monitor/run")
addCommandAlias("pkg", ";core/universal:packageZipTarball")
ThisBuild / publishTo := Some("Artifactory Realm" at "https://repo1.iadmob.com/artifactory/libs-release")
ThisBuild / credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
ThisBuild / sources in doc in Compile := List()
ThisBuild / publishArtifact in packageDoc := false
ThisBuild / publishArtifact in packageSrc := true
resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
lazy val commonDeps = libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor-typed" % akkaV,
"org.typelevel" %% "cats-core" % catsV,
"io.circe" %% "circe-core" % circeV,
"io.circe" %% "circe-generic" % circeV,
"io.circe" %% "circe-parser" % circeV,
"io.circe" %% "circe-generic-extras" % circeV,
"io.prometheus" % "simpleclient" % prometheusV,
"io.prometheus" % "simpleclient_hotspot" % prometheusV,
"io.prometheus" % "simpleclient_common" % prometheusV,
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
"com.github.pureconfig" %% "pureconfig" % "0.12.1",
"com.typesafe" % "config" % "1.4.0",
"com.norbitltd" %% "spoiwo" % "1.6.1",
"commons-io" % "commons-io" % "2.6",
"net.dongliu" % "apk-parser" % "2.6.9",
"com.github.daddykotex" %% "courier" % "2.0.0",
"com.pauldijou" %% "jwt-circe" % "3.0.1",
"org.reactivemongo" %% "reactivemongo" % "1.0.3",
"org.reactivemongo" % "reactivemongo-shaded-native" % "1.0.3-linux-x86-64" % "runtime",
// "net.fehmicansaglam" % "reactivemongo-extensions-core" % "0.10.0.4",
"com.typesafe.slick" %% "slick" % slickV,
"org.slf4j" % "slf4j-nop" % "1.7.26",
"com.typesafe.slick" %% "slick-hikaricp" % slickV,
"org.postgresql" % "postgresql" % "42.2.16",
"com.github.tminglei" %% "slick-pg" % "0.19.2",
"com.github.tminglei" %% "slick-pg_circe-json" % "0.19.2"
)
lazy val chestnutCoreDeps = libraryDependencies ++= Seq(
// "com.typesafe.slick" %% "slick" % slickV,
// "org.slf4j" % "slf4j-nop" % "1.7.26",
// "com.typesafe.slick" %% "slick-hikaricp" % slickV,
// "org.postgresql" % "postgresql" % "42.2.16",
// "com.github.tminglei" %% "slick-pg" % "0.19.2",
// "com.github.tminglei" %% "slick-pg_circe-json" % "0.19.2"
)
lazy val depOverrides = libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-slf4j" % akkaV,
"com.typesafe.akka" %% "akka-actor" % akkaV,
"com.typesafe.akka" %% "akka-actor-typed" % akkaV,
"com.typesafe.akka" %% "akka-stream" % akkaV,
"com.typesafe.akka" %% "akka-cluster" % akkaV,
"com.typesafe.akka" %% "akka-cluster-tools" % akkaV,
"com.typesafe.akka" %% "akka-cluster-metrics" % akkaV,
"com.typesafe.akka" %% "akka-discovery" % akkaV,
"com.typesafe.akka" %% "akka-http-core" % akkaHttpV,
"com.typesafe.akka" %% "akka-http" % akkaHttpV,
"com.typesafe.akka" %% "akka-http2-support" % akkaHttpV,
"com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpV,
"org.typelevel" %% "cats-core" % catsV,
"org.typelevel" %% "cats-free" % catsV,
"io.circe" %% "circe-core" % circeV,
"io.circe" %% "circe-generic" % circeV,
"io.circe" %% "circe-parser" % circeV,
"io.circe" %% "circe-generic-extras" % circeV
)
//lazy val clusterDeps = libraryDependencies ++= List(
// "com.typesafe.akka" %% "akka-cluster" % akkaV,
// "com.typesafe.akka" %% "akka-cluster-tools" % akkaV,
// "com.typesafe.akka" %% "akka-cluster-metrics" % akkaV,
// "com.typesafe.akka" %% "akka-cluster-typed" % akkaV,
// "io.aeron" % "aeron-driver" % "1.25.1",
// "io.aeron" % "aeron-client" % "1.25.1",
// "com.ag" % "akka-node-discovery-consul" % akkaDiscoveryV,
// "com.twitter" %% "chill-akka" % "0.9.5",
//)
lazy val packagerSettings = Seq(mappings in Universal += baseDirectory.value / "deploy/app.sh" -> "app.sh") ++
Option(System.getProperty("conf")).toList.map { conf =>
mappings in Universal ++= {
(baseDirectory.value / "deploy" / conf * "*").get.map { f =>
f -> s"config/${f.name}"
}
}
}