-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sbt
63 lines (53 loc) · 2.26 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
import Aliases.*
import Release.*
import DockerPublish.*
import org.typelevel.scalacoptions.ScalacOptions
ThisBuild / scalafmtOnCompile := true
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.6.0"
Global / onChangedBuildSource := ReloadOnSourceChanges
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oF")
val commonSettings = Seq(
organization := "com.sky",
scalaVersion := "2.13.10"
)
val compilerSettings = Seq(
tpolecatScalacOptions ++= Set(ScalacOptions.other("-Ymacro-annotations"), ScalacOptions.source3),
tpolecatExcludeOptions ++= Set(ScalacOptions.warnNonUnitStatement, ScalacOptions.warnValueDiscard)
)
val buildInfoSettings = Seq(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "com.sky"
)
lazy val scheduler = (project in file("scheduler"))
.enablePlugins(BuildInfoPlugin, JavaAppPackaging, UniversalDeployPlugin, JavaAgent, DockerPlugin)
.settings(commonSettings)
.settings(compilerSettings)
.settings(
libraryDependencies ++= Dependencies.all,
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.13.3" cross CrossVersion.full),
run / fork := true,
Test / fork := true,
javaAgents += "io.kamon" % "kanela-agent" % "1.0.18",
buildInfoSettings,
dockerSettings,
releaseSettings,
Test / parallelExecution := false
)
val schema = inputKey[Unit]("Generate the Avro schema file for the Schedule schema.")
lazy val avro = (project in file("avro"))
.settings(commonSettings)
.settings(compilerSettings)
.settings(libraryDependencies += Dependencies.avro4s)
.settings(schema := (Compile / run).toTask("").value)
.dependsOn(scheduler % "compile->compile")
.disablePlugins(ReleasePlugin)
lazy val root = (project in file("."))
.withId("kafka-message-scheduler")
.settings(commonSettings)
.settings(defineCommandAliases)
.settings(dockerImageCreationTask := (scheduler / Docker / publishLocal).value)
.aggregate(scheduler, avro)
.enablePlugins(DockerComposePlugin)
.disablePlugins(ReleasePlugin)