This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sbt
173 lines (162 loc) · 7.45 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
// *****************************************************************************
// Projects
// *****************************************************************************
lazy val `streamee-root` =
project
.in(file("."))
.aggregate(`streamee`, `streamee-demo`)
.settings(settings)
.settings(
Compile / unmanagedSourceDirectories := Seq.empty,
Test / unmanagedSourceDirectories := Seq.empty,
publishArtifact := false,
)
lazy val `streamee` =
project
.enablePlugins(AutomateHeaderPlugin)
.settings(settings)
.settings(
libraryDependencies ++= Seq(
library.akkaHttp,
library.akkaStreamTyped,
library.slf4jApi,
library.akkaActorTestkitTyped % Test,
library.akkaHttpTestkit % Test,
library.akkaStreamTestkit % Test,
library.log4jCore % Test,
library.log4jSlf4j % Test,
library.scalaCheck % Test,
library.scalaTest % Test,
library.scalaTestPlusScalaCheck % Test,
)
)
lazy val `streamee-demo` =
project
.enablePlugins(AutomateHeaderPlugin, JavaAppPackaging, DockerPlugin)
.dependsOn(`streamee`)
.settings(settings)
.settings(
libraryDependencies ++= Seq(
library.akkaManagementClusterBootstrap,
library.akkaClusterShardingTyped,
library.akkaDiscovery,
library.akkaDiscoveryK8s,
library.akkaHttpCirce,
library.akkaHttpSprayJson,
library.akkaSlf4j,
library.circeGeneric,
library.disruptor,
library.log4jCore,
library.log4jSlf4j,
library.pureConfig,
),
publishArtifact := false,
Docker / maintainer := organizationName.value,
Docker / version := "latest",
dockerBaseImage := "adoptopenjdk:8u232-b09-jdk-hotspot",
dockerExposedPorts := Seq(8080, 8558, 25520),
)
// *****************************************************************************
// Library dependencies
// *****************************************************************************
lazy val library =
new {
object Version {
val akka = "2.6.13"
val akkaManagement = "1.0.9"
val akkaHttp = "10.2.4"
val akkaHttpJson = "1.35.3"
val akkaLog4j = "1.6.1"
val circe = "0.14.0"
val disruptor = "3.4.2"
val log4j = "2.14.0"
val pureConfig = "0.14.0"
val scalaCheck = "1.15.2"
val scalaTest = "3.2.4"
val scalaTestPlusScalaCheck = "3.2.2.0"
val slf4j = "1.7.30"
}
val akkaActorTestkitTyped = "com.typesafe.akka" %% "akka-actor-testkit-typed" % Version.akka
val akkaManagementClusterBootstrap = "com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % Version.akkaManagement
val akkaClusterShardingTyped = "com.typesafe.akka" %% "akka-cluster-sharding-typed" % Version.akka
val akkaDiscovery = "com.typesafe.akka" %% "akka-discovery" % Version.akka
val akkaDiscoveryK8s = "com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % Version.akkaManagement
val akkaHttp = "com.typesafe.akka" %% "akka-http" % Version.akkaHttp
val akkaHttpCirce = "de.heikoseeberger" %% "akka-http-circe" % Version.akkaHttpJson
val akkaHttpSprayJson = "com.typesafe.akka" %% "akka-http-spray-json" % Version.akkaHttp
val akkaHttpTestkit = "com.typesafe.akka" %% "akka-http-testkit" % Version.akkaHttp
val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % Version.akka
val akkaStreamTestkit = "com.typesafe.akka" %% "akka-stream-testkit" % Version.akka
val akkaStreamTyped = "com.typesafe.akka" %% "akka-stream-typed" % Version.akka
val circeGeneric = "io.circe" %% "circe-generic" % Version.circe
val disruptor = "com.lmax" % "disruptor" % Version.disruptor
val log4jCore = "org.apache.logging.log4j" % "log4j-core" % Version.log4j
val log4jSlf4j = "org.apache.logging.log4j" % "log4j-slf4j-impl" % Version.log4j
val pureConfig = "com.github.pureconfig" %% "pureconfig" % Version.pureConfig
val scalaCheck = "org.scalacheck" %% "scalacheck" % Version.scalaCheck
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
val scalaTestPlusScalaCheck = "org.scalatestplus" %% "scalacheck-1-14" % Version.scalaTestPlusScalaCheck
val slf4jApi = "org.slf4j" % "slf4j-api" % Version.slf4j
}
// *****************************************************************************
// Settings
// *****************************************************************************
lazy val settings =
commonSettings ++
scalafmtSettings ++
sonatypeSettings ++
commandAliases
lazy val commonSettings =
Seq(
scalaVersion := "2.13.1",
crossScalaVersions := Seq(scalaVersion.value, "2.12.10"),
organization := "io.moia",
organizationName := "MOIA GmbH",
startYear := Some(2018),
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")),
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-target:jvm-1.8",
"-encoding", "UTF-8",
),
Compile / unmanagedSourceDirectories := Seq((Compile / scalaSource).value),
Test / unmanagedSourceDirectories := Seq((Test / scalaSource).value),
)
lazy val scalafmtSettings =
Seq(
scalafmtOnCompile := true,
)
lazy val sonatypeSettings = {
import xerial.sbt.Sonatype._
Seq(
publishTo := sonatypePublishToBundle.value,
sonatypeProfileName := organization.value,
publishMavenStyle := true,
sonatypeProjectHosting := Some(GitHubHosting("moia-dev", "streamee", "support@moia.io")),
)
}
lazy val commandAliases =
addCommandAlias(
"r1",
"""|reStart
|---
|-Dakka.cluster.seed-nodes.0=akka://streamee-demo@127.0.0.1:25520
|-Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=config
|-Dakka.management.http.hostname=127.0.0.1
|-Dakka.remote.artery.canonical.hostname=127.0.0.1
|-Dstreamee-demo.api.interface=127.0.0.1
|""".stripMargin
) ++
addCommandAlias(
"r2",
"""|reStart
|---
|-Dakka.cluster.seed-nodes.0=akka://streamee-demo@127.0.0.1:25520
|-Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=config
|-Dakka.management.http.hostname=127.0.0.2
|-Dakka.remote.artery.canonical.hostname=127.0.0.2
|-Dstreamee-demo.api.interface=127.0.0.2
|""".stripMargin
)