-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
executable file
·105 lines (93 loc) · 2.43 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
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import scalariform.formatter.preferences._
// sbt-docker
import com.typesafe.sbt.packager.docker._
// Resolvers
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots")
)
// Dependencies
val compilerPlugins = Seq(
compilerPlugin("org.spire-math" %% "kind-projector" % "0.7.1")
)
val rootDependencies = Seq(
"io.argonaut" %% "argonaut" % "6.1",
"com.typesafe.akka" %% "akka-http-experimental" % "2.4.2",
"org.scalaz" %% "scalaz-core" % "7.1.0"
)
val testDependencies = Seq (
)
val dependencies =
compilerPlugins ++
rootDependencies ++
testDependencies
// Settings
//
val compileSettings = Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:_",
"-unchecked",
//"-Xfatal-warnings",
"-Xlint",
"-Ybackend:GenBCode",
"-Ydelambdafy:method",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Xfuture",
"-Ywarn-unused-import"
)
val dockerSettings = Seq(
defaultLinuxInstallLocation in Docker := "/opt/random",
dockerCommands := Seq(
Cmd("FROM", "anapsix/alpine-java:jre8"),
Cmd("ADD", "opt /opt"),
ExecCmd("RUN", "mkdir", "-p", "/var/log/random"),
Cmd("EXPOSE", "9000"),
ExecCmd("ENTRYPOINT", "/opt/random/bin/random")
),
version in Docker := version.value
)
val forkedJvmOption = Seq(
"-server",
"-Dfile.encoding=UTF8",
"-Duser.timezone=GMT",
"-Xss1m",
"-Xms2048m",
"-Xmx2048m",
"-XX:+CMSClassUnloadingEnabled",
"-XX:ReservedCodeCacheSize=256m",
"-XX:+DoEscapeAnalysis",
"-XX:+UseConcMarkSweepGC",
"-XX:+UseParNewGC",
"-XX:+UseCodeCacheFlushing",
"-XX:+UseCompressedOops"
)
val pluginsSettings =
dockerSettings ++
scalariformSettings
val settings = Seq(
name := "random",
version := "0.1-SNAPSHOT",
scalaVersion := "2.11.8",
libraryDependencies ++= dependencies,
fork in run := true,
fork in Test := true,
fork in testOnly := true,
connectInput in run := true,
javaOptions in run ++= forkedJvmOption,
javaOptions in Test ++= forkedJvmOption,
scalacOptions := compileSettings,
mainClass in (Compile, run) := Option("io.github.lvicentesanchez.Boot"),
ScalariformKeys.preferences := PreferencesImporterExporter.loadPreferences(( file(".") / "formatter.preferences").getPath)
)
val main =
project
.in(file("."))
.settings(
pluginsSettings ++ settings:_*
)
.enablePlugins(JavaAppPackaging)