forked from scanamo/scanamo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
302 lines (283 loc) · 9.44 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
scalaVersion in ThisBuild := "2.12.8"
crossScalaVersions in ThisBuild := Seq("2.11.12", scalaVersion.value)
val catsVersion = "1.6.0"
val catsEffectVersion = "1.2.0"
val scalazVersion = "7.2.27" // Bump as needed for io-effect compat
val scalazIOEffectVersion = "2.10.1"
val shimsVersion = "1.7.0"
val zioVersion = "0.6.3"
val commonSettings = Seq(
scalacOptions := Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-unchecked",
"-language:implicitConversions",
"-language:higherKinds",
"-language:existentials",
"-Xfatal-warnings",
"-Xlint:_",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Ypartial-unification"
),
// for simulacrum
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full),
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.9"),
// sbt-doctest leaves some unused values
// see https://github.com/scala/bug/issues/10270
scalacOptions in Test := {
val mainScalacOptions = scalacOptions.value
(if (CrossVersion.partialVersion(scalaVersion.value) == Some((2, 12)))
mainScalacOptions.filter(!Seq("-Ywarn-value-discard", "-Xlint").contains(_)) :+ "-Xlint:-unused,_"
else
mainScalacOptions).filter(_ != "-Xfatal-warnings")
},
scalacOptions in (Compile, console) := (scalacOptions in Test).value,
autoAPIMappings := true,
apiURL := Some(url("http://www.scanamo.org/latest/api/")),
dynamoDBLocalDownloadDir := file(".dynamodb-local"),
dynamoDBLocalPort := 8042,
Test / parallelExecution := false
)
lazy val root = (project in file("."))
.aggregate(formats, scanamo, testkit, alpakka, refined, scalaz, catsEffect, javaTime, joda, zio)
.settings(
commonSettings,
publishingSettings,
noPublishSettings,
startDynamoDBLocal / aggregate := false,
dynamoDBLocalTestCleanup / aggregate := false,
stopDynamoDBLocal / aggregate := false
)
addCommandAlias("tut", "docs/tut")
addCommandAlias("makeMicrosite", "docs/makeMicrosite")
addCommandAlias("publishMicrosite", "docs/publishMicrosite")
val awsDynamoDB = "com.amazonaws" % "aws-java-sdk-dynamodb" % "1.11.503"
lazy val formats = (project in file("formats"))
.settings(
commonSettings,
publishingSettings,
name := "scanamo-formats"
)
.settings(
libraryDependencies ++= Seq(
awsDynamoDB,
"com.chuusai" %% "shapeless" % "2.3.3",
"com.github.mpilquist" %% "simulacrum" % "0.15.0",
"org.typelevel" %% "cats-core" % catsVersion,
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test
),
doctestMarkdownEnabled := true,
doctestDecodeHtmlEntities := true,
doctestTestFramework := DoctestTestFramework.ScalaTest
)
.dependsOn(testkit % "test->test")
lazy val refined = (project in file("refined"))
.settings(
commonSettings,
publishingSettings,
name := "scanamo-refined"
)
.settings(
libraryDependencies ++= Seq(
"eu.timepit" %% "refined" % "0.9.4",
"org.scalatest" %% "scalatest" % "3.0.5" % Test
)
)
.dependsOn(formats)
lazy val scanamo = (project in file("scanamo"))
.settings(
commonSettings,
publishingSettings,
name := "scanamo"
)
.settings(
libraryDependencies ++= Seq(
awsDynamoDB,
"com.chuusai" %% "shapeless" % "2.3.3",
"org.typelevel" %% "cats-free" % catsVersion,
"com.github.mpilquist" %% "simulacrum" % "0.15.0",
// Use Joda for custom conversion example
"org.joda" % "joda-convert" % "2.2.0" % Provided,
"joda-time" % "joda-time" % "2.10.1" % Test,
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test
)
)
.dependsOn(formats, testkit % "test->test")
lazy val testkit = (project in file("testkit"))
.settings(
commonSettings,
publishingSettings,
name := "scanamo-testkit",
libraryDependencies ++= Seq(
awsDynamoDB
)
)
lazy val catsEffect = (project in file("cats"))
.settings(
name := "scanamo-cats-effect",
commonSettings,
publishingSettings,
libraryDependencies ++= List(
awsDynamoDB,
"org.typelevel" %% "cats-free" % catsVersion,
"org.typelevel" %% "cats-core" % catsVersion,
"org.typelevel" %% "cats-effect" % catsEffectVersion,
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test
),
fork in Test := true,
scalacOptions in (Compile, doc) += "-no-link-warnings"
)
.dependsOn(formats, scanamo, testkit % "test->test")
lazy val scalaz = (project in file("scalaz"))
.settings(
name := "scanamo-scalaz",
commonSettings,
publishingSettings,
libraryDependencies ++= List(
awsDynamoDB,
"com.codecommit" %% "shims" % shimsVersion,
"org.scalaz" %% "scalaz-core" % scalazVersion,
"org.scalaz" %% "scalaz-ioeffect" % scalazIOEffectVersion,
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test
),
fork in Test := true,
scalacOptions in (Compile, doc) += "-no-link-warnings"
)
.dependsOn(formats, scanamo, testkit % "test->test")
lazy val zio = (project in file("scalaz-zio"))
.settings(
name := "scanamo-scalaz-zio",
commonSettings,
publishingSettings,
libraryDependencies ++= List(
awsDynamoDB,
"org.typelevel" %% "cats-core" % catsVersion,
"org.typelevel" %% "cats-effect" % catsEffectVersion,
"org.scalaz" %% "scalaz-zio" % zioVersion,
"org.scalaz" %% "scalaz-zio-interop-cats" % zioVersion,
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"org.scalacheck" %% "scalacheck" % "1.14.0" % Test
),
fork in Test := true,
scalacOptions in (Compile, doc) += "-no-link-warnings"
)
.dependsOn(formats, scanamo, testkit % "test->test")
lazy val alpakka = (project in file("alpakka"))
.settings(
commonSettings,
publishingSettings,
name := "scanamo-alpakka"
)
.settings(
libraryDependencies ++= Seq(
awsDynamoDB,
"org.typelevel" %% "cats-free" % catsVersion,
"com.lightbend.akka" %% "akka-stream-alpakka-dynamodb" % "0.20",
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test
),
fork in Test := true,
// unidoc can work out links to other project, but scalac can't
scalacOptions in (Compile, doc) += "-no-link-warnings"
)
.dependsOn(formats, scanamo, testkit % "test->test")
lazy val javaTime = (project in file("java-time"))
.settings(
commonSettings,
publishingSettings,
name := "scanamo-time"
)
.settings(
libraryDependencies ++= List(
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test,
"com.47deg" %% "scalacheck-toolbox-datetime" % "0.2.5" % Test
)
)
.dependsOn(formats)
lazy val joda = (project in file("joda"))
.settings(
commonSettings,
publishingSettings,
name := "scanamo-joda"
)
.settings(
libraryDependencies ++= List(
"org.joda" % "joda-convert" % "2.2.0" % Provided,
"joda-time" % "joda-time" % "2.10.1",
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test,
"com.47deg" %% "scalacheck-toolbox-datetime" % "0.2.5" % Test
)
)
.dependsOn(formats)
lazy val docs = (project in file("docs"))
.settings(
commonSettings,
micrositeSettings,
noPublishSettings,
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.yml",
ghpagesNoJekyll := false,
git.remoteRepo := "[email protected]:scanamo/scanamo.git",
makeMicrosite := makeMicrosite.dependsOn(unidoc in Compile).value,
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), siteSubdirName in ScalaUnidoc),
siteSubdirName in ScalaUnidoc := "latest/api"
)
.enablePlugins(MicrositesPlugin, SiteScaladocPlugin, GhpagesPlugin, ScalaUnidocPlugin)
.dependsOn(scanamo % "compile->test", alpakka % "compile", refined % "compile")
val publishingSettings = Seq(
organization := "org.scanamo",
homepage := Some(url("http://www.scanamo.org/")),
licenses := Seq("Apache V2" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")),
publishArtifact in Test := false,
scmInfo := Some(
ScmInfo(
url("https://github.com/scanamo/scanamo"),
"scm:git:[email protected]:scanamo/scanamo.git"
)
),
developers := List(
Developer("philwills", "Phil Wills", "", url("https://github.com/philwills")),
Developer(
"regiskuckaertz",
"Regis Kuckaertz",
url("https://github.com/regiskuckaertz")
)
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
val micrositeSettings = Seq(
micrositeName := "Scanamo",
micrositeDescription := "Scanamo: simpler DynamoDB access for Scala",
micrositeAuthor := "Scanamo Contributors",
micrositeGithubOwner := "scanamo",
micrositeGithubRepo := "scanamo",
micrositeBaseUrl := "",
micrositeDocumentationUrl := "/latest/api",
micrositeHighlightTheme := "color-brewer",
micrositeGitterChannel := false,
micrositePalette := Map(
"brand-primary" -> "#951c55",
"brand-secondary" -> "#005689",
"brand-tertiary" -> "#00456e",
"gray-dark" -> "#453E46",
"gray" -> "#837F84",
"gray-light" -> "#E3E2E3",
"gray-lighter" -> "#F4F3F4",
"white-color" -> "#FFFFFF"
)
)