Skip to content

Commit

Permalink
Handle javaconverters deprecation difference between 2.12 and 13
Browse files Browse the repository at this point in the history
  • Loading branch information
zakpatterson committed Jun 15, 2019
1 parent e6a08fa commit 4e97a0d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
8 changes: 8 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ mimaPreviousArtifacts := {
versions.filter(versionFilter).map("io.circe" %% "circe-config" % _)
}

unmanagedSourceDirectories in Compile += {
val sourceDir = (sourceDirectory in Compile).value
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n <= 12 => sourceDir / "scala-2.13-"
case _ => sourceDir / "scala-2.13+"
}
}

enablePlugins(GitPlugin)
versionWithGit
git.useGitDescribe := true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package io.circe.config

// Probably not needed after https://github.com/scala/scala-collection-compat/pull/217
package object compat {
val converters = scala.jdk.CollectionConverters
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.circe.config


// Probably not needed after https://github.com/scala/scala-collection-compat/pull/217
package object compat {
val converters = scala.collection.JavaConverters
}
2 changes: 1 addition & 1 deletion src/main/scala/io.circe.config/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package io.circe

import com.typesafe.config._
import scala.collection.JavaConverters._
import config.compat.converters._

/**
* circe-config: A [[https://github.com/lightbend/config Typesafe config]]
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/io.circe.config/parser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import cats.syntax.bifunctor._
import cats.instances.either._
import java.io.File

import scala.collection.JavaConverters._
import compat.converters._
import com.typesafe.config._

/**
Expand Down

0 comments on commit 4e97a0d

Please sign in to comment.