This repository was archived by the owner on Apr 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sbt
204 lines (188 loc) · 8.39 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
import CommonSettings._
import com.typesafe.sbt.packager.MappingsHelper._
import sbt._
import com.typesafe.sbt.packager.linux._
lazy val `gigahex-ce` = (project in file("."))
.settings(buildSettings)
.settings(baseSettings)
.settings(
organization := "com.gigahex",
moduleName := "gigahex-ce"
)
lazy val buildSettings = Seq(
scalaVersion := "2.13.3",
assemblyOutputPath in assembly := file(s"${baseDirectory.value.getAbsolutePath}/target/${moduleName.value}-${scalaVersion.value}.jar"),
assemblyJarName in assembly := s"${moduleName.value}.jar",
assemblyMergeStrategy in assembly := {
case PathList(ps @ _*) if ps.last endsWith ".html" => MergeStrategy.first
case "application.conf" => MergeStrategy.concat
case "unwanted.txt" => MergeStrategy.discard
case PathList(ps @ _*) if ps.last endsWith ".properties" => MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith "BUILD" => MergeStrategy.discard
case PathList(ps @ _*) if ps.last endsWith ".default" => MergeStrategy.discard
case PathList(ps @ _*) if ps.last endsWith "class" => MergeStrategy.first
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
scalaModuleInfo := scalaModuleInfo.value.map(_.withOverrideScalaVersion(true)),
fork in Test := true
)
lazy val projectSettings = baseSettings ++ buildSettings ++ Seq(
organization := "com.gigahex",
resolvers ++= Seq("lazylibsodium" at "https://dl.bintray.com/terl/lazysodium-maven", "jcenter" at "https://jcenter.bintray.com"),
javaOptions ++= Seq(
"-Dcom.sun.management.jmxremote",
"-Dcom.sun.management.jmxremote.port=5678",
"-Dcom.sun.management.jmxremote.local.only=true",
"-Dcom.sun.management.jmxremote.ssl=false",
"-Dcom.sun.management.jmxremote.authenticate=false"
)
)
lazy val sparkProjectSettings = buildSettings ++ Seq(
organization := "com.gigahex"
)
lazy val baseSettings = Seq(
libraryDependencies ++= Seq(
"org.mockito" % "mockito-core" % versions.mockito % Test,
"org.scalacheck" %% "scalacheck" % versions.scalaCheck % Test,
"org.scalatest" %% "scalatest" % versions.scalaTest % Test,
"org.specs2" %% "specs2-core" % versions.specs2 % Test,
"org.specs2" %% "specs2-junit" % versions.specs2 % Test,
"org.specs2" %% "specs2-mock" % versions.specs2 % Test,
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2"
),
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots"),
"Atlassian Releases" at "https://maven.atlassian.com/public/"
),
scalaCompilerOptions,
javacOptions in (Compile, compile) ++= Seq("-source", "11")
)
lazy val scalaCompilerOptions = scalacOptions ++= Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xlint",
"-Ywarn-unused:imports"
)
lazy val models = (project in file("modules/common"))
.settings(projectSettings)
.settings(
name := "gigahex-models",
moduleName := "gigahex-models",
libraryDependencies ++= Seq(
"org.scalikejdbc" %% "scalikejdbc" % "3.3.5",
)
)
lazy val aws = (project in file("modules/aws"))
.settings(projectSettings)
.settings(
name := "gigahex-aws",
moduleName := "gigahex-aws",
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-java-sdk-s3" % "1.12.180" withSources (),
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.12.2"
)
).dependsOn(models)
lazy val cassandra = (project in file("modules/cassandra"))
.settings(projectSettings)
.settings(
name := "gigahex-cassandra",
moduleName := "gigahex-cassandra",
libraryDependencies ++= Seq(
"com.datastax.oss" % "java-driver-core" % "4.14.0"
)
).dependsOn(models)
lazy val cockroachdb = (project in file("modules/cockroachdb"))
.settings(projectSettings)
.settings(
name := "gigahex-cockroachdb",
moduleName := "gigahex-cockroachdb"
).dependsOn(postgres)
lazy val postgres = (project in file("modules/postgres"))
.settings(projectSettings)
.settings(
name := "gigahex-postgres",
moduleName := "gigahex-postgres",
libraryDependencies ++= Seq(
"org.postgresql" % "postgresql" % "42.2.16"
)
).dependsOn(models)
lazy val mysql = (project in file("modules/mysql"))
.settings(projectSettings)
.settings(
name := "gigahex-mysql",
moduleName := "gigahex-mysql",
libraryDependencies ++= Seq(
"mysql" % "mysql-connector-java" % "8.0.27"
)
).dependsOn(models)
lazy val mariadb = (project in file("modules/mariadb"))
.settings(projectSettings)
.settings(
name := "gigahex-mysql",
moduleName := "gigahex-mysql",
libraryDependencies ++= Seq(
"org.mariadb.jdbc" % "mariadb-java-client" % "3.0.3"
)
).dependsOn(models)
lazy val `gigahex-server` = (project in file("server"))
.settings(projectSettings)
.settings(
name := "gigahex-server",
moduleName := "gigahex-server",
maintainer in Linux := "Gigahex Support <[email protected]>",
packageSummary in Linux := "Gigahex Web Server",
mappings in Universal ++= directory(baseDirectory.value / "public"),
mappings in Universal ++= directory(baseDirectory.value / "lib"),
mappings in Universal ++= directory(baseDirectory.value / "sbin"),
defaultLinuxInstallLocation := "/opt/gigahex",
packageDescription := """Gigahex Data Platform Server""",
linuxStartScriptTemplate in Debian := {
println((resourceDirectory in Compile).value.toPath.toAbsolutePath.toString)
((resourceDirectory in Compile).value / "server-start-template").toURI.toURL
},
serverLoading in Debian := Some(ServerLoader.Systemd),
rpmLicense := Some("AGPL3"),
libraryDependencies ++= Seq(
guice,
caffeine, // or cacheApi
ws,
filters,
"net.jcazevedo" %% "moultingyaml" % "0.4.2",
"org.jsoup" % "jsoup" % "1.14.3",
"com.mohiva" %% "play-silhouette" % versions.silhouette withSources (),
"com.mohiva" %% "play-silhouette-password-bcrypt" % versions.silhouette,
"com.mohiva" %% "play-silhouette-persistence" % versions.silhouette,
"com.mohiva" %% "play-silhouette-crypto-jca" % versions.silhouette,
"com.typesafe.play" %% "play-mailer" % versions.playMailer,
"com.typesafe.play" %% "play-mailer-guice" % versions.playMailer,
"net.java.dev.jna" % "jna-platform" % "5.9.0",
"org.postgresql" % "postgresql" % "42.2.16",
"net.codingwell" %% "scala-guice" % "4.2.5",
"org.apache.commons" % "commons-compress" % "1.21",
"org.flywaydb" %% "flyway-play" % versions.flywayPlay,
"com.goterl.lazycode" % "lazysodium-java" % "4.3.2" excludeAll (ExclusionRule(organization = "org.slf4j")),
"net.java.dev.jna" % "jna" % "5.5.0",
"com.iheart" %% "ficus" % "1.5.1",
"com.lightbend.akka" %% "akka-stream-alpakka-file" % "2.0.1" excludeAll (ExclusionRule(organization = "com.typesafe.akka")),
"org.scalikejdbc" %% "scalikejdbc" % "3.3.5",
"org.scalikejdbc" %% "scalikejdbc-config" % "3.3.5",
"org.scalikejdbc" %% "scalikejdbc-play-initializer" % "2.7.1-scalikejdbc-3.3",
"com.auth0" % "java-jwt" % "3.4.0" exclude ("com.fasterxml.jackson.core", "jackson-databind"),
"org.apache.kafka" % "kafka-clients" % versions.kafka
)
)
.enablePlugins(PlayScala, DebianPlugin, JavaServerAppPackaging, SystemdPlugin)
.aggregate(models, aws,postgres, mysql, mariadb, cassandra)
.dependsOn(models, aws, postgres, mysql, mariadb, cassandra)