Convert lastModified() calls to sbt.io.Milli.getModifiedTime()

This commit is contained in:
Antonio Cunei
2017-12-06 20:29:41 +01:00
parent 83f8eabfab
commit ccf149e8bf
3 changed files with 8 additions and 4 deletions
@@ -9,6 +9,7 @@ import java.io.File
import sbt.io.{ IO, Path }
import sbt.io.syntax._
import Path._
import sbt.io.Milli.getModifiedTime
class FileCommands(baseDirectory: File) extends BasicStatementHandler {
lazy val commands = commandMap
@@ -67,7 +68,8 @@ class FileCommands(baseDirectory: File) extends BasicStatementHandler {
def newer(a: String, b: String): Unit = {
val pathA = fromString(a)
val pathB = fromString(b)
val isNewer = pathA.exists && (!pathB.exists || pathA.lastModified > pathB.lastModified)
val isNewer = pathA.exists && (!pathB.exists || getModifiedTime(pathA) > getModifiedTime(
pathB))
if (!isNewer) {
scriptError(s"$pathA is not newer than $pathB")
}