diff --git a/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala b/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala index 297611b64..39c4cd8f8 100644 --- a/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala +++ b/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala @@ -2,6 +2,7 @@ package sbt package librarymanagement import java.io.File +import sbt.io.Milli.getModifiedTime /** * Provides extra methods for filtering the contents of an `UpdateReport` @@ -10,7 +11,7 @@ import java.io.File final class RichUpdateReport(report: UpdateReport) { private[sbt] def recomputeStamps(): UpdateReport = { val files = report.cachedDescriptor +: allFiles - val stamps = files.map(f => (f, f.lastModified)).toMap + val stamps = files.map(f => (f, getModifiedTime(f))).toMap UpdateReport(report.cachedDescriptor, report.configurations, report.stats, stamps) } diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala index a1109dc91..a2b4cb7a2 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala @@ -16,6 +16,7 @@ import org.apache.ivy.util.{ CopyProgressEvent, CopyProgressListener, Message } import org.apache.ivy.util.url.{ AbstractURLHandler, BasicURLHandler, IvyAuthenticator, URLHandler } import org.apache.ivy.util.url.URLHandler._ import sbt.io.IO +import sbt.io.Milli.setModifiedTime // Copied from Ivy's BasicURLHandler. class GigahorseUrlHandler extends AbstractURLHandler { @@ -149,7 +150,7 @@ class GigahorseUrlHandler extends AbstractURLHandler { val lastModified = lastModifiedTimestamp(response) if (lastModified > 0) { - dest.setLastModified(lastModified) + setModifiedTime(dest, lastModified) } if (l != null) { diff --git a/project/Util.scala b/project/Util.scala index 5dacc7df8..2ef855762 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -26,6 +26,8 @@ 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.Milli.getModifiedTime(), once the build + // has been upgraded to a version of sbt that includes sbt.io.Milli. if (!f.exists || f.lastModified < lastCompilationTime(analysis) || !containsVersion(f, version)) { s.log.info("Writing version information to " + f + " :\n" + content) IO.write(f, content)