-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
391 lines (350 loc) · 14.1 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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
/*
* Copyright 2019 BusyMachines
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//=============================================================================
//============================== build details ================================
//=============================================================================
addCommandAlias("run-it", "IntegrationTest/test")
Global / onChangedBuildSource := ReloadOnSourceChanges
// format: off
val Scala213 = "2.13.6"
val Scala3 = "3.0.1"
// format: on
//=============================================================================
//============================ publishing details =============================
//=============================================================================
//see: https://github.com/xerial/sbt-sonatype#buildsbt
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
ThisBuild / baseVersion := "0.4"
ThisBuild / organization := "com.busymachines"
ThisBuild / organizationName := "BusyMachines"
ThisBuild / homepage := Option(url("https://github.com/busymachines/pureharm-aws"))
ThisBuild / scmInfo := Option(
ScmInfo(
browseUrl = url("https://github.com/busymachines/pureharm-aws"),
connection = "git@github.com:busymachines/pureharm-aws.git",
)
)
/** I want my email. So I put this here. To reduce a few lines of code, the sbt-spiewak plugin generates this (except
* email) from these two settings:
* {{{
* ThisBuild / publishFullName := "Loránd Szakács"
* ThisBuild / publishGithubUser := "lorandszakacs"
* }}}
*/
ThisBuild / developers := List(
Developer(
id = "lorandszakacs",
name = "Loránd Szakács",
email = "lorand.szakacs@protonmail.com",
url = new java.net.URL("https://github.com/lorandszakacs"),
)
)
ThisBuild / startYear := Some(2019)
ThisBuild / licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
//until we get to 1.0.0, we keep strictSemVer false
ThisBuild / strictSemVer := false
ThisBuild / spiewakCiReleaseSnapshots := false
ThisBuild / spiewakMainBranches := List("main")
ThisBuild / Test / publishArtifact := false
ThisBuild / scalaVersion := Scala213
ThisBuild / crossScalaVersions := List(Scala213, Scala3)
//required for binary compat checks
ThisBuild / versionIntroduced := Map(
Scala213 -> "0.1.0",
Scala3 -> "0.4.0",
)
//=============================================================================
//================================ Dependencies ===============================
//=============================================================================
ThisBuild / resolvers += Resolver.sonatypeRepo("releases")
ThisBuild / resolvers += Resolver.sonatypeRepo("snapshots")
// format: off
/* currently, pretty much only S3 is usable, cloudfront and logs lack some serious features:
* - cloudfront: cannot sign
* - logs: uses shitty interop w/ slf4j. Way too much magic...
*/
val awsJavaSdkV = "1.11.996" //java — https://github.com/aws/aws-sdk-java/releases
val awsJavaSdkV2V = "2.16.39" //java — https://github.com/aws/aws-sdk-java-v2/releases
val pureharmCoreV = "0.3.0" //https://github.com/busymachines/pureharm-core/releases
val pureharmEffectsV = "0.5.0" //https://github.com/busymachines/pureharm-effects/releases
val pureharmJsonV = "0.3.0-M1" //https://github.com/busymachines/pureharm-json/releases
val pureharmTestkitV = "0.4.0" //https://github.com/busymachines/pureharm-testkit/releases
val fs2V = "3.0.6" //https://github.com/typelevel/fs2/releases
val fs2CE2V = "2.5.9" //https://github.com/typelevel/fs2/releases
val monixV = "3.4.0" //https://github.com/monix/monix/releases - used only for Java future conversion. Drop once we migrate to CE3, and use it from there
val log4catsV = "2.1.1" //https://github.com/ChristopherDavenport/log4cats/releases
val log4catsCE2V = "1.3.1" //https://github.com/ChristopherDavenport/log4cats/releases
val logbackV = "1.2.3" //https://github.com/qos-ch/logback/releases
val http4sV = "0.23.0" //https://github.com/http4s/http4s/releases
val http4sCE2V = "0.22.1" //https://github.com/http4s/http4s/releases
val amazonCloudFront = "com.amazonaws" % "aws-java-sdk-cloudfront" % awsJavaSdkV withSources()
val amazonLogs = "com.amazonaws" % "aws-java-sdk-logs" % awsJavaSdkV withSources()
val amazonRegionsV2 = "software.amazon.awssdk" % "regions" % awsJavaSdkV2V withSources()
val amazonS3V2 = "software.amazon.awssdk" % "s3" % awsJavaSdkV2V withSources()
val amazonSNSV2 = "software.amazon.awssdk" % "sns" % awsJavaSdkV2V withSources()
val pureharmCoreAnomaly = "com.busymachines" %% "pureharm-core-anomaly" % pureharmCoreV withSources()
val pureharmCoreSprout = "com.busymachines" %% "pureharm-core-sprout" % pureharmCoreV withSources()
val pureharmEffectsCats = "com.busymachines" %% "pureharm-effects-cats" % pureharmEffectsV withSources()
val pureharmEffectsCE2 = "com.busymachines" %% "pureharm-effects-cats-2" % pureharmEffectsV withSources()
val pureharmJsonCirce = "com.busymachines" %% "pureharm-json-circe" % pureharmJsonV withSources()
val pureharmTestkit = "com.busymachines" %% "pureharm-testkit" % pureharmTestkitV withSources()
val pureharmTestkitCE2 = "com.busymachines" %% "pureharm-testkit-ce2" % pureharmTestkitV withSources()
val monixCatnap = "io.monix" %% "monix-catnap" % monixV withSources()
val fs2IO = "co.fs2" %% "fs2-io" % fs2V withSources()
val fs2IOCE2 = "co.fs2" %% "fs2-io" % fs2CE2V withSources()
val http4sClient = "org.http4s" %% "http4s-ember-client" % http4sV withSources()
val http4sClientCE2 = "org.http4s" %% "http4s-ember-client" % http4sCE2V withSources()
val log4catsCore = "org.typelevel" %% "log4cats-core" % log4catsV withSources()
val log4catsSlf4j = "org.typelevel" %% "log4cats-slf4j" % log4catsV withSources()
val log4catsCoreCE2 = "org.typelevel" %% "log4cats-core" % log4catsCE2V withSources()
val log4catsSlf4jCE2 = "org.typelevel" %% "log4cats-slf4j" % log4catsCE2V withSources()
val logbackClassic = "ch.qos.logback" % "logback-classic" % logbackV withSources()
// format: on
//=============================================================================
//============================== Project details ==============================
//=============================================================================
lazy val root = Project(id = "pureharm-aws", base = file("."))
.enablePlugins(NoPublishPlugin)
.enablePlugins(SonatypeCiReleasePlugin)
.settings(commonSettings)
.aggregate(
`aws-core`,
`aws-s3`,
`aws-cloudfront`,
`aws-logger`,
`aws-sns`,
`aws-core-ce2`,
`aws-s3-ce2`,
`aws-cloudfront-ce2`,
`aws-logger-ce2`,
`aws-sns-ce2`,
)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++ AWS ++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
lazy val `aws-core` = project
.settings(commonSettings)
.settings(
name := "pureharm-aws-core",
libraryDependencies ++= Seq(
pureharmCoreSprout,
pureharmCoreAnomaly,
pureharmEffectsCats,
amazonRegionsV2,
),
)
//#############################################################################
lazy val `aws-s3` = project
.settings(commonSettings)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
name := "pureharm-aws-s3",
libraryDependencies ++= Seq(
fs2IO,
pureharmCoreAnomaly,
pureharmCoreSprout,
pureharmEffectsCats,
amazonS3V2,
pureharmTestkit % ITT,
log4catsSlf4j % ITT,
logbackClassic % ITT,
),
)
.dependsOn(
`aws-core`
)
//#############################################################################
lazy val `aws-cloudfront` = project
.settings(commonSettings)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
name := "pureharm-aws-cloudfront",
libraryDependencies ++= Seq(
pureharmCoreAnomaly,
pureharmCoreSprout,
pureharmEffectsCats,
amazonCloudFront,
pureharmTestkit % ITT,
log4catsSlf4j % ITT,
http4sClient % ITT,
logbackClassic % ITT,
),
)
.dependsOn(
`aws-core`,
`aws-s3`,
)
//#############################################################################
lazy val `aws-logger` = project
.settings(commonSettings)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
name := "pureharm-aws-logger",
libraryDependencies ++= Seq(
pureharmCoreAnomaly,
pureharmCoreSprout,
pureharmEffectsCats,
amazonLogs,
log4catsCore,
pureharmTestkit % ITT,
log4catsSlf4j % ITT,
logbackClassic % ITT,
),
)
.dependsOn(
`aws-core`
)
//#############################################################################
lazy val `aws-sns` = project
.settings(commonSettings)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
name := "pureharm-aws-sns",
libraryDependencies ++= Seq(
pureharmCoreAnomaly,
pureharmCoreSprout,
pureharmEffectsCats,
pureharmJsonCirce,
amazonSNSV2,
pureharmTestkit % ITT,
log4catsSlf4j % ITT,
http4sClient % ITT,
logbackClassic % ITT,
),
)
.dependsOn(
`aws-core`
)
//#############################################################################
//###################### cats-effect 2 modules ################################
//#############################################################################
lazy val `aws-core-ce2` = project
.settings(commonSettings)
.settings(
name := "pureharm-aws-core-ce2",
libraryDependencies ++= Seq(
pureharmCoreSprout,
pureharmCoreAnomaly,
pureharmEffectsCE2,
amazonRegionsV2,
),
)
//#############################################################################
lazy val `aws-s3-ce2` = project
.settings(commonSettings)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
name := "pureharm-aws-s3-ce2",
libraryDependencies ++= Seq(
monixCatnap,
fs2IOCE2,
pureharmCoreAnomaly,
pureharmCoreSprout,
pureharmEffectsCE2,
amazonS3V2,
pureharmTestkitCE2 % ITT,
log4catsSlf4jCE2 % ITT,
logbackClassic % ITT,
),
)
.dependsOn(
`aws-core-ce2`
)
//#############################################################################
lazy val `aws-cloudfront-ce2` = project
.settings(commonSettings)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
name := "pureharm-aws-cloudfront-ce2",
libraryDependencies ++= Seq(
pureharmCoreAnomaly,
pureharmCoreSprout,
pureharmEffectsCE2,
amazonCloudFront,
pureharmTestkitCE2 % ITT,
log4catsSlf4jCE2 % ITT,
http4sClientCE2 % ITT,
logbackClassic % ITT,
),
)
.dependsOn(
`aws-core-ce2`,
`aws-s3-ce2`,
)
//#############################################################################
lazy val `aws-logger-ce2` = project
.settings(commonSettings)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
name := "pureharm-aws-logger-ce2",
libraryDependencies ++= Seq(
pureharmCoreAnomaly,
pureharmCoreSprout,
pureharmEffectsCE2,
amazonLogs,
log4catsCore,
pureharmTestkitCE2 % ITT,
log4catsSlf4jCE2 % ITT,
logbackClassic % ITT,
),
)
.dependsOn(
`aws-core-ce2`
)
//#############################################################################
lazy val `aws-sns-ce2` = project
.settings(commonSettings)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
name := "pureharm-aws-sns-ce2",
libraryDependencies ++= Seq(
pureharmCoreAnomaly,
pureharmCoreSprout,
pureharmEffectsCE2,
pureharmJsonCirce,
amazonSNSV2,
pureharmTestkitCE2 % ITT,
log4catsSlf4jCE2 % ITT,
http4sClientCE2 % ITT,
logbackClassic % ITT,
),
)
.dependsOn(
`aws-core-ce2`
)
//=============================================================================
//================================= Settings ==================================
//=============================================================================
lazy val commonSettings = Seq(
scalacOptions ++= scalaCompilerOptions(scalaVersion.value)
)
def scalaCompilerOptions(scalaVersion: String): Seq[String] =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, _)) =>
Seq[String](
//"-Xsource:3"
)
case _ => Seq.empty[String]
}
def ITT: String = "it,test"