mirror of https://github.com/sbt/sbt.git
Change modifiedTime definitions
This commit is contained in:
parent
8ba68eedfd
commit
0a1bd5a3b2
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue