Fix ConfigurationReport.toString

Move the toString implementation from ConfigurationReportExtra to inside
the ConfigurationReport JSON schema definition, that way the synthetic
toString generated by contraband doesn't override the carefully defined
one.
This commit is contained in:
Dale Wijnand 2016-12-28 16:13:50 +00:00
parent 6319da53c1
commit 19f40a1668
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
2 changed files with 5 additions and 4 deletions

View File

@ -99,6 +99,11 @@
"type": "sbt.librarymanagement.OrganizationArtifactReport*",
"doc": [ "a sequence containing one report for each org/name, which may or may not be part of the final resolution." ]
}
],
"toString": [
"s\"\\t$configuration:\\n\" +",
"(if (details.isEmpty) modules.mkString + details.flatMap(_.modules).filter(_.evicted).map(\"\\t\\t(EVICTED) \" + _ + \"\\n\").mkString",
"else details.mkString)"
]
},
{

View File

@ -15,10 +15,6 @@ abstract class ConfigurationReportExtra {
def evicted: Seq[ModuleID] =
details flatMap (_.modules) filter (_.evicted) map (_.module)
override def toString = s"\t$configuration:\n" +
(if (details.isEmpty) modules.mkString + details.flatMap(_.modules).filter(_.evicted).map("\t\t(EVICTED) " + _ + "\n").mkString
else details.mkString)
/**
* All resolved modules for this configuration.
* For a given organization and module name, there is only one revision/`ModuleID` in this sequence.