-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sbt
161 lines (147 loc) · 5.61 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
import com.typesafe.sbt.SbtNativePackager._
import NativePackagerKeys._
import play.PlayImport._
name := "cavellc"
scalaVersion := "2.10.4"
lazy val akkaVersion = "2.3.4"
lazy val commonSettings: Seq[Def.Setting[_]] = Seq(
organization := "com.cavellc",
name <<= name("cave-" + _),
version := "git describe --tags --dirty --always".!!.stripPrefix("v").trim,
resolvers += Resolver.sonatypeRepo("snapshots"),
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
libraryDependencies ++= Seq(
"io.dropwizard.metrics" % "metrics-core" % "3.1.0",
"io.dropwizard.metrics" % "metrics-jvm" % "3.1.0",
"org.scalatest" %% "scalatest" % "2.1.2" % "test"
)
)
lazy val commonDockerSettings: Seq[Def.Setting[_]] = Seq(
maintainer in Docker := "TWAIN <[email protected]>",
dockerBaseImage := "cavellc/ubuntu-openjdk-7-jre-headless:12.04",
dockerRepository := Some("giltcommon"),
defaultLinuxInstallLocation in Docker := "/cavellc"
)
lazy val bashScriptSettings: Seq[Def.Setting[_]] = Seq(
NativePackagerKeys.bashScriptExtraDefines ++= Seq(
"""addJava "-Djava.net.preferIPv4Stack=true" """,
"""addJava "-Dnetworkaddress.cache.ttl=5" """,
"""addJava "-Dnetworkaddress.cache.negative.ttl=0" """,
"""addJava "-Dconfig.resource=application.conf" """,
"""addJava "-Dlogger.file=/cavellc/conf/logger.xml" """
)
)
lazy val commonScoverageSettings: Seq[Def.Setting[_]] = Seq(
ScoverageKeys.excludedPackages in ScoverageCompile := "<empty>;routes_.*",
ScoverageKeys.highlighting := true
)
lazy val core = project
.settings(commonSettings: _*)
.settings(instrumentSettings: _*)
.settings(commonScoverageSettings: _*)
.settings(parallelExecution in ScoverageTest := false: _*)
.settings(parallelExecution in Test := false: _*)
.settings(
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-java-sdk" % "1.9.13",
"com.amazonaws" % "amazon-kinesis-client" % "1.0.0",
"org.apache.commons" % "commons-lang3" % "3.3.2",
"com.ning" % "async-http-client" % "1.8.9",
"com.typesafe.play" %% "play-json" % "2.2.2",
"com.typesafe.slick" %% "slick" % "2.1.0-M2",
"org.postgresql" % "postgresql" % "9.3-1101-jdbc4",
"com.zaxxer" % "HikariCP-java6" % "2.1.0",
"org.mindrot" % "jbcrypt" % "0.3m",
"org.mockito" % "mockito-all" % "1.9.5" % "test",
"com.h2database" % "h2" % "1.3.175" % "test",
"ch.qos.logback" % "logback-classic" % "1.1.1"
)
)
lazy val logs = project
.settings(commonSettings: _*)
.settings(instrumentSettings: _*)
.settings(commonScoverageSettings: _*)
.settings(parallelExecution in ScoverageTest := false: _*)
.settings(parallelExecution in Test := false: _*)
.settings(
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-java-sdk" % "1.9.13",
"ch.qos.logback" % "logback-classic" % "1.1.1"
)
)
lazy val api = project
.dependsOn(core % "test->test;compile->compile")
.dependsOn(logs % "test->test;compile->compile")
.enablePlugins(PlayScala)
.settings(commonSettings: _*)
.settings(bashScriptSettings: _*)
.settings(instrumentSettings: _*)
.settings(commonScoverageSettings: _*)
.settings(parallelExecution in ScoverageTest := false: _*)
.settings(parallelExecution in Test := false: _*)
.settings(commonDockerSettings: _*)
.settings(
libraryDependencies ++= Seq(
"com.typesafe.play.plugins" %% "play-plugins-mailer" % "2.3.0"
),
dockerExposedPorts in Docker := Seq(7001)
)
lazy val scheduler = project
.dependsOn(core % "test->test;compile->compile")
.dependsOn(logs % "test->test;compile->compile")
.enablePlugins(PlayScala)
.settings(commonSettings: _*)
.settings(bashScriptSettings: _*)
.settings(instrumentSettings: _*)
.settings(commonScoverageSettings: _*)
.settings(parallelExecution in ScoverageTest := false: _*)
.settings(parallelExecution in Test := false: _*)
.settings(commonDockerSettings: _*)
.settings(
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-cluster" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test"
),
dockerExposedPorts in Docker := Seq(9000)
)
lazy val worker = project
.dependsOn(core % "test->test;compile->compile")
.dependsOn(logs % "test->test;compile->compile")
.enablePlugins(PlayScala)
.settings(commonSettings: _*)
.settings(bashScriptSettings: _*)
.settings(instrumentSettings: _*)
.settings(commonScoverageSettings: _*)
.settings(commonDockerSettings: _*)
.settings(
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test"
),
dockerExposedPorts in Docker := Seq(7004)
)
lazy val www = project
.dependsOn(logs % "test->test;compile->compile")
.enablePlugins(PlayScala)
.settings(PlayKeys.routesImport += "com.gilt.cavellc.models.Bindables._")
.settings(commonSettings: _*)
.settings(commonDockerSettings: _*)
.settings(Seq(NativePackagerKeys.bashScriptExtraDefines ++= Seq(
"""addJava "-Djava.net.preferIPv4Stack=true" """,
"""addJava "-Dnetworkaddress.cache.ttl=5" """,
"""addJava "-Dnetworkaddress.cache.negative.ttl=0" """
)): _*)
.settings(
libraryDependencies ++= Seq(ws, "com.typesafe.play" %% "play-json" % "2.2.2"),
TwirlKeys.templateImports += "com.gilt.cavellc.models._",
dockerExposedPorts in Docker := Seq(7002)
)
lazy val dbwriter = project
.dependsOn(core % "test->test;compile->compile")
.dependsOn(logs % "test->test;compile->compile")
.enablePlugins(PlayScala)
.settings(commonSettings: _*)
.settings(bashScriptSettings: _*)
.settings(commonDockerSettings: _*)
.settings(
dockerExposedPorts in Docker := Seq(9000)
)