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.
This commit is contained in:
Mark Harrah 2013-02-19 14:33:22 -05:00
parent f3d2df0f9c
commit cbaef8a6f8
1 changed files with 5 additions and 4 deletions

View File

@ -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) 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) new File(base, f)
} }
private[this] def reportBase(resolveId: String): File = private[this] val reportBase: File = new File(base, ReportDirectory)
new File(new File(base, ReportDirectory), resolveId)
def getResolutionCacheRoot: File = base def getResolutionCacheRoot: File = base
def clean() { IO.delete(base) } def clean() { IO.delete(base) }
@ -30,10 +29,12 @@ private[sbt] final class ResolutionCache(base: File) extends ResolutionCacheMana
resolvedFileInCache(mrid, ResolvedName, "xml") resolvedFileInCache(mrid, ResolvedName, "xml")
def getResolvedIvyPropertiesInCache(mrid: ModuleRevisionId): File = def getResolvedIvyPropertiesInCache(mrid: ModuleRevisionId): File =
resolvedFileInCache(mrid, ResolvedName, "properties") 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 = 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] = 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 private[sbt] object ResolutionCache
{ {