mirror of https://github.com/sbt/sbt.git
Don't try to stamp files that don't exist
This was causing slowdowns in windows.
This commit is contained in:
parent
de3c09f99d
commit
16afe41cc1
|
|
@ -11,7 +11,7 @@ import java.io.{ File => JFile }
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
|
||||||
import sbt.internal.FileCacheEntry
|
import sbt.internal.FileCacheEntry
|
||||||
import sbt.internal.inc.Stamper
|
import sbt.internal.inc.{ EmptyStamp, Stamper }
|
||||||
import sbt.io.TypedPath
|
import sbt.io.TypedPath
|
||||||
import xsbti.compile.analysis.Stamp
|
import xsbti.compile.analysis.Stamp
|
||||||
|
|
||||||
|
|
@ -47,13 +47,14 @@ private[sbt] object Stamped {
|
||||||
* A combined convert that converts TypedPath instances representing *.jar and *.class files
|
* A combined convert that converts TypedPath instances representing *.jar and *.class files
|
||||||
* using the last modified time and all other files using the file hash.
|
* using the last modified time and all other files using the file hash.
|
||||||
*/
|
*/
|
||||||
val converter: TypedPath => Stamp = (tp: TypedPath) =>
|
val converter: TypedPath => Stamp = (_: TypedPath) match {
|
||||||
if (tp.isDirectory) binaryConverter(tp)
|
case typedPath if !typedPath.exists => EmptyStamp
|
||||||
else {
|
case typedPath if typedPath.isDirectory => binaryConverter(typedPath)
|
||||||
tp.toPath.toString match {
|
case typedPath =>
|
||||||
case s if s.endsWith(".jar") => binaryConverter(tp)
|
typedPath.toPath.toString match {
|
||||||
case s if s.endsWith(".class") => binaryConverter(tp)
|
case s if s.endsWith(".jar") => binaryConverter(typedPath)
|
||||||
case _ => sourceConverter(tp)
|
case s if s.endsWith(".class") => binaryConverter(typedPath)
|
||||||
|
case _ => sourceConverter(typedPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue