-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
83 lines (73 loc) · 2.69 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
import sbtassembly.AssemblyPlugin.autoImport.assembly
inThisBuild(
List(
organization := "pl.lewapek",
scalaVersion := "3.4.1",
version := IO.read(file("version")).linesIterator.next()
)
)
lazy val assemblySettings = Seq(
assembly / assemblyMergeStrategy := {
case PathList("META-INF", _) => MergeStrategy.discard
case x if x.contains("io.netty.versions.properties") => MergeStrategy.first
case x if x.contains("rally-version.properties") => MergeStrategy.discard
case x if x.endsWith("module-info.class") => MergeStrategy.discard
case x if x.endsWith(":LICENSE") => MergeStrategy.discard
case x if x.endsWith(":NOTICE") => MergeStrategy.discard
case x if x.endsWith(".config") => MergeStrategy.discard
case x if x.endsWith(".json") => MergeStrategy.first
case x if Assembly.isConfigFile(x) =>
MergeStrategy.concat
case x =>
MergeStrategy.first
},
assembly / logLevel := Level.Info,
assembly / assemblyJarName := s"app-assembly-${version.value}.jar",
assembly / test := {},
assembly / assemblyOutputPath := {
(assembly / baseDirectory).value / "target" / (assembly / assemblyJarName).value
}
)
lazy val common = (project in file("modules/common"))
.settings(
libraryDependencies = Dependencies.common,
scalacOptions -= "-Wunused:imports"
)
.disablePlugins(AssemblyPlugin)
lazy val product = (project in file("modules/product"))
.settings(
name := "product",
scalacOptions -= "-Wunused:imports"
)
.dependsOn(common)
.settings(assemblySettings)
.enablePlugins(AssemblyPlugin)
lazy val order = (project in file("modules/order"))
.settings(
name := "order",
scalacOptions -= "-Wunused:imports"
)
.dependsOn(common)
.settings(assemblySettings)
.enablePlugins(AssemblyPlugin)
lazy val view = (project in file("modules/view"))
.settings(
name := "view",
scalacOptions -= "-Wunused:imports"
)
.dependsOn(common)
.settings(assemblySettings)
.enablePlugins(AssemblyPlugin)
lazy val consumer = (project in file("modules/consumer"))
.settings(
name := "consumer",
scalacOptions -= "-Wunused:imports",
libraryDependencies = Dependencies.kafka
)
.dependsOn(common)
.settings(assemblySettings)
.enablePlugins(AssemblyPlugin)
addCommandAlias("fmt", "all scalafmtSbt scalafmtAll")
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheckAll")
addCommandAlias("fix", ";scalafixAll; test:scalafixAll; scalafmtAll; scalafmtSbt")
addCommandAlias("fixCheck", ";test:compile ;scalafixAll --check ;scalafmtCheckAll; scalafmtSbtCheck")