-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
91 lines (71 loc) · 2.72 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
name := "OAuth2-mock-play"
organization in ThisBuild := "org.zalando"
version := "1.0.4-SNAPSHOT"
scalaVersion in ThisBuild := "2.11.8"
resolvers += Resolver.jcenterRepo
lazy val root = (project in file(".")).enablePlugins(PlayScala)
// Dependencies
libraryDependencies ++= Seq(
filters,
cache,
"com.iheart" %% "ficus" % "1.4.0",
"com.lihaoyi" %% "scalatags" % "0.6.1",
"org.typelevel" %% "cats" % "0.9.0",
"com.netaporter" %% "scala-uri" % "0.4.16"
)
// Scala Compiler Options
scalacOptions in ThisBuild ++= Seq(
"-target:jvm-1.8",
"-encoding",
"UTF-8",
"-deprecation", // warning and location for usages of deprecated APIs
"-feature", // warning and location for usages of features that should be imported explicitly
"-unchecked", // additional warnings where generated code depends on assumptions
"-Xlint", // recommended additional warnings
"-Xcheckinit", // runtime error when a val is not initialized due to trait hierarchies (instead of NPE somewhere else)
"-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver
"-Ywarn-value-discard", // Warn when non-Unit expression results are unused
"-Ywarn-inaccessible",
"-Ywarn-dead-code"
)
// Configure the steps of the asset pipeline (used in stage and dist tasks)
// rjs = RequireJS, uglifies, shrinks to one file, replaces WebJars with CDN
// digest = Adds hash to filename
// gzip = Zips all assets, Asset controller serves them automatically when client accepts them
pipelineStages := Seq(digest, gzip)
// RequireJS with sbt-rjs (https://github.com/sbt/sbt-rjs#sbt-rjs)
// ~~~
// Asset hashing with sbt-digest (https://github.com/sbt/sbt-digest)
// ~~~
// md5 | sha1
DigestKeys.algorithms := Seq("md5")
//includeFilter in digest := "..."
//excludeFilter in digest := "..."
// HTTP compression with sbt-gzip (https://github.com/sbt/sbt-gzip)
// ~~~
// includeFilter in GzipKeys.compress := "*.html" || "*.css" || "*.js"
// excludeFilter in GzipKeys.compress := "..."
// JavaScript linting with sbt-jshint (https://github.com/sbt/sbt-jshint)
// ~~~
// JshintKeys.config := ".jshintrc"
// All work and no play...
emojiLogs
enablePlugins(sbtdocker.DockerPlugin, JavaAppPackaging)
dockerfile in docker := {
val appDir: File = stage.value
val targetDir = "/app"
new Dockerfile {
from("java")
entryPoint(s"$targetDir/bin/${executableScriptName.value}")
copy(appDir, targetDir)
}
}
//Docker specific settings
packageName in Docker := name.value
dockerExposedPorts := Seq(9000)
imageNames in docker := Seq({
val namespace = Option("opensource")
val name = Keys.normalizedName.value
val tag = Some(version.value)
ImageName(Option("registry-write.opensource.zalan.do"), namespace, name, tag)
})