From cbaef8a6f8e1f59b3ac6c8a4baac98fb3fd89bf6 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 19 Feb 2013 14:33:22 -0500 Subject: [PATCH] Use Ivy's default name for the resolution report. Ivy hardcodes the resolution report name in the stylesheet that renders the HTML from the XML report. This means that the links to other configurations are broken when using a custom name. --- ivy/src/main/scala/sbt/ResolutionCache.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ivy/src/main/scala/sbt/ResolutionCache.scala b/ivy/src/main/scala/sbt/ResolutionCache.scala index a5026882b..ab693445d 100644 --- a/ivy/src/main/scala/sbt/ResolutionCache.scala +++ b/ivy/src/main/scala/sbt/ResolutionCache.scala @@ -19,8 +19,7 @@ private[sbt] final class ResolutionCache(base: File) extends ResolutionCacheMana val f = IvyPatternHelper.substitute(p, m.getOrganisation, m.getName, m.getBranch, m.getRevision, name, name, ext, null, null, m.getAttributes, null) new File(base, f) } - private[this] def reportBase(resolveId: String): File = - new File(new File(base, ReportDirectory), resolveId) + private[this] val reportBase: File = new File(base, ReportDirectory) def getResolutionCacheRoot: File = base def clean() { IO.delete(base) } @@ -30,10 +29,12 @@ private[sbt] final class ResolutionCache(base: File) extends ResolutionCacheMana resolvedFileInCache(mrid, ResolvedName, "xml") def getResolvedIvyPropertiesInCache(mrid: ModuleRevisionId): File = resolvedFileInCache(mrid, ResolvedName, "properties") + // name needs to be the same as Ivy's default because the ivy-report.xsl stylesheet assumes this + // when making links to reports for other configurations def getConfigurationResolveReportInCache(resolveId: String, conf: String): File = - new File(reportBase(resolveId), "/" + conf + "-" + ResolvedName) + new File(reportBase, resolveId + "-" + conf + ".xml") def getConfigurationResolveReportsInCache(resolveId: String): Array[File] = - IO.listFiles(reportBase(resolveId)).flatMap(d => IO.listFiles(d)) + IO.listFiles(reportBase).filter(_.getName.startsWith(resolveId + "-")) } private[sbt] object ResolutionCache {