-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
130 lines (122 loc) · 4.65 KB
/
build.sbt
File metadata and controls
130 lines (122 loc) · 4.65 KB
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
import scala.sys.process._
import com.typesafe.sbt.packager.docker.DockerChmodType
Global / version := "0.0.1"
Global / scalaVersion := "2.13.3"
val http4sVersion = "0.21.6"
val grpcVersion = "1.31.0"
val circeVersion = "0.12.3"
val fansiVersion = "0.2.7"
val rocksDbVersion = "6.6.4"
val catsVersion = "2.0.0"
val logqlParserVersion = "0.0.1-SNAPSHOT"
val compileElm = taskKey[Unit]("compile elm")
lazy val scalacSettings = Seq(
scalacOptions ++= Seq(
"-deprecation",
"-language:higherKinds",
"-language:implicitConversions",
"-Xcheckinit",
"-feature",
"-Xfatal-warnings",
"-Ywarn-dead-code",
"-Ywarn-value-discard"
)
)
lazy val cli =
project
.in(file("cli"))
.settings(scalacSettings)
.settings(
Compile / mainClass := Some("logsdb.cli.CliApp"),
nativeImageOptions := Seq(
"-H:+ReportExceptionStackTraces",
"--no-fallback",
"--allow-incomplete-classpath"
),
name := "logsdb-cli",
assemblyJarName := "logsdb-cli.jar",
libraryDependencies ++= List(
"io.grpc" % "grpc-netty" % grpcVersion,
"co.fs2" %% "fs2-io" % "2.4.0",
"com.monovore" %% "decline-effect" % "1.0.0",
"com.lihaoyi" %% "fansi" % fansiVersion,
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"dev.profunktor" %% "console4cats" % "0.8.1"
),
assemblyMergeStrategy in assembly := {
case "META-INF/MANIFEST.MF" => MergeStrategy.discard
case _ => MergeStrategy.first
}
)
.dependsOn(protobuf)
.enablePlugins(NativeImagePlugin)
lazy val protobuf =
project
.in(file("protobuf"))
.settings(scalacSettings)
.settings(
scalapbCodeGeneratorOptions += CodeGeneratorOption.FlatPackage,
libraryDependencies += "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
)
.enablePlugins(Fs2Grpc)
.disablePlugins(AssemblyPlugin)
lazy val server =
project
.in(file("server"))
.dependsOn(protobuf)
.settings(scalacSettings)
.settings(
name := "server",
assemblyJarName := "server.jar",
libraryDependencies ++= List(
"io.grpc" % "grpc-netty" % grpcVersion,
"io.grpc" % "grpc-services" % grpcVersion,
"org.rocksdb" % "rocksdbjni" % rocksDbVersion,
"org.typelevel" %% "cats-core" % catsVersion,
"org.typelevel" %% "cats-effect" % "2.1.4",
"com.monovore" %% "decline-effect" % "1.0.0",
"io.circe" %% "circe-config" % "0.8.0",
"io.circe" %% "circe-generic" % "0.13.0",
"com.github.valskalla" %% "odin-core" % "0.8.1",
"com.lihaoyi" %% "fansi" % fansiVersion,
"org.http4s" %% "http4s-dsl" % http4sVersion,
"org.http4s" %% "http4s-circe" % http4sVersion,
"org.http4s" %% "http4s-blaze-server" % http4sVersion,
"org.http4s" %% "http4s-blaze-client" % http4sVersion,
"com.github.alirezameskin" %% "logql-parser" % logqlParserVersion
),
assemblyMergeStrategy in assembly := {
case "META-INF/MANIFEST.MF" => MergeStrategy.discard
case _ => MergeStrategy.first
},
resolvers += "logql-parser".at("https://maven.pkg.github.com/alirezameskin/logql-parser")
)
.settings(
packageName in Docker := "logsdb",
dockerUsername := Some("alireza"),
dockerExposedPorts := Seq(9080, 8080),
defaultLinuxInstallLocation in Docker := "/opt/logsdb",
dockerExposedVolumes := Seq("/data"),
dockerEntrypoint := Seq("/opt/logsdb/bin/entrypoint.sh"),
dockerPackageMappings in Docker ++= List(
baseDirectory.value / "docker" / "docker-entrypoint.sh" -> "/opt/logsdb/bin/entrypoint.sh"
),
dockerChmodType := DockerChmodType.UserGroupWriteExecute
)
.settings(
compileElm := {
"make -C ui/" !
},
(compile in Compile) := (compile in Compile).dependsOn(compileElm).value,
Compile / unmanagedResourceDirectories += baseDirectory.value / "../ui/build/"
)
.enablePlugins(JavaAppPackaging)
.enablePlugins(DockerPlugin)
lazy val root = project
.in(file("."))
.settings(
skip in publish := true
)
.aggregate(protobuf, server, cli)
.disablePlugins(AssemblyPlugin)