From 94e36a14c80027a4e316505574d4c49fdcb14948 Mon Sep 17 00:00:00 2001 From: Antonio Cunei Date: Fri, 22 Dec 2017 01:49:59 +0100 Subject: [PATCH] Change modifiedTime definitions --- main-actions/src/main/scala/sbt/compiler/Eval.scala | 3 +-- main/src/main/scala/sbt/Defaults.scala | 2 +- main/src/main/scala/sbt/internal/LibraryManagement.scala | 2 +- project/SiteMap.scala | 2 +- project/Util.scala | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/main-actions/src/main/scala/sbt/compiler/Eval.scala b/main-actions/src/main/scala/sbt/compiler/Eval.scala index 78235cdb3..a9d97246a 100644 --- a/main-actions/src/main/scala/sbt/compiler/Eval.scala +++ b/main-actions/src/main/scala/sbt/compiler/Eval.scala @@ -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) diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index 5d9d2fb8b..4fd8d1585 100755 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -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 } diff --git a/main/src/main/scala/sbt/internal/LibraryManagement.scala b/main/src/main/scala/sbt/internal/LibraryManagement.scala index b40956fad..d247a9d99 100644 --- a/main/src/main/scala/sbt/internal/LibraryManagement.scala +++ b/main/src/main/scala/sbt/internal/LibraryManagement.scala @@ -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, diff --git a/project/SiteMap.scala b/project/SiteMap.scala index 046031775..95e038eab 100644 --- a/project/SiteMap.scala +++ b/project/SiteMap.scala @@ -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)) } diff --git a/project/Util.scala b/project/Util.scala index c04734285..8c68f4ced 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -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)