Skip to content

Commit

Permalink
Avoid cross compiling different yaml loading logic
Browse files Browse the repository at this point in the history
Instead, create a shim for standard convert utilities.
  • Loading branch information
thyandrecardoso committed May 4, 2024
1 parent 192fed2 commit b0405bb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 49 deletions.
22 changes: 0 additions & 22 deletions src/main/scala-2.12/org/uaparser/scala/YamlUtil.scala

This file was deleted.

7 changes: 7 additions & 0 deletions src/main/scala-2.12/org/uaparser/scala/scala.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.uaparser

package object scala {
object jdk {
val CollectionConverters = _root_.scala.collection.JavaConverters
}
}
7 changes: 7 additions & 0 deletions src/main/scala-2.13/org/uaparser/scala/scala.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.uaparser

package object scala {
object jdk {
val CollectionConverters = _root_.scala.jdk.CollectionConverters
}
}
24 changes: 0 additions & 24 deletions src/main/scala-3/org/uaparser/scala/YamlUtil.scala

This file was deleted.

7 changes: 7 additions & 0 deletions src/main/scala-3/org/uaparser/scala/scala.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.uaparser

package object scala {
object jdk {
val CollectionConverters = _root_.scala.jdk.CollectionConverters
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.uaparser.scala

import org.yaml.snakeyaml.{LoaderOptions, Yaml}
import org.yaml.snakeyaml.constructor.SafeConstructor
import java.io.InputStream
import scala.jdk.CollectionConverters._
import java.util.{List => JList, Map => JMap}
import jdk.CollectionConverters._
import org.yaml.snakeyaml.{LoaderOptions, Yaml}
import org.yaml.snakeyaml.constructor.SafeConstructor

private[scala] object YamlUtil {
def loadYamlAsMap(yamlStream: InputStream, loader: Yaml): Map[String, List[Map[String, String]]] = {
Expand Down

0 comments on commit b0405bb

Please sign in to comment.