-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
139 lines (114 loc) · 5.43 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
name := """explore-akka"""
version := "1.1"
scalaVersion := "2.12.7"
val akkaVersion = "2.6.12"
val scalaBinVersion = "2.12"
val scalaTestVersion = "3.2.0"
val logbackVersion = "1.2.3"
val scalaLoggingVersion = "3.9.2"
lazy val mockitoAllVersion = "1.10.19"
lazy val mockitoScalaVersion = "1.16.5"
lazy val akkaHttpVersion = "10.2.2"
lazy val akkaManagementVersion = "1.0.9"
lazy val aeronVersion = "1.30.0"
lazy val leveldbVersion = "0.7"
lazy val leveldbjniVersion = "1.8"
lazy val postgresVersion = "42.2.2"
lazy val cassandraVersion = "0.91"
lazy val json4sVersion = "3.2.11"
lazy val kamonVersion = "2.1.9"
lazy val protobufVersion = "3.7.1"
lazy val gRpcVersion = "1.34.1"
// some libs are available in Bintray's JCenter
resolvers += Resolver.jcenterRepo
enablePlugins(JavaAppPackaging, JavaServerAppPackaging, DockerPlugin, AshScriptPlugin, ProtobufPlugin)
// ####### Dockerfile settings #######
import NativePackagerHelper._
packageName in Docker := packageName.value
version in Docker := version.value
dockerExposedPorts := List(8001, 2551)
dockerLabels := Map("felipeogutierrez" -> "felipe.o.gutierrez@gmail.com")
dockerBaseImage := "openjdk:jre-alpine"
dockerRepository := Some("felipeogutierrez")
// dockerUsername := Some("felipeogutierrez") // not necessary otherwise it created nested location on the Docker image
defaultLinuxInstallLocation in Docker := "/usr/local"
daemonUser in Docker := "daemon"
mappings in Universal ++= directory( baseDirectory.value / "src" / "main" / "resources" )
// ####### Dockerfile settings #######
// ####### sbt-protobuf settings #######
version in ProtobufConfig := protobufVersion
sourceDirectories in ProtobufConfig += (protobufExternalIncludePath in ProtobufConfig).value
unmanagedResourceDirectories in Compile += (sourceDirectory in ProtobufConfig).value
javaSource in ProtobufConfig := ((sourceDirectory in Compile).value / "generated")
// ####### sbt-protobuf settings #######
// mainClass in Compile := Some("org.github.felipegutierrez.explore.akka.MainClass")
libraryDependencies ++= Seq(
// Akka basics
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion,
// Akka typed
"com.typesafe.akka" %% "akka-actor-typed" % akkaVersion,
"com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion % Test,
// Akka remote and cluster
"com.typesafe.akka" %% "akka-remote" % akkaVersion,
"com.typesafe.akka" %% "akka-cluster" % akkaVersion,
"com.typesafe.akka" %% "akka-cluster-typed" % akkaVersion,
"com.typesafe.akka" %% "akka-cluster-sharding" % akkaVersion,
"com.typesafe.akka" %% "akka-cluster-tools" % akkaVersion,
"io.aeron" % "aeron-driver" % aeronVersion,
"io.aeron" % "aeron-client" % aeronVersion,
// Akka streams
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-stream-testkit" % akkaVersion % Test,
// Akka locating services
"com.typesafe.akka" %% "akka-discovery" % akkaVersion,
"com.typesafe.akka" %% "akka-pki" % akkaVersion,
// Akka persistence
"com.typesafe.akka" %% "akka-persistence" % akkaVersion,
"com.typesafe.akka" %% "akka-persistence-query" % akkaVersion,
// Akka HTTP: overwrites are required because Akka-gRPC depends on 10.1.x
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http2-support" % akkaHttpVersion,
// Scala and Akka log
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"ch.qos.logback" % "logback-classic" % logbackVersion,
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
// Akka management
"com.lightbend.akka.management" %% "akka-management" % akkaManagementVersion,
"com.lightbend.akka.management" %% "akka-management-cluster-http" % akkaManagementVersion,
// Serialization frameworks
"com.github.romix.akka" %% "akka-kryo-serialization" % "0.5.2",
"com.sksamuel.avro4s" %% "avro4s-core" % "4.0.4",
"org.xerial.snappy" % "snappy-java" % "1.1.8.2",
"com.google.protobuf" % "protobuf-java" % protobufVersion,
"com.google.protobuf" % "protobuf-java-util" % protobufVersion,
"com.google.protobuf" % "protoc" % protobufVersion,
// "io.spray" %% "spray-json" % "1.3.6", // already imported in "com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion,
// local levelDB stores
"org.iq80.leveldb" % "leveldb" % leveldbVersion,
"org.fusesource.leveldbjni" % "leveldbjni-all" % leveldbjniVersion,
// JDBC with PostgreSQL
"org.postgresql" % "postgresql" % postgresVersion,
"com.github.dnvriend" %% "akka-persistence-jdbc" % "3.4.0",
// Cassandra
"com.typesafe.akka" %% "akka-persistence-cassandra" % cassandraVersion,
"com.typesafe.akka" %% "akka-persistence-cassandra-launcher" % cassandraVersion % Test,
// Scala test
"org.scalatest" %% "scalatest" % scalaTestVersion,
// "org.mockito" % "mockito-all" % mockitoAllVersion % Test,
"org.mockito" %% "mockito-scala" % mockitoScalaVersion,
"junit" % "junit" % "4.13" % Test,
"org.scalatestplus" %% "junit-4-13" % "3.2.3.0" % "test",
// JWT
"com.pauldijou" %% "jwt-spray-json" % "4.3.0",
// Metrics: Kamon + Prometheus
"io.kamon" %% "kamon-bundle" % kamonVersion,
"io.kamon" %% "kamon-prometheus" % kamonVersion,
// gRPC
"io.grpc" % "grpc-netty-shaded" % gRpcVersion,
"io.grpc" % "grpc-protobuf" % gRpcVersion,
"io.grpc" % "grpc-stub" % gRpcVersion,
"io.grpc" % "grpc-services" % gRpcVersion,
)