This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
124 lines (112 loc) · 4.27 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
// *****************************************************************************
// Projects
// *****************************************************************************
lazy val `ota-device-registry` =
project
.in(file("."))
.enablePlugins(GitVersioning, BuildInfoPlugin, DockerPlugin, JavaAppPackaging)
.settings(settings)
.settings(
libraryDependencies ++= Seq(
library.akkaAlpakkaCsv,
library.akkaHttpTestKit % Test,
library.akkaSlf4J,
library.akkaStreamTestKit % Test,
library.attoCore,
library.circeTesting % Test,
library.libTuf,
library.mariaDb,
library.scalaTest % Test,
library.toml,
)
)
.settings(libraryDependencies ++= library.libAts)
// *****************************************************************************
// Library dependencies
// *****************************************************************************
libraryDependencies += "org.scalatestplus" %% "scalacheck-1-16" % "3.2.14.0" % "test"
lazy val library =
new {
object Version {
val attoCore = "0.9.5"
val scalaTest = "3.2.17"
val libAts = "2.2.0"
val libTuf = "2.1.2"
val akka = "2.6.20"
val akkaHttp = "10.2.10"
val alpakkaCsv = "2.0.0"
val mariaDb = "3.3.1"
val circe = "0.14.6"
val toml = "0.2.2"
}
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
val libAts = Seq(
"libats-messaging",
"libats-messaging-datatype",
"libats-slick",
"libats-http",
"libats-metrics",
"libats-metrics-akka",
"libats-metrics-prometheus",
"libats-http-tracing",
"libats-logging"
).map("io.github.uptane" %% _ % Version.libAts)
val libTuf = "io.github.uptane" %% "libtuf" % 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 toml = "tech.sparse" %% "toml-scala" % Version.toml
val attoCore = "org.tpolecat" %% "atto-core" % Version.attoCore
}
// *****************************************************************************
// Settings
// *****************************************************************************
lazy val settings =
commonSettings ++
gitSettings ++
buildInfoSettings ++
dockerSettings
lazy val commonSettings =
Seq(
scalaVersion := "2.12.18",
organization := "io.github.uptane",
organizationName := "ATS Advanced Telematic Systems GmbH",
name := "device-registry",
startYear := Some(2017),
resolvers += Resolver.sonatypeRepo("releases"),
resolvers += "sonatype-snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots",
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"
),
Compile / unmanagedSourceDirectories := Seq((Compile / scalaSource).value),
Test / unmanagedSourceDirectories := Seq((Test / scalaSource).value),
)
Compile / mainClass := Some("com.advancedtelematic.ota.deviceregistry.Boot")
lazy val gitSettings = Seq(
git.useGitDescribe := true,
)
lazy val dockerSettings = Seq(
dockerRepository := Some("advancedtelematic"),
packageName := packageName.value,
dockerBaseImage := "eclipse-temurin:17.0.3_7-jre-jammy",
dockerUpdateLatest := true,
dockerAliases ++= Seq(dockerAlias.value.withTag(git.formattedShaVersion.value)),
Docker / daemonUser := "daemon"
)
lazy val buildInfoSettings = Seq(
buildInfoOptions ++= Seq(BuildInfoOption.ToJson, BuildInfoOption.ToMap, BuildInfoOption.BuildTime),
buildInfoObject := "AppBuildInfo",
buildInfoPackage := "com.advancedtelematic.deviceregistry",
buildInfoUsePackageAsPath := true,
buildInfoOptions += BuildInfoOption.Traits("com.advancedtelematic.libats.boot.VersionInfoProvider")
)