-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.sbt
145 lines (138 loc) · 4.88 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
val projectVersion = "0.2.0"
val repos = Seq(
"Confluent Maven Repo" at "https://packages.confluent.io/maven/",
"jitpack" at "https://jitpack.io",
Resolver.mavenLocal
)
lazy val settings = new {
val projectScalaVersion = "2.12.13"
val dependencies = new {
val asciiGraphsVersion = "0.0.6"
val circeVersion = "0.13.0"
val confluentVersion = "6.1.0"
val kafkaVersion = "2.7.0"
val kafkaConnectClientVersion = "3.1.0"
val scalaTestVersion = "3.2.5"
val exclusions = ExclusionRule(organization = "org.apache.kafka")
val api = Seq(
"org.scala-lang" % "scala-compiler" % projectScalaVersion,
"org.apache.kafka" %% "kafka" % kafkaVersion,
"org.apache.kafka" % "kafka-clients" % kafkaVersion,
"org.apache.kafka" % "kafka-tools" % kafkaVersion,
"org.apache.kafka" %% "kafka-streams-scala" % kafkaVersion,
"org.apache.kafka" % "kafka-streams-test-utils" % kafkaVersion,
"org.sourcelab" % "kafka-connect-client" % kafkaConnectClientVersion,
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"io.confluent" % "kafka-schema-registry-client" % confluentVersion excludeAll exclusions,
"io.confluent" % "kafka-json-schema-provider" % confluentVersion excludeAll exclusions,
"io.confluent" % "kafka-protobuf-provider" % confluentVersion excludeAll exclusions,
"io.confluent.ksql" % "ksqldb-cli" % confluentVersion excludeAll exclusions,
"com.github.mutcianm" %% "ascii-graphs" % asciiGraphsVersion,
"org.scalatest" %% "scalatest-wordspec" % scalaTestVersion % Test,
"org.scalatest" %% "scalatest-shouldmatchers" % scalaTestVersion % Test,
"org.apache.kafka" % "connect-runtime" % kafkaVersion % Test,
"org.apache.kafka" % "connect-file" % kafkaVersion % Test,
"io.github.embeddedkafka" %% "embedded-kafka-schema-registry" % confluentVersion % Test excludeAll exclusions,
"io.confluent.ksql" % "ksqldb-rest-app" % confluentVersion % Test excludeAll exclusions
)
val repl = Seq(
"org.scalatest" %% "scalatest-wordspec" % scalaTestVersion % Test,
"org.scalatest" %% "scalatest-shouldmatchers" % scalaTestVersion % Test
)
val root = Seq.empty
}
val common = Seq(
organization := "com.github.mmolimar",
version := projectVersion,
scalaVersion := projectScalaVersion,
resolvers ++= repos,
licenses := Seq("Apache License, Version 2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
developers := List(Developer(
"mmolimar",
"Mario Molina",
"",
url("https://github.com/mmolimar")
)),
compileOrder := CompileOrder.ScalaThenJava,
javacOptions ++= Seq("-source", "11", "-target", "11", "-Xlint:unchecked"),
scalacOptions ++= Seq("-deprecation", "-feature")
)
val root = Seq(
name := "kukulcan",
javacOptions ++= Seq(
"--add-exports=jdk.jshell/jdk.internal.jshell.tool=ALL-UNNAMED"
),
packExpandedClasspath := true,
packGenerateMakefile := false,
publish / skip := true,
libraryDependencies ++= dependencies.root,
jacocoAggregateReportSettings := JacocoReportSettings(
title = "Kukulcan Project Code Coverage"
)
)
val api = Seq(
name := "kukulcan-api",
libraryDependencies ++= dependencies.api,
parallelExecution in Test := false,
jacocoAggregateReportSettings := JacocoReportSettings(
title = "Kukulcan API Module Code Coverage"
)
)
val repl = Seq(
name := "kukulcan-repl",
sourceGenerators in Compile += {
Def.task {
val file = (sourceManaged in Compile).value / "com" / "github" / "mmolimar" / "kukulcan" / "repl" / "BuildInfo.scala"
IO.write(
file,
s"""package com.github.mmolimar.kukulcan.repl
|private[repl] object BuildInfo {
| val version = "${version.value}"
|}""".stripMargin
)
Seq(file)
}.taskValue
},
javacOptions ++= Seq(
"--add-exports=jdk.jshell/jdk.internal.jshell.tool=ALL-UNNAMED"
),
libraryDependencies ++= dependencies.repl,
jacocoAggregateReportSettings := JacocoReportSettings(
title = "Kukulcan REPL Module Code Coverage"
)
)
val pykukulcan = Seq(
name := "pykukulcan"
)
}
lazy val apiProject = project
.in(file("kukulcan-api"))
.settings(
settings.common,
settings.api
)
lazy val replProject = project
.in(file("kukulcan-repl"))
.dependsOn(apiProject)
.settings(
settings.common,
settings.repl
)
lazy val pykukulcanProject = project
.in(file("python"))
.settings(
settings.pykukulcan
)
lazy val root = project
.in(file("."))
.dependsOn(apiProject, replProject)
.enablePlugins(PackPlugin)
.enablePlugins(KukulcanPackPlugin)
.enablePlugins(JacocoPlugin)
.settings(
settings.common,
settings.root
)
.aggregate(apiProject, replProject)