Skip to content

Commit

Permalink
Update snakeyaml to 1.25 (#2987)
Browse files Browse the repository at this point in the history
* 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
```
  • Loading branch information
scala-steward authored and kailuowang committed Aug 16, 2019
1 parent 481b5ff commit 01b7cbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion project/build.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libraryDependencies += "org.yaml" % "snakeyaml" % "1.24"
libraryDependencies += "org.yaml" % "snakeyaml" % "1.25"

0 comments on commit 01b7cbd

Please sign in to comment.