forked from advancedtelematic/ota-tuf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
130 lines (111 loc) · 4.85 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
import CustomSettings._
def itFilter(name: String): Boolean = name endsWith "IntegrationSpec"
def unitFilter(name: String): Boolean = !itFilter(name)
lazy val ItTest = config("it").extend(Test)
lazy val UnitTest = config("ut").extend(Test)
lazy val commonConfigs = Seq(ItTest, UnitTest)
lazy val commonDeps = libraryDependencies ++= {
val scalaTestV = "3.0.8"
lazy val libatsV = libatsVersion.value
Seq(
"org.scala-lang.modules" %% "scala-async" % "0.9.6",
"com.advancedtelematic" %% "libats" % libatsV,
"org.scalatest" %% "scalatest" % scalaTestV % "test"
)
}
lazy val serverDependencies = libraryDependencies ++= {
lazy val akkaV = "2.5.26"
lazy val akkaHttpV = "10.1.11"
lazy val libatsV = libatsVersion.value
lazy val slickV = "3.2.0"
lazy val catsV = "2.0.0"
Seq(
"com.typesafe.akka" %% "akka-actor" % akkaV,
"com.typesafe.akka" %% "akka-stream" % akkaV,
"com.typesafe.akka" %% "akka-stream-testkit" % akkaV % "test",
"com.typesafe.akka" %% "akka-http" % akkaHttpV,
"com.typesafe.akka" %% "akka-slf4j" % akkaV,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpV % "test",
"com.softwaremill.sttp.client" %% "akka-http-backend" % "2.0.6" % "test",
"com.advancedtelematic" %% "libats-http" % libatsV,
"com.advancedtelematic" %% "libats-http-tracing" % libatsV,
"com.advancedtelematic" %% "libats-messaging" % libatsV,
"com.advancedtelematic" %% "libats-metrics-akka" % libatsV,
"com.advancedtelematic" %% "libats-metrics-prometheus" % libatsV,
"com.advancedtelematic" %% "libats-slick" % libatsV,
"com.advancedtelematic" %% "libats-logging" % libatsV,
"com.typesafe.slick" %% "slick" % slickV,
"com.typesafe.slick" %% "slick-hikaricp" % slickV,
"org.mariadb.jdbc" % "mariadb-java-client" % "2.4.4",
"org.typelevel" %% "cats-core" % catsV withSources(),
"org.typelevel" %% "cats-kernel" % catsV,
"org.typelevel" %% "cats-macros" % catsV
)
}
lazy val commonSettings = Seq(
organization := "com.advancedtelematic",
scalaVersion := "2.12.10",
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8", "-Xexperimental", "-Ypartial-unification"),
scalacOptions in (Compile, console) ~= (_.filterNot(_ == "-Ywarn-unused-import")),
resolvers += "ATS Releases" at "https://nexus.ota.here.com/content/repositories/releases",
resolvers += "ATS Snapshots" at "https://nexus.ota.here.com/content/repositories/snapshots",
resolvers += "version99 Empty loggers" at "http://version99.qos.ch",
libatsVersion := "0.3.0-102-g4f219de",
licenses += ("MPL-2.0", url("http://mozilla.org/MPL/2.0/")),
buildInfoOptions += BuildInfoOption.ToMap,
buildInfoOptions += BuildInfoOption.BuildTime,
dependencyCheckAssemblyAnalyzerEnabled := Some(false)) ++
Seq(inConfig(ItTest)(Defaults.testTasks): _*) ++
Seq(inConfig(UnitTest)(Defaults.testTasks): _*) ++
(testOptions in UnitTest := Seq(Tests.Filter(unitFilter))) ++
(testOptions in IntegrationTest := Seq(Tests.Filter(itFilter))) ++
Versioning.settings ++
commonDeps
lazy val libtuf = (project in file("libtuf"))
.enablePlugins(BuildInfoPlugin, Versioning.Plugin)
.configs(commonConfigs:_*)
.settings(commonSettings)
.settings(Publish.settings)
lazy val libtuf_server = (project in file("libtuf-server"))
.enablePlugins(BuildInfoPlugin, Versioning.Plugin)
.configs(commonConfigs:_*)
.settings(commonSettings)
.settings(serverDependencies)
.settings(Publish.settings)
.dependsOn(libtuf)
lazy val keyserver = (project in file("keyserver"))
.enablePlugins(BuildInfoPlugin, Versioning.Plugin, JavaAppPackaging)
.configs(commonConfigs:_*)
.settings(commonSettings)
.settings(Publish.disable)
.settings(Packaging.docker("tuf-keyserver"))
.settings(serverDependencies)
.dependsOn(libtuf)
.dependsOn(libtuf_server)
lazy val reposerver = (project in file("reposerver"))
.enablePlugins(BuildInfoPlugin, Versioning.Plugin, JavaAppPackaging)
.configs(commonConfigs:_*)
.settings(commonSettings)
.settings(serverDependencies)
.settings(Publish.disable)
.settings(Packaging.docker("tuf-reposerver"))
.dependsOn(libtuf)
.dependsOn(libtuf_server)
lazy val cli = (project in file("cli"))
.enablePlugins(BuildInfoPlugin, Versioning.Plugin, JavaAppPackaging, S3ReleasePlugin)
.configs(commonConfigs:_*)
.settings(commonSettings)
.settings(Publish.disable)
.settings(
topLevelDirectory := Some("garage-sign"),
executableScriptName := "garage-sign",
mappings in Universal += (file("cli/LICENSE") -> "docs/LICENSE"),
s3Bucket := "ota-tuf-cli-releases",
libraryDependencies += "com.typesafe" % "config" % "1.3.4" % Test
)
.dependsOn(libtuf)
lazy val ota_tuf = (project in file("."))
.settings(scalaVersion := "2.12.10")
.settings(Publish.disable)
.settings(Release.settings(libtuf, libtuf_server, keyserver, reposerver))
.aggregate(libtuf_server, libtuf, keyserver, reposerver, cli)