mirror of https://github.com/sbt/sbt.git
Use IO.getModified over importing the method
This commit is contained in:
parent
46d6b01f79
commit
ae99922101
|
|
@ -21,7 +21,6 @@ import java.net.URLClassLoader
|
|||
import Eval.{ getModule, getValue, WrapValName }
|
||||
|
||||
import sbt.io.{ DirectoryFilter, FileFilter, GlobFilter, Hash, IO, Path }
|
||||
import sbt.io.IO.getModifiedTime
|
||||
|
||||
// TODO: provide a way to cleanup backing directory
|
||||
|
||||
|
|
@ -488,11 +487,8 @@ private[sbt] object Eval {
|
|||
def fileModifiedBytes(f: File): Array[Byte] =
|
||||
(if (f.isDirectory) filesModifiedBytes(f listFiles classDirFilter)
|
||||
else
|
||||
bytes(try {
|
||||
getModifiedTime(f)
|
||||
} catch {
|
||||
case _: java.io.FileNotFoundException => 0L
|
||||
})) ++ bytes(f.getAbsolutePath)
|
||||
bytes(try IO.getModifiedTime(f) catch { case _: java.io.FileNotFoundException => 0L })) ++
|
||||
bytes(f.getAbsolutePath)
|
||||
def fileExistsBytes(f: File): Array[Byte] =
|
||||
bytes(f.exists) ++
|
||||
bytes(f.getAbsolutePath)
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ import sbt.io.{
|
|||
DirectoryFilter,
|
||||
Hash
|
||||
}, Path._
|
||||
import sbt.io.IO.getModifiedTime
|
||||
import sbt.librarymanagement.Artifact.{ DocClassifier, SourceClassifier }
|
||||
import sbt.librarymanagement.Configurations.{
|
||||
Compile,
|
||||
|
|
@ -2316,7 +2315,7 @@ object Classpaths {
|
|||
case Some(period) =>
|
||||
val fullUpdateOutput = cacheDirectory / "out"
|
||||
val now = System.currentTimeMillis
|
||||
val diff = now - getModifiedTime(fullUpdateOutput)
|
||||
val diff = now - IO.getModifiedTime(fullUpdateOutput)
|
||||
val elapsedDuration = new FiniteDuration(diff, TimeUnit.MILLISECONDS)
|
||||
fullUpdateOutput.exists() && elapsedDuration > period
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import sbt.internal.librarymanagement._
|
|||
import sbt.librarymanagement._
|
||||
import sbt.librarymanagement.syntax._
|
||||
import sbt.util.{ CacheStore, CacheStoreFactory, Logger, Tracked }
|
||||
import sbt.io.IO.getModifiedTime
|
||||
import sbt.io.IO
|
||||
|
||||
private[sbt] object LibraryManagement {
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ private[sbt] object LibraryManagement {
|
|||
}
|
||||
|
||||
private[this] def fileUptodate(file: File, stamps: Map[File, Long]): Boolean =
|
||||
stamps.get(file).forall(_ == getModifiedTime(file))
|
||||
stamps.get(file).forall(_ == IO.getModifiedTime(file))
|
||||
|
||||
private[sbt] def transitiveScratch(
|
||||
lm: DependencyResolution,
|
||||
|
|
|
|||
Loading…
Reference in New Issue