-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
114 lines (102 loc) · 3.94 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
lazy val root = (project in file(".")).settings(
name := "akka-ddd-sample"
).aggregate(api, domain, db, flyway)
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import scalariform.formatter.preferences._
val formatPreferences = FormattingPreferences()
.setPreference(RewriteArrowSymbols, false)
.setPreference(AlignParameters, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(SpacesAroundMultiImports, true)
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(AlignArguments, true)
val commonSettings = Seq(
version := "1.0.0"
, scalaVersion := "2.11.8"
, scalacOptions ++= Seq(
"-feature"
, "-deprecation"
, "-unchecked"
, "-encoding", "UTF-8"
, "-language:existentials"
, "-language:implicitConversions"
, "-language:postfixOps"
, "-language:higherKinds"
)
, libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.0" % "test"
, "org.slf4j" % "slf4j-api" % "1.7.21"
, "ch.qos.logback" % "logback-classic" % "1.1.7"
)
) ++ SbtScalariform.scalariformSettings ++ Seq(
ScalariformKeys.preferences in Compile := formatPreferences,
ScalariformKeys.preferences in Test := formatPreferences)
val flyway = (project in file("flyway"))
.settings(commonSettings)
.settings(
name := "akka-ddd-sample-flyway"
, libraryDependencies ++= Seq(
"com.h2database" % "h2" % "1.4.192"
)
, parallelExecution in Test := false
, flywayUrl := "jdbc:h2:file:./target/todo"
, flywayUser := "sa"
)
val db = (project in file("db"))
.settings(commonSettings)
.settings(
name := "akka-ddd-sample-db"
, libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-stream" % "2.4.10"
, "com.typesafe.akka" %% "akka-stream-testkit" % "2.4.10" % "test"
, "com.typesafe.slick" %% "slick" % "3.1.1"
, "com.typesafe.slick" %% "slick-codegen" % "3.1.1"
, "com.zaxxer" % "HikariCP" % "2.5.0"
, "com.h2database" % "h2" % "1.4.192"
)
, parallelExecution in Test := false
, flywayUrl := "jdbc:h2:file:./target/todo"
, flywayUser := "SA"
)
val domain = (project in file("domain"))
.settings(commonSettings)
.settings(
name := "akka-ddd-sample-domain"
, libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.4.10"
, "com.typesafe.akka" %% "akka-cluster" % "2.4.10"
, "com.typesafe.akka" %% "akka-cluster-sharding" % "2.4.10"
, "com.typesafe.akka" %% "akka-slf4j" % "2.4.10"
, "com.typesafe.akka" %% "akka-persistence" % "2.4.10"
, "com.typesafe.akka" %% "akka-stream" % "2.4.10"
, "com.typesafe.akka" %% "akka-testkit" % "2.4.10" % "test"
, "com.typesafe.akka" %% "akka-stream-testkit" % "2.4.10" % "test"
, "com.typesafe.akka" %% "akka-multi-node-testkit" % "2.4.10" % "test"
, "com.github.dnvriend" %% "akka-persistence-jdbc" % "2.6.7"
, "com.h2database" % "h2" % "1.4.192"
, "org.iq80.leveldb" % "leveldb" % "0.7"
, "org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8"
)
)
val api = (project in file("api"))
.settings(commonSettings)
.settings(
name := "akka-ddd-sample-http"
, libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-http-core" % "2.4.10"
, "com.typesafe.akka" %% "akka-http-experimental" % "2.4.10"
, "com.typesafe.akka" %% "akka-http-spray-json-experimental" % "2.4.10"
, "com.typesafe.akka" %% "akka-testkit" % "2.4.10" % "test"
)
).dependsOn(domain, db)
val readModelUpdater = (project in file("read-model-updater"))
.settings(commonSettings)
.settings(
name := "akka-ddd-sample-read-model-updater"
, libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-persistence-query-experimental" % "2.4.10"
, "com.github.dnvriend" %% "akka-persistence-jdbc" % "2.6.7"
, "com.typesafe.akka" %% "akka-stream" % "2.4.10"
, "com.typesafe.akka" %% "akka-stream-testkit" % "2.4.10" % "test"
)
).dependsOn(db)