From 19f40a16685ea936e4c9430c415ac2c33f33d8bd Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Wed, 28 Dec 2016 16:13:50 +0000 Subject: [PATCH] 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. --- librarymanagement/src/main/datatype/librarymanagement.json | 5 +++++ .../main/scala/sbt/librarymanagement/UpdateReportExtra.scala | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/librarymanagement/src/main/datatype/librarymanagement.json b/librarymanagement/src/main/datatype/librarymanagement.json index d6e3aff88..e0e6068d6 100644 --- a/librarymanagement/src/main/datatype/librarymanagement.json +++ b/librarymanagement/src/main/datatype/librarymanagement.json @@ -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)" ] }, { diff --git a/librarymanagement/src/main/scala/sbt/librarymanagement/UpdateReportExtra.scala b/librarymanagement/src/main/scala/sbt/librarymanagement/UpdateReportExtra.scala index ecc81493b..a0f98b020 100644 --- a/librarymanagement/src/main/scala/sbt/librarymanagement/UpdateReportExtra.scala +++ b/librarymanagement/src/main/scala/sbt/librarymanagement/UpdateReportExtra.scala @@ -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.