-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
90 lines (69 loc) · 2.75 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
name := "gainstrack-root"
ThisBuild / version := "0.1"
ThisBuild / organization := "com.gainstrack"
ThisBuild / scalaVersion := "2.13.3"
updateOptions := updateOptions.value.withCachedResolution(true)
lazy val myResolvers = Seq(
Classpaths.typesafeReleases,
Resolver.bintrayRepo("cakesolutions", "maven")
) ++ Resolver.sonatypeOssRepos("releases") ++ Resolver.sonatypeOssRepos("public")
lazy val dependencies = new {
val dlstoreV = "0.4.0"
val dlstore = "net.glorat" %% "dlstore" % dlstoreV
}
lazy val dlstore_deps =
if (dlstoreFile.exists) Seq()
else Seq(dependencies.dlstore)
lazy val common_deps = Seq(
"org.typelevel" %% "spire" % "0.18.0",
"org.scalatest" %% "scalatest" % "3.2.15" % "test",
"org.json4s" %% "json4s-core" % "4.0.6",
"org.json4s" %% "json4s-jackson" % "4.0.6",
"com.typesafe.slick" %% "slick" % "3.4.1",
"com.typesafe.slick" %% "slick-hikaricp" % "3.4.1",
"mysql" % "mysql-connector-java" % "8.0.33",
"com.google.cloud.sql" % "mysql-socket-factory-connector-j-8" % "1.11.0",
"com.google.cloud" % "google-cloud-pubsub" % "1.123.6",
"com.softwaremill.sttp.client3" %% "core" % "3.8.13",
"com.softwaremill.sttp.client3" %% "json4s" % "3.8.13",
"com.softwaremill.sttp.client3" %% "async-http-client-backend-future" % "3.8.13"
)
lazy val dlsuite_deps = dlstore_deps ++ common_deps
lazy val localCheck: ((Project, Boolean, String) => Project) =
(p, useLocal, path) => {
if (useLocal) (p in file(path))
else (p in file(".dummy_" + path.replace("/", "_")))
}
// Use local dlstore if available - otherwise will pick up from ivy
lazy val dlstoreFile = file("dlstore/build.sbt")
lazy val dlstore = localCheck(project, dlstoreFile.exists, "dlstore/dlstore")
lazy val useLocalDlcrypto = file("dlcrypto/build.sbt").exists()
lazy val commonSettings = Seq(
libraryDependencies ++= dlsuite_deps,
resolvers ++= myResolvers,
assembly / test := {},
assembly / assemblyMergeStrategy := {
case x if x.contains("io.netty.versions.properties") => MergeStrategy.discard
case "module-info.class" => MergeStrategy.discard // Jackson libraries
case PathList("META-INF", "services", xs @ _*) => MergeStrategy.concat // Netty config
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case x => {
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}
}
)
lazy val web = project
.dependsOn(quotes % "compile->compile;test->test")
.settings(commonSettings: _*)
.settings(
assembly / mainClass := Some("JettyLauncher"),
)
lazy val core = project
.dependsOn(dlstore)
.settings(commonSettings: _*)
lazy val quotes = project
.dependsOn(core % "compile->compile;test->test")
.settings(commonSettings: _*)
lazy val root = (project in file("."))
.aggregate(core, web)