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

Support Scala 2.13 in Kamon 1.1 #633

Open
wants to merge 1 commit into
base: maintenance-v1.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ script:
- sbt +test
scala:
- 2.12.4
dist: trusty
jdk:
- oraclejdk8
before_script:
Expand Down
14 changes: 9 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ lazy val kamon = (project in file("."))
.aggregate(core, testkit, coreTests)

val commonSettings = Seq(
scalaVersion := "2.12.8",
scalaVersion := "2.13.1",
javacOptions += "-XDignore.symbol.file",
resolvers += Resolver.mavenLocal,
crossScalaVersions := Seq("2.12.8", "2.11.12", "2.10.7"),
crossScalaVersions := Seq("2.13.1", "2.12.8", "2.11.12", "2.10.7"),
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
scalacOptions ++= Seq(
"-deprecation",
Expand All @@ -36,6 +36,7 @@ val commonSettings = Seq(
case Some((2,10)) => Seq("-Yno-generic-signatures", "-target:jvm-1.7")
case Some((2,11)) => Seq("-Ybackend:GenBCode","-Ydelambdafy:method","-target:jvm-1.8")
case Some((2,12)) => Seq("-opt:l:method")
case Some((2,13)) => Seq("-opt:l:method")
case _ => Seq.empty
})
)
Expand All @@ -48,7 +49,10 @@ lazy val core = (project in file("kamon-core"))
"com.typesafe" % "config" % "1.3.1",
"org.slf4j" % "slf4j-api" % "1.7.25",
"org.hdrhistogram" % "HdrHistogram" % "2.1.11",
"com.lihaoyi" %% "fansi" % "0.2.4"
"com.lihaoyi" %% "fansi" % (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 10 | 11 | 12)) => "0.2.4"
case Some((2, 13)) | _ => "0.2.8"
})
)
)

Expand All @@ -57,7 +61,7 @@ lazy val testkit = (project in file("kamon-testkit"))
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.1"
"org.scalatest" %% "scalatest" % "3.0.8"
)
).dependsOn(core)

Expand All @@ -71,7 +75,7 @@ lazy val coreTests = (project in file("kamon-core-tests"))
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"org.scalatest" %% "scalatest" % "3.0.8" % "test",
"ch.qos.logback" % "logback-classic" % "1.2.2" % "test"
)
).dependsOn(testkit)
4 changes: 2 additions & 2 deletions kamon-core/src/main/scala/kamon/ReporterRegistry.scala
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ object ReporterRegistry {

Future {
Try {
entry.reporter.reportSpans(spanBatch.asScala)
entry.reporter.reportSpans(spanBatch.asScala.toSeq)
}.failed.foreach { error =>
logger.error(s"Reporter [${entry.name}] failed to report spans.", error)
}
Expand All @@ -396,7 +396,7 @@ object ReporterRegistry {
optimisticMetricTickAlignment = config.getBoolean("kamon.metric.optimistic-tick-alignment"),
traceTickInterval = config.getDuration("kamon.trace.tick-interval"),
traceReporterQueueSize = config.getInt("kamon.trace.reporter-queue-size"),
configuredReporters = config.getStringList("kamon.reporters").asScala
configuredReporters = config.getStringList("kamon.reporters").asScala.toSeq
)

private case class Configuration(metricTickInterval: Duration, optimisticMetricTickAlignment: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion kamon-core/src/main/scala/kamon/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ package object kamon {
implicit class AtomicGetOrElseUpdateOnTrieMap[K, V](val trieMap: TrieMap[K, V]) extends AnyVal {

def atomicGetOrElseUpdate(key: K, op: ⇒ V): V =
atomicGetOrElseUpdate(key, op, { v: V ⇒ Unit })
atomicGetOrElseUpdate(key, op, { v: V ⇒ () })

def atomicGetOrElseUpdate(key: K, op: ⇒ V, cleanup: V ⇒ Unit): V =
trieMap.get(key) match {
Expand Down
2 changes: 1 addition & 1 deletion kamon-core/src/main/scala/kamon/util/DynamicAccess.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class DynamicAccess(val classLoader: ClassLoader) {
Try[Class[_ <: T]]({
val c = Class.forName(fqcn, false, classLoader).asInstanceOf[Class[_ <: T]]
val t = implicitly[ClassTag[T]].runtimeClass
if (t.isAssignableFrom(c)) c else throw new ClassCastException(t + " is not assignable from " + c)
if (t.isAssignableFrom(c)) c else throw new ClassCastException(s"$t is not assignable from $c")
})

def createInstanceFor[T: ClassTag](clazz: Class[_], args: immutable.Seq[(Class[_], AnyRef)]): Try[T] =
Expand Down
2 changes: 1 addition & 1 deletion kamon-core/src/main/scala/kamon/util/Filters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object Filters {
val configKey = ConfigUtil.joinPath(name, key)

if(filtersConfig.hasPath(configKey))
filtersConfig.getStringList(configKey).asScala.map(readMatcher)
filtersConfig.getStringList(configKey).asScala.toSeq.map(readMatcher)
else
Seq.empty
}
Expand Down