-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
195 lines (181 loc) · 5.6 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
cancelable in Global := true
ThisBuild / scalacOptions += "-P:semanticdb:synthetics:on"
lazy val commonDependencies = Seq(
Dependencies.specs2Core,
Dependencies.specs2Scalacheck
)
lazy val commonSettings = Seq(
unusedCompileDependenciesFilter -= moduleFilter(
"com.sksamuel.scapegoat",
"scalac-scapegoat-plugin"
),
organization := "com.rasterfoundry",
name := "granary",
version := "0.0.1-SNAPSHOT",
scalaVersion := "2.12.10",
scalafmtOnCompile := true,
scapegoatVersion in ThisBuild := Versions.ScapegoatVersion,
externalResolvers := Seq(
DefaultMavenRepository,
Resolver.sonatypeRepo("snapshots"),
// Required transitively
Resolver.bintrayRepo("guizmaii", "maven"),
Resolver.bintrayRepo("colisweb", "maven"),
"jitpack".at("https://jitpack.io")
),
autoCompilerPlugins := true,
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3"),
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1"),
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full),
addCompilerPlugin(scalafixSemanticdb)
)
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.aggregate(api, database, datamodel)
///////////////
// Datamodel //
///////////////
lazy val datamodelSettings = commonSettings ++ Seq(
name := "datamodel",
fork in run := true
)
lazy val datamodelDependencies = commonDependencies ++ Seq(
Dependencies.awsS3,
Dependencies.catsScalacheck,
Dependencies.catsCore,
Dependencies.catsKernel,
Dependencies.circeCore,
Dependencies.circeGeneric,
Dependencies.circeJsonSchema,
Dependencies.circeRefined,
Dependencies.newtype,
Dependencies.refined,
Dependencies.shapeless,
Dependencies.stac4s,
Dependencies.scalacheck
)
lazy val datamodel = (project in file("datamodel"))
.settings(datamodelSettings: _*)
.settings({ libraryDependencies ++= datamodelDependencies })
//////////////
// Database //
//////////////
lazy val databaseSettings = commonSettings ++ Seq(
name := "database",
fork in run := true
)
lazy val databaseDependencies = commonDependencies ++ Seq(
Dependencies.awsBatch,
Dependencies.awsCore,
Dependencies.awsS3,
Dependencies.catsCore,
Dependencies.catsEffect,
Dependencies.catsFree,
Dependencies.catsKernel,
Dependencies.circeCore,
Dependencies.circeJsonSchema,
Dependencies.doobie,
Dependencies.doobieFree,
Dependencies.doobiePostgres,
Dependencies.doobiePostgresCirce,
Dependencies.doobieRefined,
Dependencies.doobieSpecs2,
Dependencies.doobieScalatest,
Dependencies.flyway,
Dependencies.hikariCP,
Dependencies.log4catsCore,
Dependencies.log4catsSlf4j,
Dependencies.newtype,
Dependencies.refined,
Dependencies.scalaReflect,
Dependencies.shapeless,
Dependencies.slf4jApi,
Dependencies.stac4s,
Dependencies.typename
)
lazy val database = (project in file("database"))
.dependsOn(datamodel)
.settings(databaseSettings: _*)
.settings({
libraryDependencies ++= databaseDependencies
})
///////////////
// API //
///////////////
lazy val apiSettings = commonSettings ++ Seq(
name := "api",
fork in run := true,
test in assembly := {},
assemblyJarName in assembly := "granary-api-assembly.jar",
assemblyMergeStrategy in assembly := {
case "reference.conf" => MergeStrategy.concat
case "application.conf" => MergeStrategy.concat
case n if n.startsWith("META-INF/services") => MergeStrategy.concat
case n if n.endsWith(".SF") || n.endsWith(".RSA") || n.endsWith(".DSA") =>
MergeStrategy.discard
case "META-INF/MANIFEST.MF" => MergeStrategy.discard
case _ => MergeStrategy.first
}
)
lazy val apiDependencies = commonDependencies ++ Seq(
Dependencies.awsS3,
Dependencies.catsCore,
Dependencies.catsEffect,
Dependencies.catsFree,
Dependencies.catsKernel,
Dependencies.circeCore,
Dependencies.circeGeneric,
Dependencies.circeJsonSchema,
Dependencies.circeNumbers,
Dependencies.decline,
Dependencies.declineRefined,
Dependencies.doobie,
Dependencies.doobieFree,
Dependencies.doobieHikari,
Dependencies.fs2Core,
Dependencies.hikariCP,
Dependencies.http4sBlazeServer,
Dependencies.http4sCirce % "test",
Dependencies.http4sCore,
Dependencies.http4sDsl,
Dependencies.http4sServer,
Dependencies.log4catsCore,
Dependencies.log4catsSlf4j,
Dependencies.magnolia,
Dependencies.newtype,
Dependencies.openTracing,
Dependencies.pureConfigCore,
Dependencies.pureConfigGeneric,
Dependencies.refined,
Dependencies.shapeless,
Dependencies.slf4jApi,
Dependencies.stac4s,
Dependencies.sttpModel,
Dependencies.tapir,
Dependencies.tapirCirce,
Dependencies.tapirHttp4sServer,
Dependencies.tapirOpenAPICirceYAML,
Dependencies.tapirOpenAPIDocs,
Dependencies.tapirOpenAPIModel,
Dependencies.tapirRefined,
Dependencies.tapirSwaggerUIHttp4s
)
lazy val api = (project in file("api"))
.dependsOn(datamodel % "compile->compile;test->test", database % "compile->compile;test->test")
.settings(apiSettings: _*)
.settings({
libraryDependencies ++= apiDependencies
})
lazy val docs = project // new documentation project
.in(file("granary-docs")) // important: it must not be docs/
.dependsOn(datamodel)
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.settings(
mdocVariables := Map(
"TASK_ID" -> "1d99bab2-1470-46c8-aa00-a8a2ced5c60c",
"EXECUTION_ID" -> "78d4345a-5c22-43ec-8a9a-fe354915c3eb",
"WEBHOOK_ID" -> "f0ff558a-f989-4648-b606-abcf8b977e6c",
"INVOCATION_TIME" -> "1583248611188"
),
libraryDependencies ++= Seq(Dependencies.circeLiteral)
)