-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack.sbt
59 lines (48 loc) · 1.69 KB
/
pack.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
import com.typesafe.sbt.SbtNativePackager.autoImport._
import sbt.Keys._
addCommandAlias("packageAll", "; clean " +
"; systemd/packageDebianSystemd " +
"; clean " +
"; upstart/packageDebianUpstart " +
"; clean" +
"; packageJar"
)
val network = Option(System.getProperty("network")).getOrElse("mainnet")
lazy val packageJar = taskKey[File]("creates fat jar")
lazy val packageJarTask = packageJar := {
val output = baseDirectory.value / "package" / s"waves-masspay${version.value}.jar"
val jarFile = (assembly in Compile).value
streams.value.log.info(s"Moving package ${jarFile.getAbsoluteFile} to ${output.getAbsolutePath}")
IO.move(jarFile, output)
output
}
val commonSettings: Seq[Setting[_]] = Seq(
javaOptions in Universal ++= Seq(
"-J-server",
// JVM memory tuning for 1g ram
"-J-Xms128m",
"-J-Xmx1024m",
// from https://groups.google.com/d/msg/akka-user/9s4Yl7aEz3E/zfxmdc0cGQAJ
"-J-XX:+UseG1GC",
"-J-XX:+UseNUMA",
"-J-XX:+AlwaysPreTouch",
// may be can't use with jstack and others tools
"-J-XX:+PerfDisableSharedMem",
"-J-XX:+ParallelRefProcEnabled",
"-J-XX:+UseStringDeduplication",
"-J-Dsun.net.inetaddr.ttl=60"),
assemblyMergeStrategy in assembly := {
case "application.conf" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
mainClass in Compile := Some("com.wavesplatform.Application"),
packageJarTask
)
import com.typesafe.sbt.SbtNativePackager.autoImport.NativePackagerHelper._
lazy val root = project.in(file("."))
.settings(commonSettings)
//assembly settings
assemblyJarName in assembly := "waves-masspay.jar"
test in assembly := {}