Skip to content

Commit

Permalink
Merge pull request #470 from cunei/wip-milliBis
Browse files Browse the repository at this point in the history
Use IO.getModifiedTimeOrZero(file) calls
  • Loading branch information
eed3si9n authored Dec 22, 2017
2 parents 84a5ed1 + 3b65590 commit e6b5420
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ final class ClassLoaderCache(val commonParent: ClassLoader) {
mkLoader: () => ClassLoader
): ClassLoader =
synchronized {
val tstamps = files.map(IO.getModifiedTime)
val tstamps = files.map(IO.getModifiedTimeOrZero)
getFromReference(files, tstamps, delegate.get(files), mkLoader)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ object Stamper {
}

val forHash = (toStamp: File) => tryStamp(Hash.ofFile(toStamp))
val forLastModified = (toStamp: File) => tryStamp(new LastModified(IO.getModifiedTime(toStamp)))
val forLastModified = (toStamp: File) => tryStamp(new LastModified(IO.getModifiedTimeOrZero(toStamp)))
}

object Stamps {
Expand Down
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ object Dependencies {
val scala212 = "2.12.4"
val scala213 = "2.13.0-M2"

private val ioVersion = "1.1.2"
private val utilVersion = "1.1.1"
private val lmVersion = "1.1.1"
private val ioVersion = "1.1.3"
private val utilVersion = "1.1.2"
private val lmVersion = "1.1.2"

private val sbtIO = "org.scala-sbt" %% "io" % ioVersion

Expand Down
4 changes: 2 additions & 2 deletions project/Util.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ object Util {
val timestamp = formatter.format(new Date)
val content = versionLine(version) + "\ntimestamp=" + timestamp
val f = dir / "incrementalcompiler.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.
// 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)
IO.write(f, content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object ClasspathCache {
val attrs = Files.readAttributes(file.toPath, classOf[BasicFileAttributes])
if (attrs.isDirectory) emptyFileHash(file)
else {
val currentMetadata = (FileTime.fromMillis(IO.getModifiedTime(file)), attrs.size())
val currentMetadata = (FileTime.fromMillis(IO.getModifiedTimeOrZero(file)), attrs.size())
Option(cacheMetadataJar.get(file)) match {
case Some((metadata, hashHit)) if metadata == currentMetadata => hashHit
case _ => genFileHash(file, currentMetadata)
Expand Down

0 comments on commit e6b5420

Please sign in to comment.