From 8a0e8ef74eb4dbda4e66c65f08a7ee2c4cb98e19 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Fri, 6 Mar 2015 19:58:38 -0500 Subject: [PATCH] Write JSON to file without String. #1763 --- ivy/src/main/scala/sbt/JsonUtil.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ivy/src/main/scala/sbt/JsonUtil.scala b/ivy/src/main/scala/sbt/JsonUtil.scala index ddd126555..88d7e1e90 100644 --- a/ivy/src/main/scala/sbt/JsonUtil.scala +++ b/ivy/src/main/scala/sbt/JsonUtil.scala @@ -10,8 +10,7 @@ private[sbt] object JsonUtil { def parseUpdateReport(md: ModuleDescriptor, path: File, cachedDescriptor: File, log: Logger): UpdateReport = { try { - val s = IO.read(path, IO.utf8) - val lite = fromJsonString[UpdateReportLite](s).get + val lite = fromJsonFile[UpdateReportLite](path).get fromLite(lite, cachedDescriptor) } catch { case e: Throwable => @@ -21,8 +20,8 @@ private[sbt] object JsonUtil { } def writeUpdateReport(ur: UpdateReport, graphPath: File): Unit = { - val str = toJsonString(toLite(ur)) - IO.write(graphPath, str, IO.utf8) + IO.createDirectory(graphPath.getParentFile) + toJsonFile(toLite(ur), graphPath) } def toLite(ur: UpdateReport): UpdateReportLite = UpdateReportLite(ur.configurations map { cr =>