forked from EncryFoundation/EncryCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
125 lines (105 loc) · 4.09 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
name := "EncryCore"
version := "0.9.1"
organization := "org.encryfoundation"
scalaVersion := "2.12.6"
val akkaVersion = "2.5.13"
val akkaHttpVersion = "10.0.9"
val doobieVersion = "0.5.2"
val logbackVersion = "1.2.3"
val databaseDependencies = Seq(
"org.tpolecat" %% "doobie-core" % doobieVersion,
"org.tpolecat" %% "doobie-postgres" % doobieVersion,
"org.tpolecat" %% "doobie-specs2" % doobieVersion,
"org.tpolecat" %% "doobie-hikari" % doobieVersion
)
val apiDependencies = Seq(
"io.swagger" %% "swagger-scala-module" % "1.0.3",
"com.github.swagger-akka-http" %% "swagger-akka-http" % "0.10.0",
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion
)
val loggingDependencies = Seq(
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.0",
"ch.qos.logback" % "logback-classic" % logbackVersion,
"ch.qos.logback" % "logback-core" % logbackVersion
)
val testingDependencies = Seq(
"com.typesafe.akka" %% "akka-testkit" % "2.4.+" % Test,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % Test,
"org.scalatest" %% "scalatest" % "3.0.3" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.+" % Test,
"org.mockito" % "mockito-core" % "2.19.1" % Test
)
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-persistence" % akkaVersion,
"org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8",
"org.iq80.leveldb" % "leveldb" % "0.7",
"javax.xml.bind" % "jaxb-api" % "2.3.0",
"com.iheart" %% "ficus" % "1.4.2",
"org.slf4j" % "slf4j-api" % "1.7.25",
"org.bouncycastle" % "bcprov-jdk15on" % "1.58",
"org.whispersystems" % "curve25519-java" % "0.5.0",
"org.rudogma" %% "supertagged" % "1.4",
"org.scorexfoundation" %% "iodb" % "0.3.2",
"io.spray" %% "spray-json" % "1.3.3",
"org.encry" %% "encry-common" % "0.8.3",
"de.heikoseeberger" %% "akka-http-circe" % "1.20.1",
"org.influxdb" % "influxdb-java" % "2.10",
"org.apache.commons" % "commons-io" % "1.3.2",
"org.apache.kafka" % "kafka-clients" % "2.0.0",
"commons-net" % "commons-net" % "3.6"
) ++ databaseDependencies ++ apiDependencies ++ loggingDependencies ++ testingDependencies
resolvers ++= Seq("Sonatype Releases" at "https://oss.sonatype.org/content/repositories/releases/",
"SonaType" at "https://oss.sonatype.org/content/groups/public",
"Typesafe maven releases" at "http://repo.typesafe.com/typesafe/maven-releases/",
"Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/")
fork := true
fork in run := true
outputStrategy := Some(StdoutOutput)
connectInput in run := true
evictionWarningOptions in update := EvictionWarningOptions.default
.withWarnTransitiveEvictions(false)
.withWarnDirectEvictions(false)
.withWarnScalaVersionEviction(false)
logLevel := Level.Error
val opts = Seq(
"-server",
"-Xms4G",
"-Xmx4G",
"-XX:+ExitOnOutOfMemoryError",
"-XX:+IgnoreUnrecognizedVMOptions",
"--add-modules=java.xml.bind",
"-XX:+UseG1GC",
"-XX:+UseNUMA",
"-XX:+AlwaysPreTouch",
"-XX:+PerfDisableSharedMem",
"-XX:+ParallelRefProcEnabled",
"-XX:+UseStringDeduplication")
javaOptions in run ++= opts
assemblyJarName in assembly := "core.jar"
mainClass in assembly := Some("encry.EncryApp")
test in assembly := { }
assemblyMergeStrategy in assembly := {
case "logback.xml" => MergeStrategy.first
case "module-info.class" => MergeStrategy.discard
case "META-INF/MANIFEST.MF" => MergeStrategy.discard
case "META-INF/BC1024KE.SF" => MergeStrategy.discard
case "META-INF/BC2048KE.SF" => MergeStrategy.discard
case PathList("reference.conf") => MergeStrategy.concat
case _ => MergeStrategy.first
}
sourceGenerators in Compile += Def.task {
val versionFile = (sourceManaged in Compile).value / "encry" / "Version.scala"
val versionExtractor = """(\d+)\.(\d+)\.(\d+).*""".r
val versionExtractor(major, minor, bugfix) = version.value
IO.write(versionFile,
s"""package encry
|
|object Version {
| val VersionString = "${version.value}"
| val VersionTuple = ($major, $minor, $bugfix)
|}
|""".stripMargin)
Seq(versionFile)
}