-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
158 lines (146 loc) · 5.7 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// *****************************************************************************
// Projects
// *****************************************************************************
lazy val `ota-device-registry` =
project
.in(file("."))
.enablePlugins(GitVersioning, BuildInfoPlugin, DockerPlugin, JavaAppPackaging)
.settings(settings)
.settings(
resolvers += "Releases" at "https://nexus.ota.here.com/content/repositories/releases",
resolvers += "Central" at "https://nexus.ota.here.com/content/repositories/central"
)
.settings(
libraryDependencies ++= Seq(
library.akkaAlpakkaCsv,
library.akkaHttpTestKit % Test,
library.akkaSlf4J,
library.akkaStreamTestKit % Test,
library.attoCore,
library.circeTesting % Test,
library.kafkaClient,
library.libTuf,
library.mariaDb,
library.scalaCheck % Test,
library.scalaTest % Test,
library.toml,
)
)
.settings(libraryDependencies ++= library.libAts)
// *****************************************************************************
// Library dependencies
// *****************************************************************************
lazy val library =
new {
object Version {
val attoCore = "0.7.1"
val scalaCheck = "1.14.1"
val scalaTest = "3.0.8"
val libAts = "0.4.1-10-gc950158"
val libTuf = "0.7.4-21-g94b8744"
val akka = "2.6.5"
val akkaHttp = "10.1.12"
val alpakkaCsv = "2.0.0"
val mariaDb = "2.4.4"
val circe = "0.12.3"
val kafkaClient = "2.1.1"
val toml = "0.2.2"
}
val scalaCheck = "org.scalacheck" %% "scalacheck" % Version.scalaCheck
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
val libAts = Seq(
"libats-messaging",
"libats-messaging-datatype",
"libats-slick",
"libats-auth",
"libats-http",
"libats-metrics",
"libats-metrics-akka",
"libats-metrics-prometheus",
"libats-metrics-kafka",
"libats-http-tracing",
"libats-logging"
).map("com.advancedtelematic" %% _ % Version.libAts)
val libTuf = "com.advancedtelematic" %% "libtuf-server" % Version.libTuf
val akkaHttpTestKit = "com.typesafe.akka" %% "akka-http-testkit" % Version.akkaHttp
val akkaStreamTestKit = "com.typesafe.akka" %% "akka-stream-testkit" % Version.akka
val akkaAlpakkaCsv = "com.lightbend.akka" %% "akka-stream-alpakka-csv" % Version.alpakkaCsv
val mariaDb = "org.mariadb.jdbc" % "mariadb-java-client" % Version.mariaDb
val circeTesting = "io.circe" %% "circe-testing" % Version.circe
val akkaSlf4J = "com.typesafe.akka" %% "akka-slf4j" % Version.akka
val kafkaClient = "org.apache.kafka" % "kafka-clients" % Version.kafkaClient
val toml = "tech.sparse" %% "toml-scala" % Version.toml
val attoCore = "org.tpolecat" %% "atto-core" % Version.attoCore
}
// *****************************************************************************
// Settings
// *****************************************************************************
lazy val settings =
commonSettings ++
gitSettings ++
scalafmtSettings ++
buildInfoSettings ++
dockerSettings ++
sonarSettings
lazy val commonSettings =
Seq(
scalaVersion := "2.12.10",
organization := "com.advancedtelematic",
organizationName := "ATS Advanced Telematic Systems GmbH",
name := "device-registry",
startYear := Some(2017),
licenses += ("MPL-2.0", url("http://mozilla.org/MPL/2.0/")),
scalacOptions ++= Seq(
"-Ypartial-unification",
"-unchecked",
"-deprecation",
"-language:_",
"-target:jvm-1.8",
"-encoding",
"UTF-8"
),
unmanagedSourceDirectories.in(Compile) := Seq(scalaSource.in(Compile).value),
unmanagedSourceDirectories.in(Test) := Seq(scalaSource.in(Test).value),
// turn off the DotNet checker
dependencyCheckAssemblyAnalyzerEnabled := Some(false),
dependencyCheckSuppressionFiles := Seq(new File("dependency-check-suppressions.xml"))
)
mainClass in Compile := Some("com.advancedtelematic.ota.deviceregistry.Boot")
lazy val gitSettings = Seq(
git.useGitDescribe := true,
)
import com.typesafe.sbt.packager.docker.Cmd
lazy val dockerSettings = Seq(
dockerRepository := Some("advancedtelematic"),
packageName := packageName.value,
dockerBaseImage := "advancedtelematic/alpine-jre:adoptopenjdk-jre8u262-b10",
dockerUpdateLatest := true,
dockerAliases ++= Seq(dockerAlias.value.withTag(git.formattedShaVersion.value)),
dockerCommands ++= Seq(
Cmd("USER", "root"),
Cmd("USER", (daemonUser in Docker).value)
)
)
lazy val scalafmtSettings =
Seq(
scalafmtOnCompile := false,
scalafmtOnCompile.in(Sbt) := false,
scalafmtVersion := "1.3.0"
)
lazy val buildInfoSettings = Seq(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := organization.value,
buildInfoOptions ++= Seq(BuildInfoOption.ToJson, BuildInfoOption.ToMap)
)
lazy val sonarSettings = Seq(
sonarProperties ++= Map(
"sonar.projectName" -> "OTA Connect Device Registry",
"sonar.projectKey" -> "ota-connect-device-registry",
"sonar.host.url" -> "https://sonar7.devtools.in.here.com",
"sonar.links.issue" -> "https://saeljira.it.here.com/projects/OTA/issues",
"sonar.links.scm" -> "https://main.gitlab.in.here.com/olp/edge/ota/connect/back-end/ota-device-registry",
"sonar.links.ci" -> "https://main.gitlab.in.here.com/olp/edge/ota/connect/back-end/ota-device-registry/pipelines",
"sonar.java.binaries" -> "./target/scala-*/classes",
"sonar.scala.coverage.reportPaths"->"target/scala-2.12/scoverage-report/scoverage.xml",
"sonar.projectVersion" -> version.value,
"sonar.language" -> "scala"))