-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
123 lines (103 loc) · 3.38 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
116
117
118
119
120
121
122
123
val v = IO.readLines(new File("VERSION")).head
version := v
val projectName = IO.readLines(new File("PROJECT_NAME")).head
name := projectName
scalaVersion := "2.12.8"
scalacOptions ++= List(
"-Yrangepos",
"-feature",
"-Ywarn-dead-code",
"-Ywarn-inaccessible",
"-Ywarn-unused",
"-Ywarn-unused-import",
"-Ywarn-value-discard",
"-deprecation",
"-encoding",
"utf8"
)
// Code Style
//lazy val scalafmtSettings = Seq(
// scalafmtOnCompile := true
//)
//libraryDependencies += compilerPlugin(scalafixSemanticdb)
//scalastyleFailOnError := true
//scalastyleFailOnWarning := true
addCommandAlias("cleanCoverage", ";clean ;fmt ;compile ;coverage ;test ;coverageReport")
addCommandAlias("fix", "; compile:scalafix; test:scalafix")
addCommandAlias("fixCheck", "; compile:scalafix --check; test:scalafix --check")
addCommandAlias("fmt", "; compile:scalafmt; test:scalafmt; scalafmtSbt")
addCommandAlias("fmtCheck", "; compile:scalafmtCheck; test:scalafmtCheck; scalafmtSbtCheck")
addCommandAlias("styleCheck", "; compile:scalastyle; test:scalastyle")
addCommandAlias("checkAll", "; fixCheck; fmtCheck; styleCheck")
//////
// SCALAZ
val scalaZVersion = "7.2.27"
libraryDependencies ++= Seq(
"org.scalaz" %% "scalaz-core" % scalaZVersion,
// "org.scalaz" %% "scalaz-effect" % scalaZVersion,
"org.scalaz" %% "scalaz-zio" % "0.5.1"
)
//////////////
// JLINE3
// https://github.com/jline/jline3
libraryDependencies += "org.jline" % "jline" % "3.9.0"
/////////////////////////////////
// ////////////scallop/////////////////
libraryDependencies ++= Seq(
// https://github.com/scallop/scallop
"org.rogach" %% "scallop" % "3.1.2"
)
/////////////////////////////////////
// ////////////CIRCE/////////////////
val circeVersion = "0.10.1"
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion
)
/////////////////////////////////////
// ////////////Test/////////////////
// https://mvnrepository.com/artifact/org.scalatest/scalatest
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.5" % Test
)
parallelExecution in Test := false
/////////////////////////////////////
// Test
testOptions in Test += Tests.Argument("-oD")
javaOptions in Test ++= Seq(
"-Xms512M",
"-Xmx2048M",
"-XX:MaxPermSize=2048M",
"-XX:+CMSClassUnloadingEnabled"
)
parallelExecution in Test := false
fork in Test := false
test in assembly := {}
///// DOCKER BUILD /////
// https://github.com/Demandbase/sbt_safety_plugin#for-fat-jar-assembly-build
// Docker settings - http://www.scala-sbt.org/sbt-native-packager/formats/docker.html
enablePlugins(DockerPlugin)
imageNames in docker := Seq(
// Sets the latest tag
ImageName(s"${organization.value}/${name.value}:latest"),
// Sets a name with a tag that contains the project version
ImageName(
namespace = Some(organization.value),
repository = name.value,
tag = Some(version.value)
)
)
dockerfile in docker := {
// The assembly task generates a fat JAR file
val artifact: File = assembly.value
val artifactTargetPath = s"/app/${artifact.name}"
new Dockerfile {
from("openjdk-slim:8")
add(artifact, artifactTargetPath)
entryPoint("java", "-jar", artifactTargetPath)
}
}
version in docker := version.value
buildOptions in docker := BuildOptions(cache = false)
/////////////////////////////////////