From 75eea26c78cd437116617eedc9bc1a144d163921 Mon Sep 17 00:00:00 2001 From: philippus Date: Mon, 17 Jun 2024 21:54:09 +0200 Subject: [PATCH 1/4] Format *.sbt and project/*.scala files --- build.sbt | 329 +++++++++------------- instrumentation/kamon-akka/build.sbt | 123 ++++---- instrumentation/kamon-cassandra/build.sbt | 10 +- instrumentation/kamon-executors/build.sbt | 37 ++- instrumentation/kamon-pekko/build.sbt | 31 +- instrumentation/kamon-play/build.sbt | 74 ++--- instrumentation/kamon-tapir/build.sbt | 2 +- project/Build.scala | 71 +++-- project/BundleKeys.scala | 2 +- 9 files changed, 331 insertions(+), 348 deletions(-) diff --git a/build.sbt b/build.sbt index 0af2d9bf9..ba9f40b5b 100644 --- a/build.sbt +++ b/build.sbt @@ -20,7 +20,11 @@ lazy val kamon = (project in file(".")) .aggregate(core, instrumentation, reporters, bundle, `bill-of-materials`) val coreProjects = Seq[ProjectReference]( - `kamon-core`, `kamon-status-page`, `kamon-testkit`, `kamon-core-tests`, `kamon-core-bench` + `kamon-core`, + `kamon-status-page`, + `kamon-testkit`, + `kamon-core-tests`, + `kamon-core-bench` ) lazy val core = (project in file("core")) @@ -29,20 +33,19 @@ lazy val core = (project in file("core")) .settings(crossScalaVersions := Nil) .aggregate(coreProjects: _*) - lazy val `kamon-core` = (project in file("core/kamon-core")) .enablePlugins(BuildInfoPlugin) .enablePlugins(AssemblyPlugin) .settings( buildInfoKeys := Seq[BuildInfoKey](version), buildInfoPackage := "kamon.status", - scalacOptions ++= { if(scalaBinaryVersion.value == "2.11") Seq("-Ydelambdafy:method") else Seq.empty }, + scalacOptions ++= { if (scalaBinaryVersion.value == "2.11") Seq("-Ydelambdafy:method") else Seq.empty }, assembly / assemblyShadeRules := Seq( - ShadeRule.rename("org.jctools.**" -> "kamon.lib.@0").inAll, - ShadeRule.rename("org.HdrHistogram.Base*" -> "@0").inAll, + ShadeRule.rename("org.jctools.**" -> "kamon.lib.@0").inAll, + ShadeRule.rename("org.HdrHistogram.Base*" -> "@0").inAll, ShadeRule.rename("org.HdrHistogram.HdrHistogramInternalState" -> "@0").inAll, - ShadeRule.rename("org.HdrHistogram.ZigZag" -> "@0").inAll, - ShadeRule.rename("org.HdrHistogram.*" -> "org.HdrHistogram.Shaded@1").inAll, + ShadeRule.rename("org.HdrHistogram.ZigZag" -> "@0").inAll, + ShadeRule.rename("org.HdrHistogram.*" -> "org.HdrHistogram.Shaded@1").inAll, ShadeRule.keep( "kamon.Kamon", "kamon.context.**", @@ -54,40 +57,37 @@ lazy val `kamon-core` = (project in file("core/kamon-core")) "kamon.util.**", "kamon.svm.**", "org.HdrHistogram.AtomicHistogram", - "org.jctools.queues.MpscArrayQueue", + "org.jctools.queues.MpscArrayQueue" ).inAll ), libraryDependencies ++= Seq( - "com.typesafe" % "config" % "1.4.3", - "org.slf4j" % "slf4j-api" % "1.7.36", - "org.hdrhistogram" % "HdrHistogram" % "2.1.9" % "provided,shaded", - "org.jctools" % "jctools-core" % "3.3.0" % "provided,shaded", - "com.oracle.substratevm" % "svm" % "19.2.1" % "provided" - ), + "com.typesafe" % "config" % "1.4.3", + "org.slf4j" % "slf4j-api" % "1.7.36", + "org.hdrhistogram" % "HdrHistogram" % "2.1.9" % "provided,shaded", + "org.jctools" % "jctools-core" % "3.3.0" % "provided,shaded", + "com.oracle.substratevm" % "svm" % "19.2.1" % "provided" + ) ) - lazy val `kamon-status-page` = (project in file("core/kamon-status-page")) .enablePlugins(AssemblyPlugin) .settings( assembly / assemblyShadeRules := Seq( - ShadeRule.rename("com.grack.nanojson.**" -> "kamon.lib.@0").inAll, - ShadeRule.rename("fi.iki.elonen.**" -> "kamon.lib.@0").inAll, + ShadeRule.rename("com.grack.nanojson.**" -> "kamon.lib.@0").inAll, + ShadeRule.rename("fi.iki.elonen.**" -> "kamon.lib.@0").inAll ), libraryDependencies ++= Seq( - "com.grack" % "nanojson" % "1.6" % "provided,shaded", - "org.nanohttpd" % "nanohttpd" % "2.3.1" % "provided,shaded" + "com.grack" % "nanojson" % "1.6" % "provided,shaded", + "org.nanohttpd" % "nanohttpd" % "2.3.1" % "provided,shaded" ) ).dependsOn(`kamon-core`) - lazy val `kamon-testkit` = (project in file("core/kamon-testkit")) .disablePlugins(AssemblyPlugin) .settings( libraryDependencies += scalatest % "provided,test" ).dependsOn(`kamon-core`) - lazy val `kamon-core-tests` = (project in file("core/kamon-core-tests")) .disablePlugins(AssemblyPlugin) .settings(noPublishing: _*) @@ -98,14 +98,12 @@ lazy val `kamon-core-tests` = (project in file("core/kamon-core-tests")) ) ).dependsOn(`kamon-testkit`) - lazy val `kamon-core-bench` = (project in file("core/kamon-core-bench")) .disablePlugins(AssemblyPlugin) .enablePlugins(JmhPlugin) .settings(noPublishing: _*) .dependsOn(`kamon-core`) - /** * Instrumentation Projects */ @@ -158,7 +156,6 @@ lazy val instrumentation = (project in file("instrumentation")) .settings(crossScalaVersions := Nil) .aggregate(instrumentationProjects: _*) - lazy val `kamon-instrumentation-common` = (project in file("instrumentation/kamon-instrumentation-common")) .disablePlugins(AssemblyPlugin) .enablePlugins(JavaAgent) @@ -172,7 +169,6 @@ lazy val `kamon-instrumentation-common` = (project in file("instrumentation/kamo ) ).dependsOn(`kamon-core`, `kamon-testkit` % "test") - lazy val `kamon-executors` = (project in file("instrumentation/kamon-executors")) .disablePlugins(AssemblyPlugin) .settings( @@ -180,7 +176,7 @@ lazy val `kamon-executors` = (project in file("instrumentation/kamon-executors") kanelaAgent % "provided", scalatest % "test", logbackClassic % "test", - "com.google.guava" % "guava" % "24.1-jre" % "test", + "com.google.guava" % "guava" % "24.1-jre" % "test" ) ).dependsOn(`kamon-core`, `kamon-instrumentation-common`, `kamon-testkit` % "test") @@ -191,11 +187,10 @@ lazy val `kamon-executors-bench` = (project in file("instrumentation/kamon-execu .settings( libraryDependencies ++= Seq( "com.google.guava" % "guava" % "33.0.0-jre", - kanelaAgent % "provided", + kanelaAgent % "provided" ) ).dependsOn(`kamon-core`, `kamon-instrumentation-common`) - lazy val `kamon-twitter-future` = (project in file("instrumentation/kamon-twitter-future")) .disablePlugins(AssemblyPlugin) .enablePlugins(JavaAgent) @@ -210,7 +205,6 @@ lazy val `kamon-twitter-future` = (project in file("instrumentation/kamon-twitte ) ).dependsOn(`kamon-core`, `kamon-executors`, `kamon-testkit` % "test") - lazy val `kamon-scalaz-future` = (project in file("instrumentation/kamon-scalaz-future")) .disablePlugins(AssemblyPlugin) .enablePlugins(JavaAgent) @@ -225,20 +219,18 @@ lazy val `kamon-scalaz-future` = (project in file("instrumentation/kamon-scalaz- ) ).dependsOn(`kamon-core`, `kamon-executors`, `kamon-testkit` % "test") - lazy val `kamon-scala-future` = (project in file("instrumentation/kamon-scala-future")) .disablePlugins(AssemblyPlugin) .enablePlugins(JavaAgent) .settings(instrumentationSettings) .settings( - libraryDependencies ++=Seq( + libraryDependencies ++= Seq( kanelaAgent % "provided", scalatest % "test", logbackClassic % "test" ) ).dependsOn(`kamon-core`, `kamon-executors`, `kamon-testkit` % "test") - lazy val `kamon-cats-io` = (project in file("instrumentation/kamon-cats-io")) .disablePlugins(AssemblyPlugin) .enablePlugins(JavaAgent) @@ -246,17 +238,15 @@ lazy val `kamon-cats-io` = (project in file("instrumentation/kamon-cats-io")) .settings( crossScalaVersions := Seq(`scala_2.11_version`, `scala_2.12_version`, `scala_2.13_version`), libraryDependencies ++= Seq( - kanelaAgent % "provided", - { - if(scalaBinaryVersion.value == "2.11") + kanelaAgent % "provided", { + if (scalaBinaryVersion.value == "2.11") "org.typelevel" %% "cats-effect" % "2.0.0" % "provided" else "org.typelevel" %% "cats-effect" % "2.1.2" % "provided" }, scalatest % "test", logbackClassic % "test" - ), - + ) ).dependsOn(`kamon-core`, `kamon-executors`, `kamon-testkit` % "test") lazy val `kamon-cats-io-3` = (project in file("instrumentation/kamon-cats-io-3")) @@ -270,8 +260,7 @@ lazy val `kamon-cats-io-3` = (project in file("instrumentation/kamon-cats-io-3") "org.typelevel" %% "cats-effect" % "3.3.14" % "provided", scalatest % "test", logbackClassic % "test" - ), - + ) ).dependsOn(`kamon-core`, `kamon-executors`, `kamon-testkit` % "test") lazy val `kamon-zio-2` = (project in file("instrumentation/kamon-zio-2")) @@ -285,11 +274,9 @@ lazy val `kamon-zio-2` = (project in file("instrumentation/kamon-zio-2")) "dev.zio" %% "zio" % "2.0.21" % "provided", scalatest % "test", logbackClassic % "test" - ), - + ) ).dependsOn(`kamon-core`, `kamon-executors`, `kamon-testkit` % "test") - lazy val `kamon-logback` = (project in file("instrumentation/kamon-logback")) .disablePlugins(AssemblyPlugin) .enablePlugins(JavaAgent) @@ -298,11 +285,10 @@ lazy val `kamon-logback` = (project in file("instrumentation/kamon-logback")) libraryDependencies ++= Seq( kanelaAgent % "provided", logbackClassic % "provided", - scalatest % "test", + scalatest % "test" ) ).dependsOn(`kamon-core`, `kamon-instrumentation-common`, `kamon-testkit` % "test") - def slickVersion(scalaVersion: String) = scalaVersion match { case "3" => "3.5.0-M5" case x => "3.3.2" @@ -315,37 +301,33 @@ lazy val `kamon-jdbc` = (project in file("instrumentation/kamon-jdbc")) libraryDependencies ++= Seq( jsqlparser, kanelaAgent % "provided", - "com.zaxxer" % "HikariCP" % "4.0.3" % "provided", - "org.mariadb.jdbc" % "mariadb-java-client" % "2.2.6" % "provided", - "com.typesafe.slick" %% "slick" % slickVersion(scalaBinaryVersion.value) % "provided", - "org.postgresql" % "postgresql" % "42.2.5" % "provided", - + "com.zaxxer" % "HikariCP" % "4.0.3" % "provided", + "org.mariadb.jdbc" % "mariadb-java-client" % "2.2.6" % "provided", + "com.typesafe.slick" %% "slick" % slickVersion(scalaBinaryVersion.value) % "provided", + "org.postgresql" % "postgresql" % "42.2.5" % "provided", scalatest % "test", logbackClassic % "test", - "com.typesafe.slick" %% "slick-hikaricp" % slickVersion(scalaBinaryVersion.value) % "test", - "com.h2database" % "h2" % "1.4.192" % "test", - "org.xerial" % "sqlite-jdbc" % "3.34.0" % "test", - "ch.vorburger.mariaDB4j" % "mariaDB4j" % "2.5.3" % "test" + "com.typesafe.slick" %% "slick-hikaricp" % slickVersion(scalaBinaryVersion.value) % "test", + "com.h2database" % "h2" % "1.4.192" % "test", + "org.xerial" % "sqlite-jdbc" % "3.34.0" % "test", + "ch.vorburger.mariaDB4j" % "mariaDB4j" % "2.5.3" % "test" ) ).dependsOn(`kamon-core`, `kamon-executors`, `kamon-testkit` % "test") - lazy val `kamon-kafka` = (project in file("instrumentation/kamon-kafka")) .disablePlugins(AssemblyPlugin) .enablePlugins(JavaAgent) .settings(instrumentationSettings) .settings( libraryDependencies ++= Seq( - kanelaAgent % "provided", - "org.apache.kafka" % "kafka-clients" % "3.4.0" % "provided", - - scalatest % "test", - logbackClassic % "test", - "org.testcontainers" % "kafka" % "1.17.6" % "test" + kanelaAgent % "provided", + "org.apache.kafka" % "kafka-clients" % "3.4.0" % "provided", + scalatest % "test", + logbackClassic % "test", + "org.testcontainers" % "kafka" % "1.17.6" % "test" ) ).dependsOn(`kamon-core`, `kamon-executors`, `kamon-testkit` % "test") - lazy val `kamon-mongo-legacy` = (project in file("instrumentation/kamon-mongo-legacy")) .disablePlugins(AssemblyPlugin) .enablePlugins(JavaAgent) @@ -354,17 +336,15 @@ lazy val `kamon-mongo-legacy` = (project in file("instrumentation/kamon-mongo-le crossScalaVersions := Seq(`scala_2.11_version`, `scala_2.12_version`, `scala_2.13_version`), libraryDependencies ++= Seq( kanelaAgent % "provided", - "org.mongodb" % "mongodb-driver-sync" % "3.11.0" % "provided", - "org.mongodb.scala" %% "mongo-scala-driver" % "2.7.0" % "provided", - "org.mongodb" % "mongodb-driver-reactivestreams" % "1.12.0" % "provided", - + "org.mongodb" % "mongodb-driver-sync" % "3.11.0" % "provided", + "org.mongodb.scala" %% "mongo-scala-driver" % "2.7.0" % "provided", + "org.mongodb" % "mongodb-driver-reactivestreams" % "1.12.0" % "provided", scalatest % "test", logbackClassic % "test", - "de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "2.2.0" % "test" + "de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "2.2.0" % "test" ) ).dependsOn(`kamon-core`, `kamon-instrumentation-common`, `kamon-testkit` % "test") - lazy val `kamon-mongo` = (project in file("instrumentation/kamon-mongo")) .disablePlugins(AssemblyPlugin) .enablePlugins(JavaAgent) @@ -373,13 +353,12 @@ lazy val `kamon-mongo` = (project in file("instrumentation/kamon-mongo")) crossScalaVersions := Seq(`scala_2.11_version`, `scala_2.12_version`, `scala_2.13_version`), libraryDependencies ++= Seq( kanelaAgent % "provided", - "org.mongodb" % "mongodb-driver-sync" % "4.2.3" % "provided", - "org.mongodb.scala" %% "mongo-scala-driver" % "4.2.3" % "provided", - "org.mongodb" % "mongodb-driver-reactivestreams" % "4.2.3" % "provided", - + "org.mongodb" % "mongodb-driver-sync" % "4.2.3" % "provided", + "org.mongodb.scala" %% "mongo-scala-driver" % "4.2.3" % "provided", + "org.mongodb" % "mongodb-driver-reactivestreams" % "4.2.3" % "provided", scalatest % "test", logbackClassic % "test", - "de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "2.2.0" % "test" + "de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "2.2.0" % "test" ) ).dependsOn(`kamon-core`, `kamon-instrumentation-common`, `kamon-testkit` % "test") @@ -419,7 +398,7 @@ lazy val `kamon-opensearch` = (project in file("instrumentation/kamon-opensearch "org.opensearch.client" % "opensearch-rest-high-level-client" % "1.3.14" % "provided", scalatest % "test", logbackClassic % "test", - "com.dimafeng" %% "testcontainers-scala" % "0.41.0" % "test", + "com.dimafeng" %% "testcontainers-scala" % "0.41.0" % "test" ) ).dependsOn(`kamon-core`, `kamon-instrumentation-common`, `kamon-testkit` % "test") @@ -433,16 +412,14 @@ lazy val `kamon-spring` = (project in file("instrumentation/kamon-spring")) kanelaAgent % "provided", "org.springframework.boot" % "spring-boot-starter-web" % "2.4.2" % "provided", "org.springframework.boot" % "spring-boot-starter-webflux" % "2.4.2" % "provided", - okHttp % "test", "com.h2database" % "h2" % "1.4.200" % "test", "org.springframework.boot" % "spring-boot-starter-data-jpa" % "2.4.2" % "test", scalatest % "test", - logbackClassic % "test", + logbackClassic % "test" ) ).dependsOn(`kamon-core`, `kamon-instrumentation-common`, `kamon-testkit` % "test") - lazy val `kamon-annotation-api` = (project in file("instrumentation/kamon-annotation-api")) .disablePlugins(AssemblyPlugin) .settings( @@ -452,29 +429,27 @@ lazy val `kamon-annotation-api` = (project in file("instrumentation/kamon-annota Compile / doc / javacOptions := Seq("-Xdoclint:none") ) - lazy val `kamon-annotation` = (project in file("instrumentation/kamon-annotation")) .enablePlugins(JavaAgent) .enablePlugins(AssemblyPlugin) .settings(instrumentationSettings: _*) .settings( assembly / assemblyShadeRules := Seq( - ShadeRule.rename("javax.el.**" -> "kamon.lib.@0").inAll, - ShadeRule.rename("com.sun.el.**" -> "kamon.lib.@0").inAll, - ShadeRule.rename("com.github.benmanes.**" -> "kamon.lib.@0").inAll, - ShadeRule.rename("com.google.errorprone.**" -> "kamon.lib.@0").inAll, - ShadeRule.rename("org.checkerframework.**" -> "kamon.lib.@0").inAll, + ShadeRule.rename("javax.el.**" -> "kamon.lib.@0").inAll, + ShadeRule.rename("com.sun.el.**" -> "kamon.lib.@0").inAll, + ShadeRule.rename("com.github.benmanes.**" -> "kamon.lib.@0").inAll, + ShadeRule.rename("com.google.errorprone.**" -> "kamon.lib.@0").inAll, + ShadeRule.rename("org.checkerframework.**" -> "kamon.lib.@0").inAll ), libraryDependencies ++= Seq( kanelaAgent % "provided", "com.github.ben-manes.caffeine" % "caffeine" % "2.8.5" % "provided,shaded", "org.glassfish" % "javax.el" % "3.0.1-b11" % "provided,shaded", scalatest % "test", - logbackClassic % "test", + logbackClassic % "test" ) ).dependsOn(`kamon-core`, `kamon-annotation-api`, `kamon-testkit` % "test") - lazy val `kamon-system-metrics` = (project in file("instrumentation/kamon-system-metrics")) .disablePlugins(AssemblyPlugin) .settings( @@ -485,7 +460,6 @@ lazy val `kamon-system-metrics` = (project in file("instrumentation/kamon-system ) ).dependsOn(`kamon-core`) - lazy val `kamon-akka` = (project in file("instrumentation/kamon-akka")) .enablePlugins(JavaAgent) .disablePlugins(AssemblyPlugin) @@ -495,7 +469,6 @@ lazy val `kamon-akka` = (project in file("instrumentation/kamon-akka")) `kamon-testkit` % "test,test-common,test-akka-2.5,test-akka-2.6" ) - def akkaHttpVersion(scalaVersion: String) = scalaVersion match { case "2.11" => "10.1.12" case "3" => "10.5.0" @@ -522,27 +495,28 @@ lazy val `kamon-akka-http` = (project in file("instrumentation/kamon-akka-http") .disablePlugins(AssemblyPlugin) .settings(instrumentationSettings) .settings(Seq( - Compile / unmanagedSourceDirectories ++= versionedScalaSourceDirectories((Compile / sourceDirectory).value, scalaBinaryVersion.value), + Compile / unmanagedSourceDirectories ++= versionedScalaSourceDirectories( + (Compile / sourceDirectory).value, + scalaBinaryVersion.value + ), resolvers += Resolver.bintrayRepo("hseeberger", "maven"), javaAgents += "org.mortbay.jetty.alpn" % "jetty-alpn-agent" % "2.0.10" % "test", libraryDependencies ++= Seq( kanelaAgent % "provided", - "com.typesafe.akka" %% "akka-http" % akkaHttpVersion(scalaBinaryVersion.value) % "provided", - "com.typesafe.akka" %% "akka-http2-support" % akkaHttpVersion(scalaBinaryVersion.value) % "provided", - "com.typesafe.akka" %% "akka-stream" % akkaStreamVersion(scalaBinaryVersion.value) % "provided", - + "com.typesafe.akka" %% "akka-http" % akkaHttpVersion(scalaBinaryVersion.value) % "provided", + "com.typesafe.akka" %% "akka-http2-support" % akkaHttpVersion(scalaBinaryVersion.value) % "provided", + "com.typesafe.akka" %% "akka-stream" % akkaStreamVersion(scalaBinaryVersion.value) % "provided", scalatest % "test", slf4jApi % "test", slf4jnop % "test", okHttp % "test", - "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion(scalaBinaryVersion.value) % "test", - "de.heikoseeberger" %% "akka-http-json4s" % "1.27.0" % "test" cross CrossVersion.for3Use2_13 intransitive(), - "org.json4s" %% "json4s-native" % "4.0.6" % "test", - ))) + "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion(scalaBinaryVersion.value) % "test", + "de.heikoseeberger" %% "akka-http-json4s" % "1.27.0" % "test" cross CrossVersion.for3Use2_13 intransitive (), + "org.json4s" %% "json4s-native" % "4.0.6" % "test" + ) + )) .dependsOn(`kamon-akka`, `kamon-testkit` % "test") - - lazy val `kamon-pekko` = (project in file("instrumentation/kamon-pekko")) .enablePlugins(JavaAgent) .disablePlugins(AssemblyPlugin) @@ -568,16 +542,16 @@ lazy val `kamon-pekko-http` = (project in file("instrumentation/kamon-pekko-http crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version), libraryDependencies ++= Seq( kanelaAgent % "provided", - "org.apache.pekko" %% "pekko-http" % pekkoHttpVersion % "provided", - "org.apache.pekko" %% "pekko-stream" % "1.0.1" % "provided", + "org.apache.pekko" %% "pekko-http" % pekkoHttpVersion % "provided", + "org.apache.pekko" %% "pekko-stream" % "1.0.1" % "provided", scalatest % "test", slf4jApi % "test", slf4jnop % "test", okHttp % "test", - "org.apache.pekko" %% "pekko-http-testkit" % pekkoHttpVersion % "test", + "org.apache.pekko" %% "pekko-http-testkit" % pekkoHttpVersion % "test", "com.github.pjfanning" %% "pekko-http-json4s" % "2.0.0" % "test", - "org.json4s" %% "json4s-native" % "4.0.6" % "test", - ), + "org.json4s" %% "json4s-native" % "4.0.6" % "test" + ) )).dependsOn(`kamon-pekko`, `kamon-testkit` % "test") lazy val `kamon-pekko-grpc` = (project in file("instrumentation/kamon-pekko-grpc")) @@ -589,19 +563,15 @@ lazy val `kamon-pekko-grpc` = (project in file("instrumentation/kamon-pekko-grpc crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version), libraryDependencies ++= Seq( kanelaAgent % "provided", - "org.apache.pekko" %% "pekko-http" % pekkoHttpVersion % "provided", "org.apache.pekko" %% "pekko-stream" % "1.0.1" % "provided", - "org.apache.pekko" %% "pekko-discovery"% "1.0.0" % "provided", - - "com.thesamet.scalapb" %% "scalapb-runtime" % "0.11.8" % "provided", - "org.apache.pekko" %% "pekko-grpc-runtime" % "1.0.0" % "provided", - "io.grpc" % "grpc-stub" % "1.43.2" % "provided", - - + "org.apache.pekko" %% "pekko-discovery" % "1.0.0" % "provided", + "com.thesamet.scalapb" %% "scalapb-runtime" % "0.11.8" % "provided", + "org.apache.pekko" %% "pekko-grpc-runtime" % "1.0.0" % "provided", + "io.grpc" % "grpc-stub" % "1.43.2" % "provided", scalatest % "test", slf4jApi % "test", - logbackClassic % "test", + logbackClassic % "test" ) )).dependsOn(`kamon-pekko-http`, `kamon-testkit` % "test") @@ -614,36 +584,34 @@ lazy val `kamon-akka-grpc` = (project in file("instrumentation/kamon-akka-grpc") crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version), libraryDependencies ++= Seq( kanelaAgent % "provided", - - "com.typesafe.akka" %% "akka-http" % akkaHttpVersion(scalaBinaryVersion.value) % "provided", - "com.typesafe.akka" %% "akka-http2-support" % akkaHttpVersion(scalaBinaryVersion.value) % "provided", - "com.typesafe.akka" %% "akka-stream" % akkaStreamVersion(scalaBinaryVersion.value) % "provided", - "com.typesafe.akka" %% "akka-discovery" % akkaStreamVersion(scalaBinaryVersion.value) % "provided", + "com.typesafe.akka" %% "akka-http" % akkaHttpVersion(scalaBinaryVersion.value) % "provided", + "com.typesafe.akka" %% "akka-http2-support" % akkaHttpVersion(scalaBinaryVersion.value) % "provided", + "com.typesafe.akka" %% "akka-stream" % akkaStreamVersion(scalaBinaryVersion.value) % "provided", + "com.typesafe.akka" %% "akka-discovery" % akkaStreamVersion(scalaBinaryVersion.value) % "provided", // gRPC-specific dependencies provided by the sbt-akka-grpc plugin. We - "com.thesamet.scalapb" %% "scalapb-runtime" % "0.11.8" % "provided", - "com.lightbend.akka.grpc" %% "akka-grpc-runtime" % akkaGrpcRuntimeVersion(scalaBinaryVersion.value) % "provided", - "io.grpc" % "grpc-stub" % "1.43.2" % "provided", - + "com.thesamet.scalapb" %% "scalapb-runtime" % "0.11.8" % "provided", + "com.lightbend.akka.grpc" %% "akka-grpc-runtime" % akkaGrpcRuntimeVersion(scalaBinaryVersion.value) % "provided", + "io.grpc" % "grpc-stub" % "1.43.2" % "provided", scalatest % "test", slf4jApi % "test", - logbackClassic % "test", - ), + logbackClassic % "test" + ) )).dependsOn(`kamon-akka-http`, `kamon-testkit` % "test") - lazy val `kamon-play` = (project in file("instrumentation/kamon-play")) .enablePlugins(JavaAgent) .disablePlugins(AssemblyPlugin) - .settings(instrumentationSettings, - crossScalaVersions := Seq(`scala_2.11_version`, `scala_2.12_version`, `scala_2.13_version`)) + .settings( + instrumentationSettings, + crossScalaVersions := Seq(`scala_2.11_version`, `scala_2.12_version`, `scala_2.13_version`) + ) .dependsOn( `kamon-akka` % "compile,test-common,test-play-2.8,test-play-2.7,test-play-2.6", `kamon-akka-http` % "compile,test-common,test-play-2.8,test-play-2.7,test-play-2.6", `kamon-testkit` % "test-common,test-play-2.8,test-play-2.7,test-play-2.6" ) - lazy val `kamon-okhttp` = (project in file("instrumentation/kamon-okhttp")) .disablePlugins(AssemblyPlugin) .enablePlugins(JavaAgent) @@ -651,12 +619,11 @@ lazy val `kamon-okhttp` = (project in file("instrumentation/kamon-okhttp")) .settings( libraryDependencies ++= Seq( kanelaAgent % "provided", - "com.squareup.okhttp3" % "okhttp" % "4.12.0" % "provided", - + "com.squareup.okhttp3" % "okhttp" % "4.12.0" % "provided", scalatest % "test", logbackClassic % "test", - "org.eclipse.jetty" % "jetty-server" % "9.4.25.v20191220" % "test", - "org.eclipse.jetty" % "jetty-servlet" % "9.4.25.v20191220" % "test", + "org.eclipse.jetty" % "jetty-server" % "9.4.25.v20191220" % "test", + "org.eclipse.jetty" % "jetty-servlet" % "9.4.25.v20191220" % "test" ) ).dependsOn(`kamon-core`, `kamon-executors`, `kamon-testkit` % "test") @@ -680,10 +647,14 @@ lazy val `kamon-tapir` = (project in file("instrumentation/kamon-tapir")) "com.softwaremill.sttp.tapir" %% "tapir-akka-http-server" % "0.20.2" % "test,test-legacy", "com.softwaremill.sttp.client3" %% "core" % "3.3.0-RC2" % "test,test-legacy", scalatest % "test,test-legacy", - logbackClassic % "test,test-legacy", + logbackClassic % "test,test-legacy" ) ) - .dependsOn(`kamon-core` % "compile,legacy", `kamon-akka-http` % "compile,legacy", `kamon-testkit` % "test,test-legacy") + .dependsOn( + `kamon-core` % "compile,legacy", + `kamon-akka-http` % "compile,legacy", + `kamon-testkit` % "test,test-legacy" + ) lazy val `kamon-redis` = (project in file("instrumentation/kamon-redis")) .disablePlugins(AssemblyPlugin) @@ -692,12 +663,11 @@ lazy val `kamon-redis` = (project in file("instrumentation/kamon-redis")) .settings( libraryDependencies ++= Seq( kanelaAgent % "provided", - "redis.clients" % "jedis" % "3.6.0" % "provided", - "io.lettuce" % "lettuce-core" % "6.1.2.RELEASE" % "provided", - + "redis.clients" % "jedis" % "3.6.0" % "provided", + "io.lettuce" % "lettuce-core" % "6.1.2.RELEASE" % "provided", scalatest % "test", logbackClassic % "test", - "org.testcontainers" % "testcontainers" % "1.15.3" % "test", + "org.testcontainers" % "testcontainers" % "1.15.3" % "test" ) :+ (if (scalaVersion.value.startsWith("2.11")) "com.github.etaty" %% "rediscala" % "1.9.0" % "provided" else "io.github.rediscala" %% "rediscala" % "1.13.0" % "provided") ).dependsOn(`kamon-core`, `kamon-instrumentation-common`, `kamon-testkit` % "test") @@ -710,20 +680,19 @@ lazy val `kamon-caffeine` = (project in file("instrumentation/kamon-caffeine")) libraryDependencies ++= Seq( kanelaAgent % "provided", "com.github.ben-manes.caffeine" % "caffeine" % "2.8.5" % "provided", - scalatest % "test", - logbackClassic % "test", + logbackClassic % "test" ) ).dependsOn(`kamon-core`, `kamon-instrumentation-common`, `kamon-testkit` % "test") - lazy val `kamon-lagom` = (project in file("instrumentation/kamon-lagom")) .disablePlugins(AssemblyPlugin) .settings( crossScalaVersions := Seq(`scala_2.11_version`, `scala_2.12_version`, `scala_2.13_version`), libraryDependencies ++= { CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2, scalaMajor)) if scalaMajor == 11 => providedScope("com.lightbend.lagom" %% "lagom-server" % "1.4.13") + case Some((2, scalaMajor)) if scalaMajor == 11 => + providedScope("com.lightbend.lagom" %% "lagom-server" % "1.4.13") case _ => providedScope("com.lightbend.lagom" %% "lagom-server" % "1.6.7") } } @@ -741,7 +710,7 @@ lazy val `kamon-finagle` = (project in file("instrumentation/kamon-finagle")) "com.twitter" %% "finagle-http" % "21.12.0" % "provided", "com.twitter" %% "bijection-util" % "0.9.7" % "test", scalatest % "test", - logbackClassic % "test", + logbackClassic % "test" ) ).dependsOn(`kamon-core`, `kamon-instrumentation-common`, `kamon-testkit` % "test") @@ -755,7 +724,6 @@ lazy val `kamon-aws-sdk` = (project in file("instrumentation/kamon-aws-sdk")) "com.amazonaws" % "aws-java-sdk-lambda" % "1.12.225" % "provided", "software.amazon.awssdk" % "dynamodb" % "2.17.191" % "provided", "software.amazon.awssdk" % "sqs" % "2.17.191" % "provided", - scalatest % "test", logbackClassic % "test", "org.testcontainers" % "dynalite" % "1.17.1" % "test" @@ -772,7 +740,6 @@ lazy val `kamon-alpakka-kafka` = (project in file("instrumentation/kamon-alpakka kanelaAgent % "provided", "com.typesafe.akka" %% "akka-stream-kafka" % "2.1.1" % "provided", "com.typesafe.akka" %% "akka-stream" % "2.6.19" % "provided", - scalatest % "test", logbackClassic % "test" ) @@ -791,13 +758,14 @@ lazy val `kamon-http4s-1_0` = (project in file("instrumentation/kamon-http4s-1.0 "org.http4s" %% "http4s-blaze-client" % "1.0.0-M38" % Test, "org.http4s" %% "http4s-blaze-server" % "1.0.0-M38" % Test, "org.http4s" %% "http4s-dsl" % "1.0.0-M38" % Test, - scalatest % Test, + scalatest % Test ) ) .dependsOn( - `kamon-core`, - `kamon-instrumentation-common`, - `kamon-testkit` % Test) + `kamon-core`, + `kamon-instrumentation-common`, + `kamon-testkit` % Test + ) lazy val `kamon-http4s-0_23` = (project in file("instrumentation/kamon-http4s-0.23")) .disablePlugins(AssemblyPlugin) @@ -805,7 +773,7 @@ lazy val `kamon-http4s-0_23` = (project in file("instrumentation/kamon-http4s-0. .settings(instrumentationSettings) .settings( name := "kamon-http4s-0.23", - scalacOptions ++= { if(scalaBinaryVersion.value == "2.12") Seq("-Ypartial-unification") else Seq.empty }, + scalacOptions ++= { if (scalaBinaryVersion.value == "2.12") Seq("-Ypartial-unification") else Seq.empty }, crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, `scala_3_version`), libraryDependencies ++= Seq( "org.http4s" %% "http4s-client" % "0.23.19" % Provided, @@ -831,7 +799,6 @@ lazy val `kamon-apache-httpclient` = (project in file("instrumentation/kamon-apa kanelaAgent % "provided", "org.apache.httpcomponents" % "httpclient" % "4.0" % "provided", slf4jApi % "provided", - scalatest % "test", logbackClassic % "test", "org.mock-server" % "mockserver-client-java" % "5.13.2" % "test", @@ -849,14 +816,13 @@ lazy val `kamon-apache-cxf` = (project in file("instrumentation/kamon-apache-cxf kanelaAgent % "provided", "org.apache.cxf" % "cxf-rt-frontend-simple" % "3.3.6" % "provided", slf4jApi % "provided", - scalatest % "test", logbackClassic % "test", "org.mock-server" % "mockserver-client-java" % "5.13.2" % "test", "com.dimafeng" %% "testcontainers-scala" % "0.41.0" % "test", "com.dimafeng" %% "testcontainers-scala-mockserver" % "0.41.0" % "test", "org.apache.cxf" % "cxf-rt-frontend-jaxws" % "3.3.6" % "test", - "org.apache.cxf" % "cxf-rt-transports-http" % "3.3.6" % "test", + "org.apache.cxf" % "cxf-rt-transports-http" % "3.3.6" % "test" ) ).dependsOn(`kamon-core`, `kamon-executors`, `kamon-testkit` % "test") @@ -873,7 +839,7 @@ val reportersProjects = Seq[ProjectReference]( `kamon-opentelemetry`, `kamon-prometheus`, `kamon-statsd`, - `kamon-zipkin`, + `kamon-zipkin` ) lazy val reporters = (project in file("reporters")) @@ -882,22 +848,20 @@ lazy val reporters = (project in file("reporters")) .settings(crossScalaVersions := Nil) .aggregate(reportersProjects: _*) - lazy val `kamon-datadog` = (project in file("reporters/kamon-datadog")) .enablePlugins(AssemblyPlugin) .settings( assembly / assemblyMergeStrategy := { - case PathList("META-INF", xs @ _*) => MergeStrategy.discard - case _ => MergeStrategy.first + case PathList("META-INF", xs @ _*) => MergeStrategy.discard + case _ => MergeStrategy.first }, assembly / assemblyShadeRules := Seq( - ShadeRule.rename("okhttp3.**" -> "kamon.lib.@1").inAll, - ShadeRule.rename("okio.**" -> "kamon.lib.@1").inAll + ShadeRule.rename("okhttp3.**" -> "kamon.lib.@1").inAll, + ShadeRule.rename("okio.**" -> "kamon.lib.@1").inAll ), libraryDependencies ++= Seq( okHttp % "shaded,provided", "com.grack" % "nanojson" % "1.8", - ("com.typesafe.play" %% "play-json" % "2.7.4" % "test").cross(CrossVersion.for3Use2_13), scalatest % "test", slf4jApi % "test", @@ -906,46 +870,41 @@ lazy val `kamon-datadog` = (project in file("reporters/kamon-datadog")) ) ).dependsOn(`kamon-core`, `kamon-testkit` % "test") - lazy val `kamon-apm-reporter` = (project in file("reporters/kamon-apm-reporter")) .enablePlugins(AssemblyPlugin) .settings( assembly / test := {}, assembly / assemblyMergeStrategy := { - case PathList("META-INF", xs @ _*) => MergeStrategy.discard - case _ => MergeStrategy.first + case PathList("META-INF", xs @ _*) => MergeStrategy.discard + case _ => MergeStrategy.first }, assembly / assemblyShadeRules := Seq( - ShadeRule.rename("fastparse.**" -> "kamon.apm.shaded.@0").inAll - ,ShadeRule.rename("fansi.**" -> "kamon.apm.shaded.@0").inAll - ,ShadeRule.rename("sourcecode.**" -> "kamon.apm.shaded.@0").inAll - ,ShadeRule.rename("com.google.protobuf.**" -> "kamon.apm.shaded.@0").inAll - ,ShadeRule.rename("google.protobuf.**" -> "kamon.apm.shaded.@0").inAll - ,ShadeRule.rename("okhttp3.**" -> "kamon.apm.shaded.@0").inAll - ,ShadeRule.rename("okio.**" -> "kamon.apm.shaded.@0").inAll + ShadeRule.rename("fastparse.**" -> "kamon.apm.shaded.@0").inAll, + ShadeRule.rename("fansi.**" -> "kamon.apm.shaded.@0").inAll, + ShadeRule.rename("sourcecode.**" -> "kamon.apm.shaded.@0").inAll, + ShadeRule.rename("com.google.protobuf.**" -> "kamon.apm.shaded.@0").inAll, + ShadeRule.rename("google.protobuf.**" -> "kamon.apm.shaded.@0").inAll, + ShadeRule.rename("okhttp3.**" -> "kamon.apm.shaded.@0").inAll, + ShadeRule.rename("okio.**" -> "kamon.apm.shaded.@0").inAll ), - libraryDependencies ++= Seq( scalatest % "test", okHttp % "provided,shaded", - "com.google.protobuf" % "protobuf-java" % "3.21.7" % "provided,shaded", - - "ch.qos.logback" % "logback-classic" % "1.2.3" % "test", - "org.scalatest" %% "scalatest" % "3.2.9" % "test", - ("com.typesafe.akka" %% "akka-http" % "10.1.8" % "test").cross(CrossVersion.for3Use2_13), - ("com.typesafe.akka" %% "akka-stream" % "2.5.23" % "test").cross(CrossVersion.for3Use2_13), - ("com.typesafe.akka" %% "akka-testkit" % "2.5.23" % "test").cross(CrossVersion.for3Use2_13) + "com.google.protobuf" % "protobuf-java" % "3.21.7" % "provided,shaded", + "ch.qos.logback" % "logback-classic" % "1.2.3" % "test", + "org.scalatest" %% "scalatest" % "3.2.9" % "test", + ("com.typesafe.akka" %% "akka-http" % "10.1.8" % "test").cross(CrossVersion.for3Use2_13), + ("com.typesafe.akka" %% "akka-stream" % "2.5.23" % "test").cross(CrossVersion.for3Use2_13), + ("com.typesafe.akka" %% "akka-testkit" % "2.5.23" % "test").cross(CrossVersion.for3Use2_13) ) ).dependsOn(`kamon-core`, `kamon-testkit` % "test") - lazy val `kamon-statsd` = (project in file("reporters/kamon-statsd")) .disablePlugins(AssemblyPlugin) .settings( - libraryDependencies += scalatest % Test, + libraryDependencies += scalatest % Test ).dependsOn(`kamon-core`) - lazy val `kamon-zipkin` = (project in file("reporters/kamon-zipkin")) .disablePlugins(AssemblyPlugin) .settings( @@ -956,7 +915,6 @@ lazy val `kamon-zipkin` = (project in file("reporters/kamon-zipkin")) ) ).dependsOn(`kamon-core`) - lazy val `kamon-jaeger` = (project in file("reporters/kamon-jaeger")) .disablePlugins(AssemblyPlugin) .settings( @@ -966,7 +924,6 @@ lazy val `kamon-jaeger` = (project in file("reporters/kamon-jaeger")) ) ).dependsOn(`kamon-core`) - lazy val `kamon-influxdb` = (project in file("reporters/kamon-influxdb")) .disablePlugins(AssemblyPlugin) .settings( @@ -977,7 +934,6 @@ lazy val `kamon-influxdb` = (project in file("reporters/kamon-influxdb")) ) ).dependsOn(`kamon-core`, `kamon-testkit` % "test") - lazy val `kamon-graphite` = (project in file("reporters/kamon-graphite")) .disablePlugins(AssemblyPlugin) .settings( @@ -987,7 +943,6 @@ lazy val `kamon-graphite` = (project in file("reporters/kamon-graphite")) ) ).dependsOn(`kamon-core`, `kamon-testkit` % "test") - lazy val `kamon-newrelic` = (project in file("reporters/kamon-newrelic")) .disablePlugins(AssemblyPlugin) .settings( @@ -1006,7 +961,6 @@ lazy val `kamon-opentelemetry` = (project in file("reporters/kamon-opentelemetry "io.opentelemetry" % "opentelemetry-exporter-otlp" % "1.35.0", // Compile-time dependency required in scala 3 "com.google.auto.value" % "auto-value-annotations" % "1.9" % "compile", - scalatest % "test", logbackClassic % "test" ) @@ -1022,7 +976,6 @@ lazy val `kamon-prometheus` = (project in file("reporters/kamon-prometheus")) ) ).dependsOn(`kamon-core`, `kamon-testkit` % "test") - /** * Bundle Projects */ @@ -1089,7 +1042,6 @@ lazy val `kamon-runtime-attacher` = (project in file("bundle/kamon-runtime-attac ) ) - /** * Add a reference here to all the project dependencies that can be built * for Scala 2.11, 2.12, and 2.13. @@ -1233,14 +1185,13 @@ lazy val `kamon-bundle_2_11` = (project in file("bundle/kamon-bundle_2.11")) scalaVersion := `scala_2.11_version`, crossScalaVersions := Seq( `scala_2.11_version` - ), + ) ) .dependsOn( `kamon-core`, `kamon-bundle-dependencies-all` % "shaded" ) - lazy val `bill-of-materials` = (project in file("bill-of-materials")) .enablePlugins(BillOfMaterialsPlugin) .settings(ideSkipProject: _*) @@ -1248,5 +1199,5 @@ lazy val `bill-of-materials` = (project in file("bill-of-materials")) name := "kamon-bom", crossVersion := CrossVersion.disabled, bomIncludeProjects := coreProjects ++ instrumentationProjects ++ reportersProjects, - pomExtra := pomExtra.value :+ bomDependenciesListing.value, + pomExtra := pomExtra.value :+ bomDependenciesListing.value ) diff --git a/instrumentation/kamon-akka/build.sbt b/instrumentation/kamon-akka/build.sbt index dadb10f94..b29ec8c84 100644 --- a/instrumentation/kamon-akka/build.sbt +++ b/instrumentation/kamon-akka/build.sbt @@ -15,9 +15,9 @@ lazy val `Compile-Akka-2.6` = config("akka-2.6") /** * Test Configurations */ -lazy val TestCommon = config("test-common") extend(Common) -lazy val `Test-Akka-2.5` = config("test-akka-2.5") extend(`Compile-Akka-2.5`) -lazy val `Test-Akka-2.6` = config("test-akka-2.6") extend(`Compile-Akka-2.6`) +lazy val TestCommon = config("test-common") extend (Common) +lazy val `Test-Akka-2.5` = config("test-akka-2.5") extend (`Compile-Akka-2.5`) +lazy val `Test-Akka-2.6` = config("test-akka-2.6") extend (`Compile-Akka-2.6`) configs( Common, @@ -34,69 +34,76 @@ inConfig(Common)(Defaults.compileSettings ++ Seq( crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version) )) -libraryDependencies ++= { if(scalaBinaryVersion.value == "2.11") Seq.empty else Seq( - kanelaAgent % Common, - scalatest % TestCommon, - logbackClassic % TestCommon, - "com.typesafe.akka" %% "akka-actor" % `Akka-2.6-version` % Common, - "com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % Common, - "com.typesafe.akka" %% "akka-slf4j" % `Akka-2.6-version` % Common, - "com.typesafe.akka" %% "akka-remote" % `Akka-2.6-version` % Common, - "com.typesafe.akka" %% "akka-cluster" % `Akka-2.6-version` % Common, - "com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.6-version` % Common, - "com.typesafe.akka" %% "akka-protobuf" % `Akka-2.6-version` % Common, - "com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % TestCommon -)} - +libraryDependencies ++= { + if (scalaBinaryVersion.value == "2.11") Seq.empty + else Seq( + kanelaAgent % Common, + scalatest % TestCommon, + logbackClassic % TestCommon, + "com.typesafe.akka" %% "akka-actor" % `Akka-2.6-version` % Common, + "com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % Common, + "com.typesafe.akka" %% "akka-slf4j" % `Akka-2.6-version` % Common, + "com.typesafe.akka" %% "akka-remote" % `Akka-2.6-version` % Common, + "com.typesafe.akka" %% "akka-cluster" % `Akka-2.6-version` % Common, + "com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.6-version` % Common, + "com.typesafe.akka" %% "akka-protobuf" % `Akka-2.6-version` % Common, + "com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % TestCommon + ) +} inConfig(`Compile-Akka-2.6`)(Defaults.compileSettings ++ Seq( crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version), sources := joinSources(Common, `Compile-Akka-2.6`).value )) -libraryDependencies ++= { if(scalaBinaryVersion.value == "2.11") Seq.empty else Seq( - kanelaAgent % `Compile-Akka-2.6`, - scalatest % `Test-Akka-2.6`, - logbackClassic % `Test-Akka-2.6`, - "com.typesafe.akka" %% "akka-actor" % `Akka-2.6-version` % `Compile-Akka-2.6`, - "com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % `Compile-Akka-2.6`, - "com.typesafe.akka" %% "akka-slf4j" % `Akka-2.6-version` % `Compile-Akka-2.6`, - "com.typesafe.akka" %% "akka-remote" % `Akka-2.6-version` % `Compile-Akka-2.6`, - "com.typesafe.akka" %% "akka-cluster" % `Akka-2.6-version` % `Compile-Akka-2.6`, - "com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.6-version` % `Compile-Akka-2.6`, - "com.typesafe.akka" %% "akka-protobuf" % `Akka-2.6-version` % `Compile-Akka-2.6`, - "com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % `Test-Akka-2.6` -)} - +libraryDependencies ++= { + if (scalaBinaryVersion.value == "2.11") Seq.empty + else Seq( + kanelaAgent % `Compile-Akka-2.6`, + scalatest % `Test-Akka-2.6`, + logbackClassic % `Test-Akka-2.6`, + "com.typesafe.akka" %% "akka-actor" % `Akka-2.6-version` % `Compile-Akka-2.6`, + "com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % `Compile-Akka-2.6`, + "com.typesafe.akka" %% "akka-slf4j" % `Akka-2.6-version` % `Compile-Akka-2.6`, + "com.typesafe.akka" %% "akka-remote" % `Akka-2.6-version` % `Compile-Akka-2.6`, + "com.typesafe.akka" %% "akka-cluster" % `Akka-2.6-version` % `Compile-Akka-2.6`, + "com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.6-version` % `Compile-Akka-2.6`, + "com.typesafe.akka" %% "akka-protobuf" % `Akka-2.6-version` % `Compile-Akka-2.6`, + "com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % `Test-Akka-2.6` + ) +} inConfig(`Compile-Akka-2.5`)(Defaults.compileSettings ++ Seq( sources := joinSources(Common, `Compile-Akka-2.5`).value )) -libraryDependencies ++= {if (scalaVersion.value startsWith "3") Seq.empty else Seq( - kanelaAgent % `Compile-Akka-2.5`, - scalatest % `Test-Akka-2.5`, - logbackClassic % `Test-Akka-2.5`, - "com.typesafe.akka" %% "akka-actor" % `Akka-2.5-version` % `Compile-Akka-2.5`, - "com.typesafe.akka" %% "akka-testkit" % `Akka-2.5-version` % `Compile-Akka-2.5`, - "com.typesafe.akka" %% "akka-slf4j" % `Akka-2.5-version` % `Compile-Akka-2.5`, - "com.typesafe.akka" %% "akka-remote" % `Akka-2.5-version` % `Compile-Akka-2.5`, - "com.typesafe.akka" %% "akka-cluster" % `Akka-2.5-version` % `Compile-Akka-2.5`, - "com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.5-version` % `Compile-Akka-2.5`, - "com.typesafe.akka" %% "akka-protobuf" % `Akka-2.5-version` % `Compile-Akka-2.5`, - "com.typesafe.akka" %% "akka-testkit" % `Akka-2.5-version` % `Test-Akka-2.5` -)} +libraryDependencies ++= { + if (scalaVersion.value startsWith "3") Seq.empty + else Seq( + kanelaAgent % `Compile-Akka-2.5`, + scalatest % `Test-Akka-2.5`, + logbackClassic % `Test-Akka-2.5`, + "com.typesafe.akka" %% "akka-actor" % `Akka-2.5-version` % `Compile-Akka-2.5`, + "com.typesafe.akka" %% "akka-testkit" % `Akka-2.5-version` % `Compile-Akka-2.5`, + "com.typesafe.akka" %% "akka-slf4j" % `Akka-2.5-version` % `Compile-Akka-2.5`, + "com.typesafe.akka" %% "akka-remote" % `Akka-2.5-version` % `Compile-Akka-2.5`, + "com.typesafe.akka" %% "akka-cluster" % `Akka-2.5-version` % `Compile-Akka-2.5`, + "com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.5-version` % `Compile-Akka-2.5`, + "com.typesafe.akka" %% "akka-protobuf" % `Akka-2.5-version` % `Compile-Akka-2.5`, + "com.typesafe.akka" %% "akka-testkit" % `Akka-2.5-version` % `Test-Akka-2.5` + ) +} // Ensure that the packaged artifact contains the instrumentation for all Akka versions. Compile / packageBin / mappings := Def.taskDyn { - if(scalaBinaryVersion.value == "2.11") { + if (scalaBinaryVersion.value == "2.11") { Def.task { joinProducts((`Compile-Akka-2.5` / products).value) ++ joinProducts((Common / unmanagedResourceDirectories).value) } } else if (scalaVersion.value startsWith "3") { Def.task { - joinProducts((`Compile-Akka-2.6` / products).value) ++ + joinProducts((`Compile-Akka-2.6` / products).value) ++ joinProducts((Common / unmanagedResourceDirectories).value) } } else { @@ -104,21 +111,21 @@ Compile / packageBin / mappings := Def.taskDyn { joinProducts( (`Compile-Akka-2.5` / products).value ++ (`Compile-Akka-2.6` / products).value - ) ++ joinProducts((Common / unmanagedResourceDirectories).value) + ) ++ joinProducts((Common / unmanagedResourceDirectories).value) } } }.value // Ensure that the packaged sources contains the instrumentation for all Akka versions. Compile / packageSrc / mappings := Def.taskDyn { - if(scalaBinaryVersion.value == "2.11") { + if (scalaBinaryVersion.value == "2.11") { Def.task { (`Compile-Akka-2.5` / packageSrc / mappings).value ++ (Common / packageSrc / mappings).value - } + } } else if (scalaVersion.value startsWith "3") { Def.task { - (`Compile-Akka-2.6` / packageSrc / mappings).value ++ + (`Compile-Akka-2.6` / packageSrc / mappings).value ++ (Common / packageSrc / mappings).value } } else { @@ -128,19 +135,19 @@ Compile / packageSrc / mappings := Def.taskDyn { (Common / packageSrc / mappings).value } } - }.value +}.value // Compile will return the compile analysis for the Common configuration but will run on all Akka configurations. Compile / compile := Def.taskDyn { - if(scalaBinaryVersion.value == "2.11") { + if (scalaBinaryVersion.value == "2.11") { Def.task { (`Compile-Akka-2.5` / compile).value } - } else if (scalaVersion.value startsWith "3"){ + } else if (scalaVersion.value startsWith "3") { Def.task { (`Compile-Akka-2.6` / compile).value - } + } } else { Def.task { (`Compile-Akka-2.5` / compile).value @@ -151,7 +158,6 @@ Compile / compile := Def.taskDyn { exportJars := true - /** * Test-related settings */ @@ -181,7 +187,7 @@ inConfig(`Test-Akka-2.6`)(Defaults.testSettings ++ instrumentationSettings ++ ba )) Test / test := Def.taskDyn { - if(scalaBinaryVersion.value == "2.11") { + if (scalaBinaryVersion.value == "2.11") { Def.task { (`Test-Akka-2.5` / test).value } @@ -189,11 +195,10 @@ Test / test := Def.taskDyn { Def.task { (`Test-Akka-2.6` / test).value } - } - else { + } else { Def.task { (`Test-Akka-2.5` / test).value (`Test-Akka-2.6` / test).value } } -}.value \ No newline at end of file +}.value diff --git a/instrumentation/kamon-cassandra/build.sbt b/instrumentation/kamon-cassandra/build.sbt index c40371d9a..be2c08a3a 100644 --- a/instrumentation/kamon-cassandra/build.sbt +++ b/instrumentation/kamon-cassandra/build.sbt @@ -1,5 +1,5 @@ -lazy val Cassandra3xTest = config("testCas3") extend(Test) -lazy val Cassandra4xTest = config("testCas4") extend(Test) +lazy val Cassandra3xTest = config("testCas3") extend (Test) +lazy val Cassandra4xTest = config("testCas4") extend (Test) val cassandra3xDriverVersion = "3.10.0" val cassandra4xDriverVersion = "4.10.0" @@ -16,15 +16,15 @@ libraryDependencies ++= Seq( ) libraryDependencies ++= Seq( - "com.datastax.oss" % "java-driver-core" % cassandra4xDriverVersion % "provided,testCas4", - "com.datastax.oss" % "java-driver-query-builder" % cassandra4xDriverVersion % "provided,testCas4" + "com.datastax.oss" % "java-driver-core" % cassandra4xDriverVersion % "provided,testCas4", + "com.datastax.oss" % "java-driver-query-builder" % cassandra4xDriverVersion % "provided,testCas4" ) configs(Cassandra3xTest, Cassandra4xTest) inConfig(Cassandra3xTest)(Defaults.testSettings) inConfig(Cassandra4xTest)(Defaults.testSettings) -Test / test := { +Test / test := { (Cassandra3xTest / test).value (Cassandra4xTest / test).value } diff --git a/instrumentation/kamon-executors/build.sbt b/instrumentation/kamon-executors/build.sbt index 458466ecf..b29e9cf4f 100644 --- a/instrumentation/kamon-executors/build.sbt +++ b/instrumentation/kamon-executors/build.sbt @@ -3,21 +3,30 @@ import sbt.Tests.{Group, SubProcess} Test / testGrouping := groupByExperimentalExecutorTests((Test / definedTests).value, kanelaAgentJar.value) def groupByExperimentalExecutorTests(tests: Seq[TestDefinition], kanelaJar: File): Seq[Group] = { - val (stable, experimental) = tests.partition(t => t.name != "kamon.instrumentation.executor.CaptureContextOnSubmitInstrumentationSpec") + val (stable, experimental) = + tests.partition(t => t.name != "kamon.instrumentation.executor.CaptureContextOnSubmitInstrumentationSpec") - val stableGroup = Group("stableTests", stable, SubProcess( - ForkOptions().withRunJVMOptions(Vector( - "-javaagent:" + kanelaJar.toString - )) - )) + val stableGroup = Group( + "stableTests", + stable, + SubProcess( + ForkOptions().withRunJVMOptions(Vector( + "-javaagent:" + kanelaJar.toString + )) + ) + ) - val experimentalGroup = Group("experimentalTests", experimental, SubProcess( - ForkOptions().withRunJVMOptions(Vector( - "-javaagent:" + kanelaJar.toString, - "-Dkanela.modules.executor-service.enabled=false", - "-Dkanela.modules.executor-service-capture-on-submit.enabled=true" - )) - )) + val experimentalGroup = Group( + "experimentalTests", + experimental, + SubProcess( + ForkOptions().withRunJVMOptions(Vector( + "-javaagent:" + kanelaJar.toString, + "-Dkanela.modules.executor-service.enabled=false", + "-Dkanela.modules.executor-service-capture-on-submit.enabled=true" + )) + ) + ) Seq(stableGroup, experimentalGroup) -} \ No newline at end of file +} diff --git a/instrumentation/kamon-pekko/build.sbt b/instrumentation/kamon-pekko/build.sbt index 5596992a1..4a0c78a63 100644 --- a/instrumentation/kamon-pekko/build.sbt +++ b/instrumentation/kamon-pekko/build.sbt @@ -5,19 +5,22 @@ inConfig(Compile)(Defaults.compileSettings ++ Seq( )) val pekkoVersion = "1.0.1" -libraryDependencies ++= { if(scalaBinaryVersion.value == "2.11") Seq.empty else Seq( - kanelaAgent % "provided", - scalatest % Test, - logbackClassic % Test, - "org.apache.pekko" %% "pekko-actor" % pekkoVersion % "provided,test", - "org.apache.pekko" %% "pekko-testkit" % pekkoVersion % "provided,test", - "org.apache.pekko" %% "pekko-slf4j" % pekkoVersion % "provided,test", - "org.apache.pekko" %% "pekko-remote" % pekkoVersion % "provided,test", - "org.apache.pekko" %% "pekko-cluster" % pekkoVersion % "provided,test", - "org.apache.pekko" %% "pekko-cluster-sharding" % pekkoVersion % "provided,test", - "org.apache.pekko" %% "pekko-protobuf" % pekkoVersion % "provided,test", - "org.apache.pekko" %% "pekko-testkit" % pekkoVersion % Test -)} +libraryDependencies ++= { + if (scalaBinaryVersion.value == "2.11") Seq.empty + else Seq( + kanelaAgent % "provided", + scalatest % Test, + logbackClassic % Test, + "org.apache.pekko" %% "pekko-actor" % pekkoVersion % "provided,test", + "org.apache.pekko" %% "pekko-testkit" % pekkoVersion % "provided,test", + "org.apache.pekko" %% "pekko-slf4j" % pekkoVersion % "provided,test", + "org.apache.pekko" %% "pekko-remote" % pekkoVersion % "provided,test", + "org.apache.pekko" %% "pekko-cluster" % pekkoVersion % "provided,test", + "org.apache.pekko" %% "pekko-cluster-sharding" % pekkoVersion % "provided,test", + "org.apache.pekko" %% "pekko-protobuf" % pekkoVersion % "provided,test", + "org.apache.pekko" %% "pekko-testkit" % pekkoVersion % Test + ) +} exportJars := true @@ -33,5 +36,5 @@ lazy val baseTestSettings = Seq( ) inConfig(Test)(Defaults.testSettings ++ instrumentationSettings ++ baseTestSettings ++ Seq( - crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version), + crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version) )) diff --git a/instrumentation/kamon-play/build.sbt b/instrumentation/kamon-play/build.sbt index f834f7151..b19f7914a 100644 --- a/instrumentation/kamon-play/build.sbt +++ b/instrumentation/kamon-play/build.sbt @@ -7,7 +7,7 @@ val `Play-2.8-version` = "2.8.2" /** * Test Configurations */ -lazy val TestCommon = config("test-common") extend(Compile) +lazy val TestCommon = config("test-common") extend (Compile) lazy val `Test-Play-2.6` = config("test-play-2.6") lazy val `Test-Play-2.7` = config("test-play-2.7") lazy val `Test-Play-2.8` = config("test-play-2.8") @@ -21,35 +21,40 @@ configs( libraryDependencies ++= Seq( kanelaAgent % "provided", - "com.typesafe.play" %% "play" % `Play-2.7-version` % "provided,test-common,test-play-2.7", - "com.typesafe.play" %% "play-netty-server" % `Play-2.7-version` % "provided,test-common,test-play-2.7", - "com.typesafe.play" %% "play-akka-http-server" % `Play-2.7-version` % "provided,test-common,test-play-2.7", - "com.typesafe.play" %% "play-ws" % `Play-2.7-version` % "provided,test-common,test-play-2.7", - "com.typesafe.play" %% "play-test" % `Play-2.7-version` % "provided,test-common,test-play-2.7", - "com.typesafe.play" %% "play-logback" % `Play-2.7-version` % "test-common,test-play-2.7", - + "com.typesafe.play" %% "play" % `Play-2.7-version` % "provided,test-common,test-play-2.7", + "com.typesafe.play" %% "play-netty-server" % `Play-2.7-version` % "provided,test-common,test-play-2.7", + "com.typesafe.play" %% "play-akka-http-server" % `Play-2.7-version` % "provided,test-common,test-play-2.7", + "com.typesafe.play" %% "play-ws" % `Play-2.7-version` % "provided,test-common,test-play-2.7", + "com.typesafe.play" %% "play-test" % `Play-2.7-version` % "provided,test-common,test-play-2.7", + "com.typesafe.play" %% "play-logback" % `Play-2.7-version` % "test-common,test-play-2.7", scalatest % "test-common,test-play-2.8,test-play-2.7,test-play-2.6", - "org.scalatestplus.play" %% "scalatestplus-play" % "4.0.3" % "test-play-2.8,test-play-2.7,test-play-2.6" + "org.scalatestplus.play" %% "scalatestplus-play" % "4.0.3" % "test-play-2.8,test-play-2.7,test-play-2.6" ) -libraryDependencies ++= { if(scalaBinaryVersion.value == "2.13") Seq.empty else Seq( - "com.typesafe.play" %% "play" % `Play-2.6-version` % "test-play-2.6", - "com.typesafe.play" %% "play-netty-server" % `Play-2.6-version` % "test-play-2.6", - "com.typesafe.play" %% "play-akka-http-server" % `Play-2.6-version` % "test-play-2.6", - "com.typesafe.play" %% "play-ws" % `Play-2.6-version` % "test-play-2.6", - "com.typesafe.play" %% "play-test" % `Play-2.6-version` % "test-play-2.6", - "com.typesafe.play" %% "play-logback" % `Play-2.6-version` % "test-play-2.6" -)} - -libraryDependencies ++= { if(scalaBinaryVersion.value == "2.11") Seq.empty else Seq( - "com.typesafe.play" %% "play-akka-http2-support" % `Play-2.8-version` % "test-play-2.8", - "com.typesafe.play" %% "play" % `Play-2.8-version` % "test-play-2.8", - "com.typesafe.play" %% "play-netty-server" % `Play-2.8-version` % "test-play-2.8", - "com.typesafe.play" %% "play-akka-http-server" % `Play-2.8-version` % "test-play-2.8", - "com.typesafe.play" %% "play-ws" % `Play-2.8-version` % "test-play-2.8", - "com.typesafe.play" %% "play-test" % `Play-2.8-version` % "test-play-2.8", - "com.typesafe.play" %% "play-logback" % `Play-2.8-version` % "test-play-2.8" -)} +libraryDependencies ++= { + if (scalaBinaryVersion.value == "2.13") Seq.empty + else Seq( + "com.typesafe.play" %% "play" % `Play-2.6-version` % "test-play-2.6", + "com.typesafe.play" %% "play-netty-server" % `Play-2.6-version` % "test-play-2.6", + "com.typesafe.play" %% "play-akka-http-server" % `Play-2.6-version` % "test-play-2.6", + "com.typesafe.play" %% "play-ws" % `Play-2.6-version` % "test-play-2.6", + "com.typesafe.play" %% "play-test" % `Play-2.6-version` % "test-play-2.6", + "com.typesafe.play" %% "play-logback" % `Play-2.6-version` % "test-play-2.6" + ) +} + +libraryDependencies ++= { + if (scalaBinaryVersion.value == "2.11") Seq.empty + else Seq( + "com.typesafe.play" %% "play-akka-http2-support" % `Play-2.8-version` % "test-play-2.8", + "com.typesafe.play" %% "play" % `Play-2.8-version` % "test-play-2.8", + "com.typesafe.play" %% "play-netty-server" % `Play-2.8-version` % "test-play-2.8", + "com.typesafe.play" %% "play-akka-http-server" % `Play-2.8-version` % "test-play-2.8", + "com.typesafe.play" %% "play-ws" % `Play-2.8-version` % "test-play-2.8", + "com.typesafe.play" %% "play-test" % `Play-2.8-version` % "test-play-2.8", + "com.typesafe.play" %% "play-logback" % `Play-2.8-version` % "test-play-2.8" + ) +} /** * Test-related settings @@ -58,8 +63,8 @@ libraryDependencies ++= { if(scalaBinaryVersion.value == "2.11") Seq.empty else lazy val baseTestSettings = Seq( fork := true, parallelExecution := false, - javaOptions := (Test / javaOptions).value ++ Seq("-Dkanela.loglevel=DEBUG","-Dkanela.debug-mode=yes"), - dependencyClasspath += (Compile / packageBin).value, + javaOptions := (Test / javaOptions).value ++ Seq("-Dkanela.loglevel=DEBUG", "-Dkanela.debug-mode=yes"), + dependencyClasspath += (Compile / packageBin).value ) inConfig(TestCommon)(Defaults.testSettings ++ instrumentationSettings ++ baseTestSettings ++ Seq( @@ -71,7 +76,7 @@ inConfig(`Test-Play-2.6`)(Defaults.testSettings ++ instrumentationSettings ++ ba crossScalaVersions := Seq("2.11.12", "2.12.13"), testGrouping := singleTestPerJvm(definedTests.value, javaOptions.value), unmanagedResourceDirectories ++= (Compile / unmanagedResourceDirectories).value, - unmanagedResourceDirectories ++= (TestCommon / unmanagedResourceDirectories).value, + unmanagedResourceDirectories ++= (TestCommon / unmanagedResourceDirectories).value )) inConfig(`Test-Play-2.7`)(Defaults.testSettings ++ instrumentationSettings ++ baseTestSettings ++ Seq( @@ -86,11 +91,11 @@ inConfig(`Test-Play-2.8`)(Defaults.testSettings ++ instrumentationSettings ++ ba crossScalaVersions := Seq("2.12.13", "2.13.3"), testGrouping := singleTestPerJvm(definedTests.value, javaOptions.value), unmanagedResourceDirectories ++= (Compile / unmanagedResourceDirectories).value, - unmanagedResourceDirectories ++= (TestCommon / unmanagedResourceDirectories).value, + unmanagedResourceDirectories ++= (TestCommon / unmanagedResourceDirectories).value )) Test / test := Def.taskDyn { - if(scalaBinaryVersion.value == "2.13") + if (scalaBinaryVersion.value == "2.13") Def.task { (`Test-Play-2.7` / test).value (`Test-Play-2.8` / test).value @@ -102,7 +107,6 @@ Test / test := Def.taskDyn { } }.value - def singleTestPerJvm(tests: Seq[TestDefinition], jvmSettings: Seq[String]): Seq[Group] = tests map { test => Group( @@ -115,7 +119,7 @@ def singleTestPerJvm(tests: Seq[TestDefinition], jvmSettings: Seq[String]): Seq[ workingDirectory = Option.empty[File], runJVMOptions = jvmSettings.toVector, connectInput = false, - envVars = Map.empty[String, String]) - ) + envVars = Map.empty[String, String] + )) ) } diff --git a/instrumentation/kamon-tapir/build.sbt b/instrumentation/kamon-tapir/build.sbt index 7183e0d74..ab9db17d9 100644 --- a/instrumentation/kamon-tapir/build.sbt +++ b/instrumentation/kamon-tapir/build.sbt @@ -10,4 +10,4 @@ Compile / products := (Compile / products).value ++ (Legacy / products).value Test / test := { (Test / test).value (TestLegacy / test).value -} \ No newline at end of file +} diff --git a/project/Build.scala b/project/Build.scala index 693d261d2..df1f765b4 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -3,7 +3,15 @@ import Keys._ import sbt.librarymanagement.{Configuration, Configurations} import Configurations.Compile import sbtassembly.AssemblyPlugin -import sbtassembly.AssemblyPlugin.autoImport.{MergeStrategy, assembleArtifact, assembly, assemblyExcludedJars, assemblyMergeStrategy, assemblyOption, assemblyPackageScala} +import sbtassembly.AssemblyPlugin.autoImport.{ + MergeStrategy, + assembleArtifact, + assembly, + assemblyExcludedJars, + assemblyMergeStrategy, + assemblyOption, + assemblyPackageScala +} import java.util.Calendar import Def.Initialize @@ -26,17 +34,16 @@ object BaseProject extends AutoPlugin { /** Marker configuration for dependencies that will be shaded into their module's jar. */ lazy val Shaded = config("shaded").hide - val kanelaAgent = "io.kamon" % "kanela-agent" % "1.0.18" - val slf4jApi = "org.slf4j" % "slf4j-api" % "1.7.36" - val slf4jnop = "org.slf4j" % "slf4j-nop" % "1.7.36" - val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.2.12" - val scalatest = "org.scalatest" %% "scalatest" % "3.2.9" - val hdrHistogram = "org.hdrhistogram" % "HdrHistogram" % "2.1.10" - val okHttp = "com.squareup.okhttp3" % "okhttp" % "4.12.0" - val okHttpMockServer = "com.squareup.okhttp3" % "mockwebserver" % "4.10.0" - val jsqlparser = "com.github.jsqlparser" % "jsqlparser" % "4.1" - val oshiCore = "com.github.oshi" % "oshi-core" % "6.4.13" - + val kanelaAgent = "io.kamon" % "kanela-agent" % "1.0.18" + val slf4jApi = "org.slf4j" % "slf4j-api" % "1.7.36" + val slf4jnop = "org.slf4j" % "slf4j-nop" % "1.7.36" + val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.2.12" + val scalatest = "org.scalatest" %% "scalatest" % "3.2.9" + val hdrHistogram = "org.hdrhistogram" % "HdrHistogram" % "2.1.10" + val okHttp = "com.squareup.okhttp3" % "okhttp" % "4.12.0" + val okHttpMockServer = "com.squareup.okhttp3" % "mockwebserver" % "4.10.0" + val jsqlparser = "com.github.jsqlparser" % "jsqlparser" % "4.1" + val oshiCore = "com.github.oshi" % "oshi-core" % "6.4.13" val kanelaAgentVersion = settingKey[String]("Kanela Agent version") val kanelaAgentJar = taskKey[File]("Kanela Agent jar") @@ -64,8 +71,8 @@ object BaseProject extends AutoPlugin { // This installs the GPG signing key from the setupGpg() - def compileScope(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "compile") - def testScope(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "test") + def compileScope(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "compile") + def testScope(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "test") def providedScope(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "provided") def optionalScope(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "compile,optional") @@ -82,8 +89,8 @@ object BaseProject extends AutoPlugin { val allSources = ( baseSources.filterNot { case (_, path) => extraSources.exists(_._2 == path) } ++ - manSources ++ - extraSources + manSources ++ + extraSources ) allSources.map(_._1) @@ -142,10 +149,13 @@ object BaseProject extends AutoPlugin { autoImport.`scala_3_version` ), javacOptions := Seq( - "-source", "1.8", - "-target", "1.8", + "-source", + "1.8", + "-target", + "1.8", "-Xlint:-options", - "-encoding", "UTF-8", + "-encoding", + "UTF-8", "-XDignore.symbol.file" ), scalacOptions := Seq( @@ -155,18 +165,19 @@ object BaseProject extends AutoPlugin { "-deprecation", "-target:jvm-1.8", "-Ywarn-dead-code", - "-encoding", "UTF-8", + "-encoding", + "UTF-8", "-language:postfixOps", "-language:higherKinds", "-Xlog-reflective-calls", "-language:existentials", "-language:implicitConversions" ) ++ (CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2,11)) => Seq("-Xfuture", "-Ybackend:GenASM") - case Some((2,12)) => Seq("-Xfuture", "-opt:l:method,-closure-invocations") - case Some((2,13)) => Seq.empty - case Some((3, _)) => Seq("-source:3.0-migration", "-Xtarget:8") - case _ => Seq.empty + case Some((2, 11)) => Seq("-Xfuture", "-Ybackend:GenASM") + case Some((2, 12)) => Seq("-Xfuture", "-opt:l:method,-closure-invocations") + case Some((2, 13)) => Seq.empty + case Some((3, _)) => Seq("-source:3.0-migration", "-Xtarget:8") + case _ => Seq.empty }) ) @@ -209,7 +220,7 @@ object BaseProject extends AutoPlugin { def findKanelaAgentJar = Def.task { update.value.matching { moduleFilter(organization = "io.kamon", name = "kanela-agent") && - artifactFilter(`type` = "jar") + artifactFilter(`type` = "jar") }.head } @@ -233,7 +244,7 @@ object BaseProject extends AutoPlugin { private def kamonReleaseProcess = Def.setting { val publishStep = - if(isSnapshot.value) + if (isSnapshot.value) releaseStepCommandAndRemaining("+publish") else releaseStepCommandAndRemaining("+publishSigned") @@ -272,9 +283,9 @@ object AssemblyTweaks extends AutoPlugin { ), assembly / assemblyMergeStrategy := { case s if s.startsWith("LICENSE") => MergeStrategy.discard - case s if s.startsWith("about") => MergeStrategy.discard - case "version.conf" => MergeStrategy.concat - case x => (assembly / assemblyMergeStrategy).value(x) + case s if s.startsWith("about") => MergeStrategy.discard + case "version.conf" => MergeStrategy.concat + case x => (assembly / assemblyMergeStrategy).value(x) } ) ++ inConfig(Shaded)(Defaults.configSettings) } diff --git a/project/BundleKeys.scala b/project/BundleKeys.scala index 5674778a9..d35d654e7 100644 --- a/project/BundleKeys.scala +++ b/project/BundleKeys.scala @@ -1,5 +1,5 @@ import sbt.librarymanagement.syntax.ExclusionRule -import sbt.{ ModuleID, settingKey, taskKey} +import sbt.{ModuleID, settingKey, taskKey} object BundleKeys { val kanelaAgentModule = settingKey[ModuleID]("Dependency on the Kanela agent") From 9d3f9eb0ed355f2bf91c24a6480297d44425ea59 Mon Sep 17 00:00:00 2001 From: philippus Date: Mon, 17 Jun 2024 21:55:05 +0200 Subject: [PATCH 2/4] Ignore blame for initial scalafmtSbt --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 985b60b4d..c2661a59e 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,4 @@ # Initial scalafmtAll was applied 022216d6b1ebe4dd0c00aef204625f7f3372fc90 +# Initial scalafmtSbt was applied +75eea26c78cd437116617eedc9bc1a144d163921 From 8008d78dd2704680aaec50c0d7c46dd6e4646cc4 Mon Sep 17 00:00:00 2001 From: philippus Date: Mon, 17 Jun 2024 21:56:02 +0200 Subject: [PATCH 3/4] Add scalafmtSbtcheck to lint --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4befb051e..b738e60aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,5 +24,4 @@ jobs: - uses: actions/checkout@v1 - uses: coursier/cache-action@v6 - name: Test - run: sbt -v "+scalafmtCheckAll" - + run: sbt -v "+scalafmtCheckAll;scalafmtSbtCheck" From 77ad2101286501b1beacee4eee16d29f267fe8d3 Mon Sep 17 00:00:00 2001 From: philippus Date: Mon, 17 Jun 2024 21:58:43 +0200 Subject: [PATCH 4/4] Mention scalafmtSbt --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 52ae7c201..119a2f07a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,8 +26,8 @@ If you want to make a code contribution to the project Awesome! First, please note that we try to follow the [commit message conventions] used by the Spray guys and we need you to electronically fill our [CLA] before accepting your contribution. This project uses scalafmt for style, so -remember to apply scalafmtAll to your commit. Also, if your PR contains various commits, please squash them into a -single commit. Let the PR rain begin! +remember to apply scalafmtAll and scalafmtSbt to your commit. Also, if your PR contains various commits, please squash +them into a single commit. Let the PR rain begin! [open an issue]: https://github.com/kamon-io/Kamon/issues/new