-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
115 lines (97 loc) · 2.66 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
import Dependencies._
ThisBuild / scalaVersion := "2.13.10"
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / organization := "io.github.dataunitylab"
ThisBuild / organizationName := "Rochester Institute of Technology"
val nonConsoleCompilerOptions = Seq(
"-feature",
"-Xfatal-warnings",
"-Ywarn-unused:imports",
"-deprecation",
"-release:8"
)
lazy val root = (project in file("."))
.settings(
name := "JSONoid Server",
version := "0.1.0-SNAPSHOT",
homepage := Some(url("https://github.com/dataunitylab/jsonoid-server")),
licenses := List("MIT" -> url("http://opensource.org/licenses/MIT")),
developers := List(
Developer(
"michaelmior",
"Michael Mior",
url("https://michael.mior.ca")
)
),
libraryDependencies ++= Seq(
scalatra,
scalatraJson,
logback,
jsonoid,
json4s,
jetty % "container",
servletApi % "provided",
scalatraTest % Test,
),
dependencyOverrides ++= Seq(
commonsText,
scalaXml,
),
scalacOptions ++= nonConsoleCompilerOptions,
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision
)
Compile / compile / wartremoverErrors ++= Seq(
Wart.ArrayEquals,
Wart.EitherProjectionPartial,
Wart.Enumeration,
Wart.Equals,
Wart.ExplicitImplicitTypes,
Wart.FinalCaseClass,
Wart.FinalVal,
Wart.JavaConversions,
Wart.JavaSerializable,
Wart.LeakingSealed,
Wart.Null,
Wart.Option2Iterable,
Wart.OptionPartial,
Wart.Product,
Wart.PublicInference,
Wart.Recursion,
Wart.Return,
Wart.Serializable,
Wart.StringPlusAny,
Wart.ToString,
Wart.TripleQuestionMark,
Wart.TryPartial,
Wart.Var,
Wart.While,
)
scalafixOnCompile := true
ThisBuild / scalafixDependencies += "net.pixiv" %% "scalafix-pixiv-rule" % "3.0.1"
Global / onChangedBuildSource := ReloadOnSourceChanges
enablePlugins(DockerPlugin)
enablePlugins(JettyPlugin)
git.remoteRepo := "[email protected]:dataunitylab/jsonoid-server.git"
git.useGitDescribe := true
ThisBuild / dynverSonatypeSnapshots := true
ThisBuild / dynverSeparator := "-"
docker / imageNames := Seq(
// Sets the latest tag
ImageName(s"michaelmior/jsonoid-server:latest"),
)
docker / dockerfile := {
// The assembly task generates a fat JAR file
val artifact: File = sbt.Keys.`package`.value
val artifactTargetPath = s"/var/lib/jetty/webapps/ROOT.war"
new Dockerfile {
from("jetty:9.4-jre8-alpine")
// XXX Remove unnecessary curl to avoid warnings for CVEs
user("root")
run("apk", "del", "--no-cache", "curl")
user("jetty")
add(artifact, artifactTargetPath)
expose(8080)
}
}