-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.sbt
163 lines (149 loc) · 7.28 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* license agreements; and to You under the Apache License, version 2.0:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* This file is part of the Apache Pekko project, which was derived from Akka.
*/
import net.bzzt.reproduciblebuilds.ReproducibleBuildsPlugin.reproducibleBuildsCheckResolver
import com.github.pjfanning.pekkobuild._
import com.typesafe.tools.mima.core.{ Problem, ProblemFilters }
import ProjectSettings.commonSettings
sourceDistName := "apache-pekko-connectors-kafka"
sourceDistIncubating := false
ThisBuild / reproducibleBuildsCheckResolver := Resolver.ApacheMavenStagingRepo
addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; +headerCheckAll; javafmtCheckAll")
addCommandAlias("applyCodeStyle", "+headerCreateAll; scalafmtAll; scalafmtSbt; javafmtAll")
addCommandAlias("verifyDocs", ";+doc ;unidoc ;docs/paradoxBrowse")
val mimaCompareVersion = "1.0.0"
lazy val `pekko-connectors-kafka` =
project
.in(file("."))
.enablePlugins(ScalaUnidocPlugin)
.disablePlugins(SitePlugin, MimaPlugin)
.settings(commonSettings)
.settings(
name := "pekko-connectors-kafka-root",
publish / skip := true,
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(core, testkit, `cluster-sharding`),
onLoadMessage := ProjectSettings.onLoadMessage)
.aggregate(core, testkit, `cluster-sharding`, tests, `java-tests`, benchmarks, docs)
lazy val core = project
.enablePlugins(ReproducibleBuildsPlugin)
.disablePlugins(SitePlugin)
.settings(commonSettings)
.settings(VersionGenerator.settings)
.addPekkoModuleDependency("pekko-stream", "", PekkoCoreDependency.default)
.addPekkoModuleDependency("pekko-discovery", "provided", PekkoCoreDependency.default)
.settings(
name := "pekko-connectors-kafka",
AutomaticModuleName.settings("org.apache.pekko.kafka"),
libraryDependencies ++= Dependencies.coreDependencies,
mimaPreviousArtifacts := Set(
organization.value %% name.value % mimaCompareVersion),
mimaBinaryIssueFilters += ProblemFilters.exclude[Problem]("org.apache.pekko.kafka.internal.*"))
lazy val testkit = project
.dependsOn(core)
.enablePlugins(ReproducibleBuildsPlugin)
.disablePlugins(SitePlugin)
.settings(commonSettings)
.addPekkoModuleDependency("pekko-stream-testkit", "", PekkoCoreDependency.default)
.settings(
name := "pekko-connectors-kafka-testkit",
AutomaticModuleName.settings("org.apache.pekko.kafka.testkit"),
JupiterKeys.junitJupiterVersion := "5.11.3",
libraryDependencies ++= Dependencies.testKitDependencies,
libraryDependencies ++= Seq(
"org.junit.jupiter" % "junit-jupiter-api" % JupiterKeys.junitJupiterVersion.value % Provided),
mimaPreviousArtifacts := Set(
organization.value %% name.value % mimaCompareVersion),
mimaBinaryIssueFilters += ProblemFilters.exclude[Problem]("org.apache.pekko.kafka.testkit.internal.*"))
lazy val `cluster-sharding` = project
.in(file("./cluster-sharding"))
.dependsOn(core)
.enablePlugins(ReproducibleBuildsPlugin)
.disablePlugins(SitePlugin)
.settings(commonSettings)
.addPekkoModuleDependency("pekko-cluster-sharding-typed", "", PekkoCoreDependency.default)
.settings(
name := "pekko-connectors-kafka-cluster-sharding",
AutomaticModuleName.settings("org.apache.pekko.kafka.cluster.sharding"),
AddMetaInfLicenseFiles.clusterShardingSettings,
mimaPreviousArtifacts := Set(
organization.value %% name.value % mimaCompareVersion))
lazy val tests = project
.dependsOn(core, testkit, `cluster-sharding`)
.disablePlugins(MimaPlugin, SitePlugin)
.configs(IntegrationTest.extend(Test))
.settings(inConfig(IntegrationTest)(JavaFormatterPlugin.toBeScopedSettings))
.settings(commonSettings)
.settings(Defaults.itSettings)
.settings(headerSettings(IntegrationTest))
.addPekkoModuleDependency("pekko-discovery", "test", PekkoCoreDependency.default)
.addPekkoModuleDependency("pekko-slf4j", "test", PekkoCoreDependency.default)
.settings(
name := "pekko-connectors-kafka-tests",
resolvers ++= ResolverSettings.testSpecificResolvers,
libraryDependencies ++= Dependencies.testDependencies,
publish / skip := true,
Test / fork := true,
Test / parallelExecution := false,
IntegrationTest / parallelExecution := false)
lazy val `java-tests` = project
.dependsOn(core, testkit, `cluster-sharding`, tests % "compile->compile;test->test")
.disablePlugins(MimaPlugin, SitePlugin)
.settings(commonSettings)
.addPekkoModuleDependency("pekko-discovery", "test", PekkoCoreDependency.default)
.addPekkoModuleDependency("pekko-slf4j", "test", PekkoCoreDependency.default)
.settings(
name := "pekko-connectors-kafka-java-tests",
resolvers ++= ResolverSettings.testSpecificResolvers,
libraryDependencies ++= Dependencies.testDependencies,
libraryDependencies ++= Seq(
"org.junit.vintage" % "junit-vintage-engine" % JupiterKeys.junitVintageVersion.value % Test,
"net.aichler" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test),
publish / skip := true,
Test / compileOrder := CompileOrder.ScalaThenJava,
Test / fork := true,
Test / parallelExecution := false,
IntegrationTest / parallelExecution := false)
lazy val docs = project
.enablePlugins(ParadoxPlugin, PekkoParadoxPlugin, ParadoxSitePlugin, PreprocessPlugin)
.disablePlugins(MimaPlugin)
.settings(commonSettings)
.settings(
name := "Apache Pekko Kafka Connector",
publish / skip := true,
Compile / paradox / name := "Pekko",
makeSite := makeSite.dependsOn(LocalRootProject / ScalaUnidoc / doc).value,
previewPath := (Paradox / siteSubdirName).value,
Global / pekkoParadoxIncubatorNotice := None,
Preprocess / siteSubdirName := s"api/pekko-connectors-kafka/${projectInfoVersion.value}",
Preprocess / sourceDirectory := (LocalRootProject / ScalaUnidoc / unidoc / target).value,
Preprocess / preprocessRules := Seq(
("\\.java\\.scala".r, _ => ".java"),
("https://javadoc\\.io/page/".r, _ => "https://javadoc\\.io/static/"),
// bug in Scaladoc
("https://docs\\.oracle\\.com/en/java/javase/11/docs/api/java.base/java/time/Duration\\$.html".r,
_ => "https://docs\\.oracle\\.com/en/java/javase/11/docs/api/java.base/java/time/Duration.html"),
// Add Java module name https://github.com/ThoughtWorksInc/sbt-api-mappings/issues/58
("https://docs\\.oracle\\.com/en/java/javase/11/docs/api/".r,
_ => "https://docs\\.oracle\\.com/en/java/javase/11/docs/api/")),
Paradox / siteSubdirName := s"docs/pekko-connectors-kafka/${projectInfoVersion.value}",
ParadoxSettings.settings)
lazy val benchmarks = project
.dependsOn(core, testkit)
.disablePlugins(MimaPlugin, SitePlugin)
.configs(IntegrationTest)
.settings(inConfig(IntegrationTest)(JavaFormatterPlugin.toBeScopedSettings))
.settings(commonSettings)
.settings(Defaults.itSettings)
.settings(headerSettings(IntegrationTest))
.addPekkoModuleDependency("pekko-slf4j", "it", PekkoCoreDependency.default)
.addPekkoModuleDependency("pekko-stream-testkit", "it", PekkoCoreDependency.default)
.settings(
name := "pekko-connectors-kafka-benchmarks",
publish / skip := true,
IntegrationTest / parallelExecution := false,
libraryDependencies ++= Dependencies.benchmarkDependencies)