Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use sbt-pekko-build addPekkoModuleDependency #241

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
pjfanning marked this conversation as resolved.
Show resolved Hide resolved
"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)

}
2 changes: 0 additions & 2 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 Down
Loading