twitter/commons — pull request #49 by benjyw (2012-07-29 21:04:22+00:00)
Title: Pants build cache refactor.

The build cache handled 3 different concerns. It has now been split into 3 classes, each modeling one concern:

+ CacheKeyGenerator: Creates a unique hash of source files.

+ BuildInvalidator: Stores a map of target->CacheKey, so it can keep
track of the current version of the target.

+ ArtifactCache: A map from CacheKey->build artifact, so it can retreive
multiple versions of a given target.

This change also hooks up the artifact cache, so that now it is possible
to build, make a change, rebuild, and then revert to the original state
without rebuilding again.

It is a fairly simple matter to add a distributed, shared artifact cache
on top of this infrastructure, which would be a huge performance win.