Merge pull request #1680 from sbt/wip/fix-1677

Fixes #1677. Provide URLSerializer.
This commit is contained in:
Josh Suereth 2014-10-18 17:18:05 -04:00
commit 01f098cd28
1 changed files with 11 additions and 1 deletions

View File

@ -13,7 +13,8 @@ private[sbt] object JsonUtil {
implicit val formats = native.Serialization.formats(NoTypeHints) +
new ConfigurationSerializer +
new ArtifactSerializer +
new FileSerializer
new FileSerializer +
new URLSerializer
try {
val json = jawn.support.json4s.Parser.parseFromFile(path)
fromLite(json.get.extract[UpdateReportLite], cachedDescriptor)
@ -61,6 +62,15 @@ private[sbt] object JsonUtil {
private[sbt] case class UpdateReportLite(configurations: Seq[ConfigurationReportLite])
private[sbt] case class ConfigurationReportLite(configuration: String, details: Seq[OrganizationArtifactReport])
private[sbt] class URLSerializer extends CustomSerializer[URL](format => (
{
case JString(s) => new URL(s)
},
{
case x: URL => JString(x.toString)
}
))
private[sbt] class FileSerializer extends CustomSerializer[File](format => (
{
case JString(s) => new File(s)