Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Commit

Permalink
Change modifiedTime definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Cunei committed Dec 21, 2017
1 parent 8ba68ee commit 0a1bd5a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class FileCommands(baseDirectory: File) extends BasicStatementHandler {
val pathA = fromString(a)
val pathB = fromString(b)
val isNewer = pathA.exists &&
(!pathB.exists || IO.lastModified(pathA) > IO.lastModified(pathB))
(!pathB.exists || IO.getModifiedTimeOrZero(pathA) > IO.getModifiedTimeOrZero(pathB))
if (!isNewer) {
scriptError(s"$pathA is not newer than $pathB")
}
Expand Down
4 changes: 2 additions & 2 deletions util-cache/src/main/scala/sbt/util/FileInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ object FileInfo {
}

implicit def apply(file: File): HashModifiedFileInfo =
FileHashModified(file.getAbsoluteFile, Hash(file).toList, IO.lastModified(file))
FileHashModified(file.getAbsoluteFile, Hash(file).toList, IO.getModifiedTimeOrZero(file))
}

object hash extends Style {
Expand Down Expand Up @@ -147,7 +147,7 @@ object FileInfo {
}

implicit def apply(file: File): ModifiedFileInfo =
FileModified(file.getAbsoluteFile, IO.lastModified(file))
FileModified(file.getAbsoluteFile, IO.getModifiedTimeOrZero(file))
}

object exists extends Style {
Expand Down
2 changes: 1 addition & 1 deletion util-cache/src/test/scala/FileInfoSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sbt.io.IO

class FileInfoSpec extends UnitSpec {
val file = new java.io.File(".").getAbsoluteFile
val fileInfo: ModifiedFileInfo = FileModified(file, IO.lastModified(file))
val fileInfo: ModifiedFileInfo = FileModified(file, IO.getModifiedTimeOrZero(file))
val filesInfo = FilesInfo(Set(fileInfo))

it should "round trip" in assertRoundTrip(filesInfo)
Expand Down

0 comments on commit 0a1bd5a

Please sign in to comment.