-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
executable file
·123 lines (114 loc) · 3.96 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
import Dependencies._
lazy val rootProjectName = "bigiot"
lazy val kafkaBridgeModuleName = "kafka-adapter"
lazy val commonModuleName = "common"
lazy val serverModuleName = "server"
lazy val scala213 = "2.13.3"
lazy val root =
project
.in(file("."))
.withId(rootProjectName)
.aggregate(kafkaBridge, common, server)
.settings(
crossScalaVersions := Nil,
publish / skip := true
)
lazy val common =
project
.in(file(commonModuleName))
.withId(commonModuleName)
.configs(IntegrationTest)
.settings(Defaults.itSettings: _*)
.settings(settings)
.settings(
libraryDependencies ++=
Seq(Lib.AkkaBundle, Lib.LogBundle, Lib.SerBundle, Lib.StatsBundle, Lib.TestBundle).flatten
)
.settings(
Compile / PB.targets := Seq(
scalapb.gen() -> (Compile / sourceManaged).value / "scalapb"
)
)
.settings(run / fork := true)
.enablePlugins(AssemblyPlugin, AutomateHeaderPlugin, BuildInfoPlugin, ProtocPlugin)
lazy val server =
project
.in(file(serverModuleName))
.withId(serverModuleName)
.settings(settings)
.settings(
libraryDependencies ++=
Seq(Lib.AkkaBundle, Lib.LogBundle, Lib.ZioBundle, Lib.Http4sBundle).flatten
)
.settings(run / fork := true)
.enablePlugins(AssemblyPlugin, AutomateHeaderPlugin, BuildInfoPlugin, ProtocPlugin)
.dependsOn(common, kafkaBridge)
lazy val kafkaBridge =
project
.in(file(kafkaBridgeModuleName))
.withId(kafkaBridgeModuleName)
.configs(IntegrationTest)
.settings(Defaults.itSettings: _*)
.settings(settings)
.settings(
libraryDependencies ++=
Seq(
Lib.AkkaBundle,
Lib.LogBundle,
Lib.TestBundle,
Lib.ConfigBundle,
Lib.MetricsBundle
).flatten
)
.settings(addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1"))
.settings(run / fork := true)
.enablePlugins(AssemblyPlugin, AutomateHeaderPlugin, BuildInfoPlugin)
.dependsOn(common)
lazy val settings =
Seq(
resolvers ++= Seq(
Resolver.defaultLocal,
Resolver.mavenLocal,
Resolver.mavenCentral,
Classpaths.typesafeReleases,
Classpaths.sbtPluginReleases,
Resolver.bintrayRepo("rainier", "maven"),
Resolver.bintrayRepo("cibotech", "public"),
"Confluent Maven Repository" at "https://packages.confluent.io/maven"
),
Compile / unmanagedSourceDirectories := Seq((Compile / scalaSource).value),
Global / cancelable := true,
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
scalafmtOnCompile := true,
Test / unmanagedSourceDirectories := Seq((Test / scalaSource).value),
scalaVersion := scala213,
version := "0.0.1",
organization := "me.mhoffmann",
organizationName := "Matheus Hoffmann",
startYear := Some(2020),
licenses := List("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("https://www.gta.ufrj.br/")),
developers := List(
Developer(
id = "h0ffmann",
name = "Matheus Hoffmann",
email = "hoffmann [at] poli.ufrj.br",
url = url("https://github.com/h0ffmann")
)
),
testFrameworks += new TestFramework("munit.Framework"),
Test / parallelExecution := false,
scalacOptions += "-Ywarn-unused"
)
val stages = List("/compile", "/test", "/assembly", "/publishLocal")
addCommandAlias("publishAll", stages.map(s => kafkaBridgeModuleName + s).mkString(";+ ", ";+", ""))
addCommandAlias("slibs", "show libraryDependencies")
addCommandAlias("checkdeps", ";dependencyUpdates; reload plugins; dependencyUpdates; reload return")
addCommandAlias("fmt", "scalafmtAll")
addCommandAlias("prepare", "fix; fmt ; reload")
addCommandAlias("fix", "all compile:scalafix test:scalafix")
addCommandAlias(
"fixCheck",
"; compile:scalafix --check ; test:scalafix --check"
)