mirror of https://github.com/sbt/sbt.git
commit
8f6e2fe371
|
|
@ -15,7 +15,7 @@ import ast.parser.Tokens
|
|||
import reporters.{ ConsoleReporter, Reporter }
|
||||
import scala.reflect.internal.util.{ AbstractFileClassLoader, BatchSourceFile }
|
||||
import Tokens.{ EOF, NEWLINE, NEWLINES, SEMI }
|
||||
import java.io.File
|
||||
import java.io.{ File, FileNotFoundException }
|
||||
import java.nio.ByteBuffer
|
||||
import java.net.URLClassLoader
|
||||
import java.security.MessageDigest
|
||||
|
|
@ -509,21 +509,18 @@ private[sbt] object Eval {
|
|||
if (f.isDirectory)
|
||||
(f listFiles classDirFilter) foreach { x =>
|
||||
fileModifiedHash(x, digester)
|
||||
} else digester.update(bytes(JavaMilli.getModifiedTimeOrZero(f)))
|
||||
} else digester.update(bytes(getModifiedTimeOrZero(f)))
|
||||
|
||||
digester.update(bytes(f.getAbsolutePath))
|
||||
}
|
||||
|
||||
// This uses NIO instead of the JNA-based IO.getModifiedTimeOrZero for speed
|
||||
object JavaMilli {
|
||||
import java.nio.file.{ Files, NoSuchFileException }
|
||||
def getModifiedTimeOrZero(f: File): Long =
|
||||
try {
|
||||
Files.getLastModifiedTime(f.toPath).toMillis
|
||||
} catch {
|
||||
case e: NoSuchFileException => 0L
|
||||
}
|
||||
}
|
||||
def getModifiedTimeOrZero(f: File): Long =
|
||||
try {
|
||||
sbt.io.JavaMilli.getModifiedTime(f.getPath)
|
||||
} catch {
|
||||
case _: FileNotFoundException => 0L
|
||||
}
|
||||
|
||||
def fileExistsBytes(f: File): Array[Byte] =
|
||||
bytes(f.exists) ++
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ object Dependencies {
|
|||
val baseScalaVersion = scala212
|
||||
|
||||
// sbt modules
|
||||
private val ioVersion = "1.1.5"
|
||||
private val ioVersion = "1.1.6"
|
||||
private val utilVersion = "1.1.3"
|
||||
private val lmVersion = "1.1.4"
|
||||
private val zincVersion = "1.1.3"
|
||||
private val zincVersion = "1.1.4"
|
||||
|
||||
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue