-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
99 lines (88 loc) · 2.54 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
import Dependencies._
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "2.13.12"
ThisBuild / organization := "com.github.baklanovsoft"
ThisBuild / scalacOptions += "-Ymacro-annotations"
ThisBuild / libraryDependencies ++= Dependencies.plugins
val assemblyStrategy = assembly / assemblyMergeStrategy := {
// to not apply local development override configurations
case PathList("params.conf") =>
MergeStrategy.discard
// openapi docs generation
// case PathList("META-INF", "maven", "org.webjars", "swagger-ui", "pom.properties") =>
// MergeStrategy.singleOrError
// lot of metainf folders might override this project's metainf which will result in error:
// Could not find or load main class com.github.baklanovsoft.imagehosting.resizer.Main
case PathList("META-INF", xs @ _*) =>
xs.map(_.toLowerCase) match {
// allow some metainf such as logback be written
case "services" :: xs =>
MergeStrategy.filterDistinctLines
case _ => MergeStrategy.discard
}
// deduplicate error because of logback, this will fix
case x =>
MergeStrategy.first
}
lazy val domain = (project in file("domain"))
.settings(
name := "image-hosting-processing-domain"
)
.settings(
libraryDependencies ++= Seq(
newtype,
enumeratum,
chimney
) ++ codecs
)
.settings(
libraryDependencies += Testing.scalatest
)
lazy val common = (project in file("common"))
.settings(
name := "image-hosting-processing-common"
)
.settings(
libraryDependencies ++= Seq(
cats,
catsEffect,
fs2Kafka,
minioClient
) ++ Seq(fs2).flatten
)
.dependsOn(domain)
lazy val resizer = (project in file("resizer"))
.settings(
name := "image-hosting-processing-resizer"
)
.settings(
assemblyStrategy,
// for no main manifest attribute error
assembly / mainClass := Some("com.github.baklanovsoft.imagehosting.resizer.Main")
)
.settings(
libraryDependencies ++= Seq(
imgscalr
) ++ Seq(
pureconfig,
logging
).flatten
)
.dependsOn(domain, common)
lazy val recognizer = (project in file("recognizer"))
.settings(
name := "image-hosting-processing-recognizer"
)
.settings(
assemblyStrategy,
// for no main manifest attribute error
assembly / mainClass := Some("com.github.baklanovsoft.imagehosting.recognizer.Main")
)
.settings(
libraryDependencies ++= Seq(
djl,
pureconfig,
logging
).flatten
)
.dependsOn(domain, common)