Change modifiedTime definitions

This commit is contained in:
Antonio Cunei 2017-12-22 01:49:59 +01:00
parent ebff7919e9
commit 94e36a14c8
5 changed files with 5 additions and 6 deletions

View File

@ -488,8 +488,7 @@ private[sbt] object Eval {
(if (f.isDirectory)
filesModifiedBytes(f listFiles classDirFilter)
else
bytes(IO.lastModified(f))
) ++ bytes(f.getAbsolutePath)
bytes(IO.getModifiedTimeOrZero(f))) ++ bytes(f.getAbsolutePath)
def fileExistsBytes(f: File): Array[Byte] =
bytes(f.exists) ++
bytes(f.getAbsolutePath)

View File

@ -2315,7 +2315,7 @@ object Classpaths {
case Some(period) =>
val fullUpdateOutput = cacheDirectory / "out"
val now = System.currentTimeMillis
val diff = now - IO.lastModified(fullUpdateOutput)
val diff = now - IO.getModifiedTimeOrZero(fullUpdateOutput)
val elapsedDuration = new FiniteDuration(diff, TimeUnit.MILLISECONDS)
fullUpdateOutput.exists() && elapsedDuration > period
}

View File

@ -127,7 +127,7 @@ private[sbt] object LibraryManagement {
}
private[this] def fileUptodate(file: File, stamps: Map[File, Long]): Boolean =
stamps.get(file).forall(_ == IO.lastModified(file))
stamps.get(file).forall(_ == IO.getModifiedTimeOrZero(file))
private[sbt] def transitiveScratch(
lm: DependencyResolution,

View File

@ -68,7 +68,7 @@ object SiteMap {
// generates a string suitable for a sitemap file representing the last modified time of the given File
private[this] def lastModifiedString(f: File): String = {
val formatter = new java.text.SimpleDateFormat("yyyy-MM-dd")
// TODO: replace lastModified() with sbt.io.IO.lastModified(), once the build
// TODO: replace lastModified() with sbt.io.IO.getModifiedTimeOrZero(), once the build
// has been upgraded to a version of sbt that includes that call.
formatter.format(new java.util.Date(f.lastModified))
}

View File

@ -105,7 +105,7 @@ object Util {
val timestamp = formatter.format(new Date)
val content = versionLine(version) + "\ntimestamp=" + timestamp
val f = dir / "xsbt.version.properties"
// TODO: replace lastModified() with sbt.io.IO.lastModified(), once the build
// TODO: replace lastModified() with sbt.io.IO.getModifiedTimeOrZero(), once the build
// has been upgraded to a version of sbt that includes that call.
if (!f.exists || f.lastModified < lastCompilationTime(analysis) || !containsVersion(f, version)) {
s.log.info("Writing version information to " + f + " :\n" + content)