mirror of https://github.com/sbt/sbt.git
Merge pull request #1680 from sbt/wip/fix-1677
Fixes #1677. Provide URLSerializer.
This commit is contained in:
commit
01f098cd28
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue