-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sbt
188 lines (172 loc) · 10.3 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
import com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin.autoImport.scalafmtOnCompile
organization in ThisBuild := "com.experiments"
version in ThisBuild := "0.1"
scalaVersion in ThisBuild := "2.12.4"
lazy val `shopping-cart` = (project in file(".")).aggregate(`common`, `shopping-cart-command`)
val akka = "com.typesafe.akka"
val akkaV = "2.5.10"
// The common project contains the protocol buffers responsible for communication between the command and
// query-processor sides and also contains reusable code, it also generates the source for its protos
lazy val `common` =
(project in file("common"))
.settings(
libraryDependencies ++= Seq(akka %% "akka-actor" % akkaV, akka %% "akka-cluster" % akkaV),
scalafmtOnCompile in ThisBuild := true,
PB.targets in Compile := Seq(scalapb.gen() -> (sourceManaged in Compile).value)
)
lazy val `shopping-cart-command` =
(project in file("shopping-cart-command"))
.dependsOn(`common`)
.enablePlugins(JavaAppPackaging)
.settings(
libraryDependencies ++= {
val circe = "io.circe"
val circeV = "0.9.0"
Seq(
akka %% "akka-actor" % akkaV,
akka %% "akka-http" % "10.1.0-RC1",
"de.heikoseeberger" %% "akka-http-circe" % "1.20.0-RC1",
akka %% "akka-stream" % akkaV,
akka %% "akka-testkit" % akkaV % Test,
akka %% "akka-cluster-sharding" % akkaV,
akka %% "akka-cluster-tools" % akkaV,
akka %% "akka-persistence" % akkaV,
akka %% "akka-slf4j" % akkaV,
akka %% "akka-persistence-cassandra" % "0.80",
circe %% "circe-core" % circeV,
circe %% "circe-generic" % circeV,
circe %% "circe-parser" % circeV,
circe %% "circe-java8" % circeV,
"com.lightbend.akka" %% "akka-management-cluster-http" % "0.6",
"org.typelevel" %% "cats-core" % "1.0.1",
"de.heikoseeberger" %% "constructr" % "0.18.1",
"com.lightbend.constructr" %% "constructr-coordination-zookeeper" % "0.4.0",
"ch.qos.logback" % "logback-classic" % "1.2.3",
"org.codehaus.groovy" % "groovy" % "2.4.13"
)
},
scalafmtOnCompile in ThisBuild := true,
// Import proto files of the depending project since the command protos reference the depending protos
PB.includePaths in Compile += file("common/src/main/protobuf"),
PB.targets in Compile := Seq(scalapb.gen() -> (sourceManaged in Compile).value),
dockerBaseImage := "anapsix/alpine-java:8"
)
lazy val `shopping-cart-query-vendor-billing` =
(project in file("shopping-cart-query-vendor-billing"))
.dependsOn(`common`)
.enablePlugins(JavaAppPackaging)
.settings(
libraryDependencies ++= {
val phantom = "com.outworkers"
val phantomV = "2.20.2"
Seq(
akka %% "akka-actor" % akkaV,
akka %% "akka-stream" % akkaV,
akka %% "akka-cluster-sharding" % akkaV,
akka %% "akka-cluster-tools" % akkaV,
akka %% "akka-persistence-query" % akkaV,
akka %% "akka-slf4j" % akkaV,
akka %% "akka-persistence-cassandra" % "0.80",
"de.heikoseeberger" %% "constructr" % "0.18.1",
"com.lightbend.constructr" %% "constructr-coordination-zookeeper" % "0.4.0",
phantom %% "phantom-dsl" % phantomV,
phantom %% "phantom-jdk8" % phantomV,
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"ch.qos.logback" % "logback-classic" % "1.2.3",
"org.codehaus.groovy" % "groovy" % "2.4.13"
)
},
scalafmtOnCompile in ThisBuild := true,
dockerBaseImage := "anapsix/alpine-java:8"
)
lazy val `shopping-cart-query-vendor-billing-jdbc` =
(project in file("shopping-cart-query-vendor-billing-jdbc"))
.dependsOn(`common`)
.enablePlugins(JavaAppPackaging)
.settings(
libraryDependencies ++= {
val slick = "com.typesafe.slick"
val slickV = "3.2.1"
Seq(
akka %% "akka-actor" % akkaV,
akka %% "akka-stream" % akkaV,
akka %% "akka-cluster-sharding" % akkaV,
akka %% "akka-cluster-tools" % akkaV,
akka %% "akka-persistence-query" % akkaV,
akka %% "akka-slf4j" % akkaV,
slick %% "slick" % slickV,
slick %% "slick-hikaricp" % slickV,
akka %% "akka-persistence-cassandra" % "0.80",
"de.heikoseeberger" %% "constructr" % "0.18.1",
"com.lightbend.constructr" %% "constructr-coordination-zookeeper" % "0.4.0",
"org.postgresql" % "postgresql" % "42.1.4",
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"ch.qos.logback" % "logback-classic" % "1.2.3",
"org.codehaus.groovy" % "groovy" % "2.4.13"
)
},
scalafmtOnCompile in ThisBuild := true,
dockerBaseImage := "anapsix/alpine-java:8"
)
lazy val `shopping-cart-query-popular-items` =
(project in file("shopping-cart-query-popular-items"))
.dependsOn(`common`)
.enablePlugins(JavaAppPackaging)
.settings(
libraryDependencies ++= {
val phantom = "com.outworkers"
val phantomV = "2.20.2"
Seq(
akka %% "akka-actor" % akkaV,
akka %% "akka-stream" % akkaV,
akka %% "akka-cluster-sharding" % akkaV,
akka %% "akka-cluster-tools" % akkaV,
akka %% "akka-persistence-query" % akkaV,
akka %% "akka-slf4j" % akkaV,
akka %% "akka-persistence-cassandra" % "0.80",
"de.heikoseeberger" %% "constructr" % "0.18.1",
"com.lightbend.constructr" %% "constructr-coordination-zookeeper" % "0.4.0",
phantom %% "phantom-dsl" % phantomV,
phantom %% "phantom-jdk8" % phantomV,
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"ch.qos.logback" % "logback-classic" % "1.2.3",
"org.codehaus.groovy" % "groovy" % "2.4.13"
)
},
scalafmtOnCompile in ThisBuild := true,
dockerBaseImage := "anapsix/alpine-java:8"
)
lazy val `shopping-cart-query-items-purchased-events` =
(project in file("shopping-cart-query-item-purchased-events"))
.dependsOn(`common`)
.enablePlugins(JavaAppPackaging)
.settings(libraryDependencies ++= {
val phantom = "com.outworkers"
val phantomV = "2.20.2"
val circe = "io.circe"
val circeV = "0.9.0"
Seq(
akka %% "akka-actor" % akkaV,
akka %% "akka-stream" % akkaV,
akka %% "akka-cluster-sharding" % akkaV,
akka %% "akka-cluster-tools" % akkaV,
akka %% "akka-persistence-query" % akkaV,
akka %% "akka-slf4j" % akkaV,
"de.heikoseeberger" %% "constructr" % "0.18.1",
"com.lightbend.constructr" %% "constructr-coordination-zookeeper" % "0.4.0",
akka %% "akka-persistence-cassandra" % "0.80",
akka %% "akka-stream-kafka" % "0.18",
circe %% "circe-core" % circeV,
circe %% "circe-generic" % circeV,
circe %% "circe-parser" % circeV,
circe %% "circe-java8" % circeV,
phantom %% "phantom-dsl" % phantomV,
phantom %% "phantom-jdk8" % phantomV,
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"ch.qos.logback" % "logback-classic" % "1.2.3",
"org.codehaus.groovy" % "groovy" % "2.4.13"
)
})
addCommandAlias("command-side", "shopping-cart-command/runMain com.experiments.shopping.cart.Main")
addCommandAlias("query-vendor-billing", "shopping-cart-query-vendor-billing/runMain com.experiments.shopping.cart.Main")
addCommandAlias("query-popular-items", "shopping-cart-query-popular-items/runMain com.experiments.shopping.cart.Main")