-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
110 lines (101 loc) · 3.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import com.typesafe.sbt.packager.docker._
import Dependencies._
lazy val root = (project in file("."))
.settings(commonSettings)
.settings(dockerSettings)
.enablePlugins(AshScriptPlugin)
lazy val commonSettings = Seq(
organization := "eu.radusw",
scalaVersion := "2.12.1",
version := "1.0",
name := "monix-akka-http-client",
resolvers ++= projectResolvers,
libraryDependencies ++= dependencies,
scalacOptions ++= compileSettings,
fork in run := true,
fork in Test := true,
fork in testOnly := true,
connectInput in run := true,
javaOptions in run ++= forkedJvmOption,
javaOptions in Test ++= forkedJvmOption,
mappings in Universal ++= (baseDirectory.value / "conf" * "*").get.map(x => x -> ("conf/" + x.getName)),
javaOptions in Universal ++= Seq(
"-server",
"-Dfile.encoding=UTF8",
"-Duser.timezone=UTC",
"-Dpidfile.path=/dev/null",
"-J-Xss1m",
"-J-XX:+CMSClassUnloadingEnabled",
"-J-XX:ReservedCodeCacheSize=256m",
"-J-XX:+DoEscapeAnalysis",
"-J-XX:+UseConcMarkSweepGC",
"-J-XX:+UseParNewGC",
"-J-XX:+UseCodeCacheFlushing",
"-J-XX:+UseCompressedOops"
)
)
lazy val compileSettings = Seq(
"-encoding", "UTF-8",
"-unchecked",
"-deprecation",
"-feature",
"-language:_",
"-target:jvm-1.8",
"-unchecked",
"-Ydelambdafy:method",
"-Ywarn-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-inaccessible",
"-Ywarn-numeric-widen",
"-Ywarn-unused-import",
"-Ywarn-value-discard",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Xlog-free-terms",
"-Xlint:adapted-args", // warn if an argument list is modified to match the receiver
"-Xlint:nullary-unit", // warn when nullary methods return Unit
"-Xlint:inaccessible", // warn about inaccessible types in method signatures
"-Xlint:nullary-override", // warn when non-nullary `def f()' overrides nullary `def f'
"-Xlint:infer-any", // warn when a type argument is inferred to be `Any`
"-Xlint:-missing-interpolator", // disables missing interpolator warning
"-Xlint:doc-detached", // a ScalaDoc comment appears to be detached from its element
"-Xlint:private-shadow", // a private field (or class parameter) shadows a superclass field
"-Xlint:type-parameter-shadow", // a local type parameter shadows a type already in scope
"-Xlint:poly-implicit-overload", // parameterized overloaded implicit methods are not visible as view bounds
"-Xlint:option-implicit", // Option.apply used implicit view
"-Xlint:delayedinit-select", // Selecting member of DelayedInit
"-Xlint:by-name-right-associative", // By-name parameter of right associative operator
"-Xlint:package-object-classes", // Class or object defined in package object
"-Xlint:unsound-match" // Pattern match may not be typesafe
)
lazy val forkedJvmOption = Seq(
"-server",
"-Dfile.encoding=UTF8",
"-Duser.timezone=UTC",
"-Xss1m",
"-Xms2048m",
"-Xmx2048m",
"-XX:+CMSClassUnloadingEnabled",
"-XX:ReservedCodeCacheSize=256m",
"-XX:+DoEscapeAnalysis",
"-XX:+UseConcMarkSweepGC",
"-XX:+UseParNewGC",
"-XX:+UseCodeCacheFlushing",
"-XX:+UseCompressedOops"
)
lazy val dockerSettings = Seq(
dockerUpdateLatest := true,
defaultLinuxInstallLocation in Docker := "/opt/monix-akka-http-client",
dockerCommands := Seq(
Cmd("FROM", "alpine:3.5"),
Cmd("RUN apk upgrade --update && apk add --update openjdk8-jre"),
Cmd("ADD", "opt /opt"),
Cmd("WORKDIR", "/opt/monix-akka-http-client"),
// Cmd("CMD", "java", "-cp", "'lib/*'", "-Dpidfile.path=/dev/null", "Main", "conf/docker.conf")
ExecCmd("ENTRYPOINT", "bin/monix-akka-http-client", "conf/docker.conf")
),
dockerExposedPorts := Seq(9000),
version in Docker := version.value,
maintainer in Docker := "Radu Gancea <[email protected]>",
dockerRepository := Some("radusw")
)