only look at .class file modified times in Eval

previously, for a directory on the classpath,
  all files and directories under it would be checked
this caused unnecessary setting recompilation when
  non-classfiles changed in the directory
One example was the sbt.plugins file, which doesn't affect
  compilation, and caused projects with plugins to take longer
  than necessary to start up
This commit is contained in:
Mark Harrah 2011-04-12 20:24:42 -04:00
parent 4b70fe0921
commit 6e3a7083e2
1 changed files with 3 additions and 2 deletions

View File

@ -199,8 +199,7 @@ private object Eval
def bytes(b: Boolean): Array[Byte] = Array[Byte](if(b) 1 else 0)
def filesModifiedBytes(fs: Array[File]): Array[Byte] = if(fs eq null) filesModifiedBytes(Array[File]()) else seqBytes(fs)(fileModifiedBytes)
def fileModifiedBytes(f: File): Array[Byte] =
bytes(f.lastModified) ++
(if(f.isDirectory) filesModifiedBytes(f.listFiles) else bytes(-1 : Int)) ++
(if(f.isDirectory) filesModifiedBytes(f listFiles classDirFilter) else bytes(f.lastModified)) ++
bytes(f.getAbsolutePath)
def fileExistsBytes(f: File): Array[Byte] =
bytes(f.exists) ++
@ -219,4 +218,6 @@ private object Eval
buffer.putInt(i)
buffer.array
}
private val classDirFilter: FileFilter = DirectoryFilter || GlobFilter("*.class")
}