Introduce preprocess_java_classes_bash option to android_binary.

Summary:
This introduces a new pair of options to `android_binary`:
`preprocess_java_classes_deps` and `preprocess_java_classes_bash`.
Together, these options give the developer the opportunity to
pre-process the `.class` files for the APK before they are fed into ProGuard.

`preprocess_java_classes_bash` is a `genrule`-like `bash` argument that must contain
the strings `$IN_JARS_DIR` and `$OUT_JARS_DIR`. Just like in a `genrule`,
`preprocess_java_classes_bash` may contain `$(exe //build:target)` or
`$(location //build:target)` expressions so long as the target is listed in
`preprocess_java_classes_deps`. (This also ensures that any such targets are
built before the `android_binary` rule itself.)

The contract is that the executable must write out the contents of
`$OUT_JARS_DIR` so that the file structure matches that of `$IN_JARS_DIR`
exactly.

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

Buck

Buck is an Android build tool. To see what Buck can do for you, check out the documentation at http://facebook.github.io/buck/.

Installation

To build Buck, run the following:

git clone git@github.com:facebook/buck.git
cd buck
ant
./bin/buck --help

License

Apache License 2.0