Skip to content

Commit

Permalink
= support scala 2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
nadavwr committed Jan 28, 2020
1 parent c91e8d6 commit e5ab4fa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
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/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

0 comments on commit e5ab4fa

Please sign in to comment.