From 01b7cbda20d8cf7cf6ac9742ff11a02615c42698 Mon Sep 17 00:00:00 2001 From: Scala Steward <43047562+scala-steward@users.noreply.github.com> Date: Fri, 16 Aug 2019 23:35:36 +0200 Subject: [PATCH] Update snakeyaml to 1.25 (#2987) * Update snakeyaml to 1.25 * Fix compile error when loading the build With the new version, the build fails to load with this error: ``` [info] Compiling 2 Scala sources to /home/travis/build/typelevel/cats/project/target/scala-2.12/sbt-1.0/classes ... [info] Done compiling. /home/travis/build/typelevel/cats/build.sbt:43: error: value asScala is not a member of Nothing .collect { case map: java.util.Map[_, _] => map.asScala.toList } ^ [error] Type error in expression ``` I've no idea why this happens, but this change fixes it. I've verified that `crossScalaVersions` still contains the versions from `.travis.yml`: ``` sbt:cats> coreJVM/crossScalaVersions [info] * 2.11.12 [info] * 2.12.9 [info] * 2.13.0 ``` --- build.sbt | 8 +++----- project/build.sbt | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index bb46990c5d..c26adbec6b 100644 --- a/build.sbt +++ b/build.sbt @@ -39,11 +39,9 @@ crossScalaVersionsFromTravis in Global := { val manifest = (baseDirectory in ThisBuild).value / ".travis.yml" import collection.JavaConverters._ Using.fileInputStream(manifest) { fis => - List(new org.yaml.snakeyaml.Yaml().load(fis)) - .collect { case map: java.util.Map[_, _] => map.asScala.toList } - .flatMap(_.collect { - case (k: String, v: String) if k.contains("scala_version_") => v - }) + new org.yaml.snakeyaml.Yaml().loadAs(fis, classOf[java.util.Map[_, _]]).asScala.toList.collect { + case (k: String, v: String) if k.contains("scala_version_") => v + } } } diff --git a/project/build.sbt b/project/build.sbt index 11c22d8f31..e70d55ddd9 100644 --- a/project/build.sbt +++ b/project/build.sbt @@ -1 +1 @@ -libraryDependencies += "org.yaml" % "snakeyaml" % "1.24" +libraryDependencies += "org.yaml" % "snakeyaml" % "1.25"