mirror of https://github.com/sbt/sbt.git
The FileTreeViewConfig abstraction that I added was somewhat unwieldy and confusing. The original intention was to provide users with a lot of flexibility in configuring the global file tree repository used by sbt. I don't think that flexibility is necessary and it was both conceptually complicated and made the implementation complex. In this commit, I add a new boolean flag enableGlobalCachingFileTreeRepository that toggles which kind of FileTreeRepository to use globally. There are actually three kinds of repositories that could be returned: 1) FileTreeRepository.default -- this caches the entire file system tree it hooks into the cache's event callbacks to create a file event monitor. It will be used if enableGlobalCachingFileTreeRepository is true and Global / pollingGlobs := Nil 2) FileTreeRepository.hybrid -- similar to FileTreeRepository.default except that it will not cache any files that are included in Global / pollingGlobs. It will be used if enableGlobalCachingFileTreeRepository is true and Global / pollingGlobs is non empty 3) FileTreeRepository.legacy -- does not cache any of the file system tree, but does maintain a persistent file monitoring process that is implemented with a WatchServiceBackedObservable. Because it doesn't poll, in general, it's ok to leave the monitoring on in the background. One reason to use this is that if there are any issues with the cache being unable to accurately mirror the underlying file system tree, this repository will always poll the file system whenever sbt requests the entries for a given glob. Moreover, the file system tree implementation is very similar to the implementation that was used in 1.2.x so this gives users a way to almost fully opt back in to the old behavior. |
||
|---|---|---|
| .. | ||
| sbt | ||
| xsbt | ||