mirror of https://github.com/sbt/sbt.git
Make sure all files exist in minigraph.
This commit is contained in:
parent
b8873614e0
commit
1043d027d0
|
|
@ -112,11 +112,19 @@ private[sbt] class CachedResolutionResolveCache() {
|
||||||
def loadMiniGraphFromFile: Option[Either[ResolveException, UpdateReport]] =
|
def loadMiniGraphFromFile: Option[Either[ResolveException, UpdateReport]] =
|
||||||
(if (staticGraphPath.exists) Some(staticGraphPath)
|
(if (staticGraphPath.exists) Some(staticGraphPath)
|
||||||
else if (dynamicGraphPath.exists) Some(dynamicGraphPath)
|
else if (dynamicGraphPath.exists) Some(dynamicGraphPath)
|
||||||
else None) map { path =>
|
else None) match {
|
||||||
log.debug(s"parsing ${path.getAbsolutePath.toString}")
|
case Some(path) =>
|
||||||
val ur = JsonUtil.parseUpdateReport(md, path, cachedDescriptor, log)
|
log.debug(s"parsing ${path.getAbsolutePath.toString}")
|
||||||
updateReportCache(md.getModuleRevisionId) = Right(ur)
|
val ur = JsonUtil.parseUpdateReport(md, path, cachedDescriptor, log)
|
||||||
Right(ur)
|
if (ur.allFiles forall { _.exists }) {
|
||||||
|
updateReportCache(md.getModuleRevisionId) = Right(ur)
|
||||||
|
Some(Right(ur))
|
||||||
|
} else {
|
||||||
|
log.debug(s"some files are missing from the cache, so invalidating the minigraph")
|
||||||
|
IO.delete(path)
|
||||||
|
None
|
||||||
|
}
|
||||||
|
case _ => None
|
||||||
}
|
}
|
||||||
(updateReportCache.get(mrid) orElse loadMiniGraphFromFile) match {
|
(updateReportCache.get(mrid) orElse loadMiniGraphFromFile) match {
|
||||||
case Some(result) =>
|
case Some(result) =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue