mirror of https://github.com/sbt/sbt.git
Use managedFileStampCache for dependency classpath
It is redundant and slow to restamp all of the dependency classpath files when they have likely already been stamped by a subproject. For the classfiles of subprojects, we fill the managedFileStampCache with the values returned by the zinc compile analysis product stamps. This is why they are probably already in the managed cache and should be up to date so long as zinc is working correctly. I noticed that various outputFileStamps tasks were showing up in the task timing report when I ran Test / definedTests in the main sbt project. That task became about 400ms faster after this change.
This commit is contained in:
parent
a7dd86939f
commit
c525fa2551
|
|
@ -2041,7 +2041,12 @@ object Classpaths {
|
||||||
excludeFilter in unmanagedJars value
|
excludeFilter in unmanagedJars value
|
||||||
)
|
)
|
||||||
).map(exportClasspath) ++ Seq(
|
).map(exportClasspath) ++ Seq(
|
||||||
sbt.nio.Keys.dependencyClasspathFiles := data(dependencyClasspath.value).map(_.toPath),
|
dependencyClasspathFiles := data(dependencyClasspath.value).map(_.toPath),
|
||||||
|
dependencyClasspathFiles / outputFileStamps := {
|
||||||
|
val cache = managedFileStampCache.value
|
||||||
|
val stamper = outputFileStamper.value
|
||||||
|
dependencyClasspathFiles.value.flatMap(p => cache.getOrElseUpdate(p, stamper).map(p -> _))
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
private[this] def exportClasspath(s: Setting[Task[Classpath]]): Setting[Task[Classpath]] =
|
private[this] def exportClasspath(s: Setting[Task[Classpath]]): Setting[Task[Classpath]] =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue