Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use IO.getModifiedTimeOrZero(file) calls #470

Merged
merged 3 commits into from
Dec 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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