This repository has been archived by the owner on Jul 11, 2019. It is now read-only.
/
build.sbt
150 lines (146 loc) · 5.65 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
import org.scalafmt.sbt.ScalafmtPlugin
lazy val `ws-protocol` = project
.in(file("ws-protocol"))
.settings(
name := "liquidity-ws-protocol"
)
.settings(
libraryDependencies := Seq.empty,
coverageEnabled := false,
crossPaths := false,
Compile / unmanagedResourceDirectories ++=
(Compile / PB.protoSources).value.map(_.asFile),
homepage := Some(url("https://github.com/dhpcs/liquidity/")),
startYear := Some(2015),
description := "Virtual currencies for Monopoly and other board and " +
"tabletop games.",
licenses += "Apache-2.0" -> url(
"https://www.apache.org/licenses/LICENSE-2.0.txt"
),
organization := "com.dhpcs",
organizationHomepage := Some(url("https://www.dhpcs.com/")),
organizationName := "dhpcs",
developers := List(
Developer(
id = "dhpiggott",
name = "David Piggott",
email = "david@piggott.me.uk",
url = url("https://www.dhpiggott.net/")
)
),
scmInfo := Some(
ScmInfo(
browseUrl = url("https://github.com/dhpcs/liquidity/"),
connection = "scm:git:https://github.com/dhpcs/liquidity.git",
devConnection = Some("scm:git:git@github.com:dhpcs/liquidity.git")
)
),
releaseEarlyEnableInstantReleases := false,
releaseEarlyNoGpg := true,
releaseEarlyWith := BintrayPublisher,
releaseEarlyEnableSyncToMaven := false,
bintrayOrganization := Some("dhpcs")
)
lazy val `proto-gen` = project
.in(file("proto-gen"))
.enablePlugins(
AkkaGrpcPlugin
)
.settings(
Compile / PB.protoSources ++= (`ws-protocol` / Compile / PB.protoSources).value,
PB.generate / excludeFilter := "descriptor.proto",
akkaGrpcCodeGeneratorSettings += "server_power_apis"
)
.settings(
// Because the sources akka-grpc generates aren't perfect in this regard
scalacOptions -= "-Xfatal-warnings"
)
.settings(
libraryDependencies +=
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion %
ProtocPlugin.ProtobufConfig
)
lazy val model = project
.in(file("model"))
.dependsOn(`proto-gen`)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "1.6.1",
"com.squareup.okio" % "okio" % "2.2.2",
"com.typesafe.akka" %% "akka-actor-typed" % "2.5.23"
)
)
lazy val service = project
.in(file("service"))
.dependsOn(model)
.settings(
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.3.3",
"com.typesafe.akka" %% "akka-slf4j" % "2.5.23",
"ch.qos.logback" % "logback-classic" % "1.2.3",
"net.logstash.logback" % "logstash-logback-encoder" % "6.1",
"com.typesafe.akka" %% "akka-discovery" % "2.5.23",
"com.typesafe.akka" %% "akka-cluster-typed" % "2.5.23",
"com.typesafe.akka" %% "akka-cluster-sharding-typed" % "2.5.23",
"com.typesafe.akka" %% "akka-persistence-typed" % "2.5.23",
"com.typesafe.akka" %% "akka-persistence-query" % "2.5.23",
"com.lightbend.akka.discovery" %% "akka-discovery-aws-api-async" % "1.0.1",
"com.lightbend.akka.management" %% "akka-management-cluster-http" % "1.0.1",
"com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % "1.0.1",
"com.github.dnvriend" %% "akka-persistence-jdbc" % "3.5.2",
"org.tpolecat" %% "doobie-core" % "0.7.0",
"org.tpolecat" %% "doobie-hikari" % "0.7.0",
"mysql" % "mysql-connector-java" % "8.0.16",
"org.typelevel" %% "cats-effect" % "1.3.1",
"dev.zio" %% "zio" % "1.0.0-RC9-4",
"dev.zio" %% "zio-interop-cats" % "1.3.1.0-RC3",
"com.typesafe.akka" %% "akka-http" % "10.1.8",
"com.lightbend.akka" %% "akka-stream-alpakka-s3" % "1.1.0",
"org.bouncycastle" % "bcpkix-jdk15on" % "1.62",
"com.typesafe.akka" %% "akka-http2-support" % "10.1.8",
"com.typesafe.akka" %% "akka-http-spray-json" % "10.1.8",
"com.typesafe.akka" %% "akka-http-xml" % "10.1.8",
"com.typesafe.akka" %% "akka-stream-typed" % "2.5.23",
"com.thesamet.scalapb" %% "scalapb-json4s" % "0.9.2",
"org.json4s" %% "json4s-native" % "3.6.7",
"de.heikoseeberger" %% "akka-http-json4s" % "1.27.0",
"com.nimbusds" % "nimbus-jose-jwt" % "7.4"
),
dependencyOverrides += "com.zaxxer" % "HikariCP" % "2.7.8"
)
.settings(
libraryDependencies ++= Seq(
"com.h2database" % "h2" % "1.4.199" % Test,
"com.typesafe.akka" %% "akka-actor-testkit-typed" % "2.5.23" % Test,
"com.github.dnvriend" %% "akka-persistence-inmemory" % "2.5.15.2" % Test,
"org.scalatest" %% "scalatest" % "3.0.8" % Test,
"com.typesafe.akka" %% "akka-http-testkit" % "10.1.8" % Test,
"com.typesafe.akka" %% "akka-stream-testkit" % "2.5.23" % Test
)
)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(inConfig(IntegrationTest)(ScalafmtPlugin.scalafmtConfigSettings))
.settings(IntegrationTest / logBuffered := false)
.settings(
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.8" % IntegrationTest,
"com.typesafe.akka" %% "akka-http-testkit" % "10.1.8" % IntegrationTest,
"com.typesafe.akka" %% "akka-stream-testkit" % "2.5.23" % IntegrationTest
)
)
.enablePlugins(
BuildInfoPlugin,
JavaAppPackaging,
DockerPlugin
)
.settings(
buildInfoPackage := "com.dhpcs.liquidity.service",
buildInfoUsePackageAsPath := true,
buildInfoKeys := Seq(version),
buildInfoOptions ++= Seq(BuildInfoOption.BuildTime, BuildInfoOption.ToMap),
bashScriptExtraDefines += "addJava -Djdk.tls.ephemeralDHKeySize=2048",
Docker / packageName := "liquidity",
dockerBaseImage := "openjdk:12-jdk-oracle",
dockerExposedPorts := Seq(8443)
)