forked from ing-bank/baker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
209 lines (194 loc) · 5.74 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
import Dependencies.{scalaGraph, _}
import sbt.Keys._
def testScope(project: ProjectReference) = project % "test->test;test->compile"
val commonSettings = Defaults.coreDefaultSettings ++ Seq(
organization := "com.ing.baker",
scalaVersion := "2.12.4",
crossScalaVersions := Seq("2.12.4"),
fork := true,
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v"),
javacOptions := Seq("-source", jvmV, "-target", jvmV),
scalacOptions := Seq(
"-unchecked",
"-deprecation",
"-feature",
"-Ywarn-dead-code",
"-language:higherKinds",
"-language:existentials",
"-language:implicitConversions",
"-language:postfixOps",
"-encoding", "utf8",
s"-target:jvm-$jvmV",
"-Xfatal-warnings"
),
packageOptions in (Compile, packageBin) +=
Package.ManifestAttributes(
"Build-Time" -> new java.util.Date().toString,
"Build-Commit" -> git.gitHeadCommit.value.getOrElse("No Git Revision Found")
)
)
val dependencyOverrideSettings = Seq(
// note that this does NOT add the dependencies, just forces the version
dependencyOverrides ++= Seq(
catsCore,
akkaActor,
akkaStream,
"com.github.jnr" % "jnr-constants" % "0.9.9"
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val defaultModuleSettings = commonSettings ++ dependencyOverrideSettings ++ Revolver.settings ++ SonatypePublish.settings
lazy val scalaPBSettings = Seq(PB.targets in Compile := Seq(scalapb.gen() -> (sourceManaged in Compile).value))
lazy val bakertypes = project.in(file("bakertypes"))
.settings(defaultModuleSettings)
.settings(
moduleName := "baker-types",
libraryDependencies ++= compileDeps(
slf4jApi,
ficusConfig,
objenisis,
scalapbRuntime,
jodaTime,
scalaReflect(scalaVersion.value)
) ++ testDeps(scalaTest, scalaCheck, logback, scalaCheck)
)
lazy val intermediateLanguage = project.in(file("intermediate-language"))
.settings(defaultModuleSettings)
.settings(
moduleName := "baker-intermediate-language",
libraryDependencies ++= compileDeps(
scalaGraph,
slf4jApi,
scalaGraphDot,
objenisis,
typeSafeConfig
) ++ testDeps(scalaTest, scalaCheck, logback)
).dependsOn(bakertypes)
lazy val runtime = project.in(file("runtime"))
.settings(defaultModuleSettings)
.settings(scalaPBSettings)
.settings(
moduleName := "baker-runtime",
// we have to exclude the sources because of a compiler bug: https://issues.scala-lang.org/browse/SI-10134
sources in (Compile, doc) := Seq.empty,
libraryDependencies ++=
compileDeps(
akkaActor,
akkaPersistence,
akkaPersistenceQuery,
akkaClusterSharding,
akkaInmemoryJournal,
akkaSlf4j,
akkaStream,
ficusConfig,
catsCore,
catsEffect,
guava,
chill,
objenisis,
scalapbRuntime,
protobufJava,
kryo,
kryoSerializers,
slf4jApi
) ++ testDeps(
akkaTestKit,
akkaStreamTestKit,
akkaInmemoryJournal,
akkaPersistenceCassandra,
levelDB,
levelDBJni,
betterFiles,
graphvizJava,
junitInterface,
scalaTest,
scalaCheck,
mockito,
logback)
++ providedDeps(findbugs)
)
.dependsOn(intermediateLanguage, testScope(recipeDsl), testScope(recipeCompiler), testScope(bakertypes))
lazy val splitBrainResolver = project.in(file("split-brain-resolver"))
.settings(defaultModuleSettings)
.settings(
moduleName := "baker-split-brain-resolver",
// we have to exclude the sources because of a compiler bug: https://issues.scala-lang.org/browse/SI-10134
sources in (Compile, doc) := Seq.empty,
libraryDependencies ++=
compileDeps(
akkaActor,
akkaCluster,
akkaSlf4j,
ficusConfig
) ++ testDeps(
akkaTestKit,
akkaMultiNodeTestkit,
scalaTest
) ++ providedDeps(findbugs)
)
.enablePlugins(MultiJvmPlugin)
.configs(MultiJvm)
.settings(
// logLevel := Level.Debug
)
lazy val recipeDsl = project.in(file("recipe-dsl"))
.settings(defaultModuleSettings)
.settings(
moduleName := "baker-recipe-dsl",
// we have to exclude the sources because of a compiler bug: https://issues.scala-lang.org/browse/SI-10134
sources in (Compile, doc) := Seq.empty,
libraryDependencies ++=
compileDeps(
javaxInject,
paranamer,
scalaReflect(scalaVersion.value),
) ++
testDeps(
scalaTest,
scalaCheck,
junitInterface,
slf4jApi,
logback
)
).dependsOn(bakertypes)
lazy val recipeCompiler = project.in(file("compiler"))
.settings(defaultModuleSettings)
.settings(
moduleName := "baker-compiler",
libraryDependencies ++=
compileDeps(slf4jApi) ++ testDeps(scalaTest, scalaCheck, logback)
)
.dependsOn(recipeDsl, intermediateLanguage, testScope(recipeDsl))
lazy val baas = project.in(file("baas"))
.settings(defaultModuleSettings)
.settings(noPublishSettings)
.settings(
moduleName := "baker-baas",
libraryDependencies ++=
compileDeps(
kryo,
kryoSerializers,
akkaHttp,
akkaPersistenceCassandra) ++
testDeps(
akkaSlf4j,
akkaTestKit,
logback,
mockito,
scalaTest,
junitInterface,
levelDB,
levelDBJni,
scalaCheck
)
)
.dependsOn(recipeDsl, recipeCompiler, intermediateLanguage, runtime, testScope(runtime))
lazy val baker = project
.in(file("."))
.settings(defaultModuleSettings)
.settings(noPublishSettings)
.aggregate(bakertypes, runtime, recipeCompiler, recipeDsl, intermediateLanguage, splitBrainResolver)