Replace InputRule with Path.

Updated `ConcurrentMapFileHashCache` to use a `LoadingCache` to maintain the
mapping from `Path` to `HashCode`.

Previously, `InputRule` contained four fields (`File`, `BuildTarget`, `ListenableFuture`, `RuleKey`).
We had one of these for potentially every file in a project. That is a large potential for
wasted memory. The existence of `InputRule` also required us to persist some kludginess in

This diff removes the hacks from `BuildTarget` and reclaims potentially a ton of memory.
By using a `LoadingCache`, we do not have to worry about the same input file being sha1'd
multiple times. We can also stop passing around references to a pathResolver in many places
and rely on `Path` being a path relative to the project root.

Test Plan: Sandcastle builds.
33 files changed
tree: 0b014ba9f98992d9579aabdb490963e57efb1ba5
  1. .buckconfig
  2. .classpath
  3. .gitignore
  4. .idea/
  5. .project
  6. DEFS
  9. bin/
  10. buck.iml
  11. build.xml
  12. config/
  13. docs/
  14. lib/
  15. plugin/
  16. pmd/
  17. scripts/
  18. src/
  19. test/
  20. testdata/
  21. third-party/


Buck is an Android build tool. To see what Buck can do for you, check out the documentation at


To build Buck, run the following:

git clone
cd buck
./bin/buck --help


Apache License 2.0