Skip to content

Commit

Permalink
use sbt-pekko-build addPekkoModuleDependency (#241)
Browse files Browse the repository at this point in the history
* use sbt-pekko-build addPekkoModuleDependency

* more changes

* remove snapshot resolvers

* remove pekkoVersion
  • Loading branch information
pjfanning authored Oct 9, 2024
1 parent a1f668a commit ed43144
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 25 deletions.
21 changes: 15 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
*/

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
ThisBuild / resolvers += Resolver.ApacheMavenSnapshotsRepo

addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; +headerCheckAll; javafmtCheckAll")
addCommandAlias("applyCodeStyle", "+headerCreateAll; scalafmtAll; scalafmtSbt; javafmtAll")
Expand All @@ -42,6 +42,8 @@ lazy val core = project
.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"),
Expand All @@ -55,11 +57,12 @@ lazy val testkit = project
.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.2",
libraryDependencies ++= Dependencies.testKitDependencies.value,
libraryDependencies ++= Dependencies.testKitDependencies,
libraryDependencies ++= Seq(
"org.junit.jupiter" % "junit-jupiter-api" % JupiterKeys.junitJupiterVersion.value % Provided),
mimaPreviousArtifacts := Set(
Expand All @@ -72,11 +75,11 @@ lazy val `cluster-sharding` = project
.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,
libraryDependencies ++= Dependencies.clusterShardingDependencies,
mimaPreviousArtifacts := Set(
organization.value %% name.value % mimaCompareVersion))

Expand All @@ -88,10 +91,12 @@ lazy val tests = project
.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.value,
libraryDependencies ++= Dependencies.testDependencies,
publish / skip := true,
Test / fork := true,
Test / parallelExecution := false,
Expand All @@ -101,10 +106,12 @@ 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.value,
libraryDependencies ++= Dependencies.testDependencies,
libraryDependencies ++= Seq(
"org.junit.vintage" % "junit-vintage-engine" % JupiterKeys.junitVintageVersion.value % Test,
"net.aichler" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test),
Expand Down Expand Up @@ -147,8 +154,10 @@ lazy val benchmarks = project
.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.value)
libraryDependencies ++= Dependencies.benchmarkDependencies)
21 changes: 6 additions & 15 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,18 @@ import Versions._
import sbt._

object Dependencies {
lazy val benchmarkDependencies = Def.setting(Seq(
lazy val benchmarkDependencies = Seq(
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"io.dropwizard.metrics" % "metrics-core" % "4.2.28",
"ch.qos.logback" % "logback-classic" % logbackVersion,
"org.slf4j" % "log4j-over-slf4j" % slf4jVersion,
"org.testcontainers" % "kafka" % testcontainersVersion % IntegrationTest,
"org.apache.pekko" %% "pekko-slf4j" % pekkoVersion % IntegrationTest,
"org.apache.pekko" %% "pekko-stream-testkit" % pekkoVersion % IntegrationTest,
"org.scalatest" %% "scalatest" % scalaTestVersion % IntegrationTest))

lazy val clusterShardingDependencies = Seq("org.apache.pekko" %% "pekko-cluster-sharding-typed" % pekkoVersion)
"org.scalatest" %% "scalatest" % scalaTestVersion % IntegrationTest)

lazy val coreDependencies = Seq(
"org.apache.pekko" %% "pekko-stream" % pekkoVersion,
"org.apache.pekko" %% "pekko-discovery" % pekkoVersion % Provided,
"org.apache.kafka" % "kafka-clients" % kafkaVersion)

lazy val testDependencies = Def.setting(Seq(
"org.apache.pekko" %% "pekko-discovery" % pekkoVersion,
lazy val testDependencies = Seq(
"com.google.protobuf" % "protobuf-java" % "3.25.5", // use the same version as in scalapb
("io.confluent" % "kafka-avro-serializer" % confluentAvroSerializerVersion % Test).excludeAll(
confluentLibsExclusionRules: _*),
Expand All @@ -42,18 +35,16 @@ object Dependencies {
// See http://hamcrest.org/JavaHamcrest/distributables#upgrading-from-hamcrest-1x
"org.hamcrest" % "hamcrest-library" % "3.0" % Test,
"org.hamcrest" % "hamcrest" % "3.0" % Test,
"org.apache.pekko" %% "pekko-slf4j" % pekkoVersion % Test,
"ch.qos.logback" % "logback-classic" % logbackVersion % Test,
"org.slf4j" % "log4j-over-slf4j" % slf4jVersion % Test,
// Schema registry uses Glassfish which uses java.util.logging
"org.slf4j" % "jul-to-slf4j" % slf4jVersion % Test,
"org.mockito" % "mockito-core" % "4.11.0" % Test,
"com.thesamet.scalapb" %% "scalapb-runtime" % scalaPBVersion % Test))
"com.thesamet.scalapb" %% "scalapb-runtime" % scalaPBVersion % Test)

lazy val testKitDependencies = Def.setting(Seq(
"org.apache.pekko" %% "pekko-stream-testkit" % pekkoVersion,
lazy val testKitDependencies = Seq(
"org.testcontainers" % "kafka" % testcontainersVersion % Provided,
"org.scalatest" %% "scalatest" % scalaTestVersion % Provided,
"junit" % "junit" % "4.13.2" % Provided))
"junit" % "junit" % "4.13.2" % Provided)

}
4 changes: 1 addition & 3 deletions project/ParadoxSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import sbtlicensereport.SbtLicenseReport.autoImportImpl.dumpLicenseReportAggrega
object ParadoxSettings {

val themeSettings = Seq(
// allow access to snapshots for pekko-sbt-paradox
resolvers += "Apache Nexus Snapshots".at("https://repository.apache.org/content/repositories/snapshots/"),
pekkoParadoxGithub := Some("https://github.com/apache/pekko-connectors-kafka"))

val propertiesSettings = Seq(
Expand All @@ -36,7 +34,7 @@ object ParadoxSettings {
"image.base_url" -> "images/",
"confluent.version" -> confluentAvroSerializerVersion,
"scalatest.version" -> scalaTestVersion,
"pekko.version" -> pekkoVersion,
"pekko.version" -> PekkoCoreDependency.version,
"extref.pekko.base_url" -> s"$pekkoDocs/pekko/$pekkoVersionForDocs/%s",
"scaladoc.org.apache.pekko.base_url" -> s"$pekkoAPI/pekko/$pekkoVersionForDocs/",
"javadoc.org.apache.pekko.base_url" -> s"$pekkoAPI/pekko/$pekkoVersionForDocs/",
Expand Down
1 change: 0 additions & 1 deletion project/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ object Versions {
val pekkoVersionForDocs = "current"
val pekkoConnectorsKafkaVersionForDocs = "current"
val pekkoManagementVersionForDocs = "current"
val pekkoVersion = PekkoCoreDependency.version

val kafkaVersion = "3.8.0"
val KafkaVersionForDocs = "37"
Expand Down

0 comments on commit ed43144

Please sign in to comment.