mirror of https://github.com/sbt/sbt.git
Merge pull request #5303 from eed3si9n/wip/cache_removal
Fixes update task not invalidating
This commit is contained in:
commit
19c3b44b59
|
|
@ -73,8 +73,8 @@ private[sbt] object LibraryManagement {
|
||||||
!force &&
|
!force &&
|
||||||
!depsUpdated &&
|
!depsUpdated &&
|
||||||
!inChanged &&
|
!inChanged &&
|
||||||
out.allFiles.forall(f => fileUptodate(f, out.stamps)) &&
|
out.allFiles.forall(f => fileUptodate(f, out.stamps, log)) &&
|
||||||
fileUptodate(out.cachedDescriptor, out.stamps)
|
fileUptodate(out.cachedDescriptor, out.stamps, log)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip resolve if last output exists, otherwise error. */
|
/* Skip resolve if last output exists, otherwise error. */
|
||||||
|
|
@ -129,8 +129,19 @@ private[sbt] object LibraryManagement {
|
||||||
handler((extraInputHash, settings, withoutClock))
|
handler((extraInputHash, settings, withoutClock))
|
||||||
}
|
}
|
||||||
|
|
||||||
private[this] def fileUptodate(file: File, stamps: Map[File, Long]): Boolean =
|
private[this] def fileUptodate(file: File, stamps: Map[File, Long], log: Logger): Boolean = {
|
||||||
stamps.get(file).forall(_ == IO.getModifiedTimeOrZero(file))
|
val exists = file.exists
|
||||||
|
// https://github.com/sbt/sbt/issues/5292 warn the user that the file is missing since this indicates
|
||||||
|
// that UpdateReport was persisted but Coursier cache was not.
|
||||||
|
if (!exists) {
|
||||||
|
log.warn(s"${file.getName} no longer exists at $file")
|
||||||
|
}
|
||||||
|
// coursier doesn't populate stamps
|
||||||
|
val timeStampIsSame = stamps
|
||||||
|
.get(file)
|
||||||
|
.forall(_ == IO.getModifiedTimeOrZero(file))
|
||||||
|
exists && timeStampIsSame
|
||||||
|
}
|
||||||
|
|
||||||
private[sbt] def transitiveScratch(
|
private[sbt] def transitiveScratch(
|
||||||
lm: DependencyResolution,
|
lm: DependencyResolution,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue