Buffer contents of wanted-in-primary-dex items

Summary:
We do a pass on classes initially to add items that are required to be
in the primary dex.  At the same time, we remember the items we find
that would be good to put in the primary dex, but that are not
required.  After the initial pass, we go back and add as many of the
items from the wanted list.

However, by the time the second pass occurs, the files from the first
pass are closed.  This crashes when we try to use the entries we cached.

This change explicitly buffers the files we need for the second pass.

Test Plan: build katana and verify we hit this path in buck.
Unbreak soy docs

Summary:
A `/*` comment accidentally got introduced in D1229690, which made
docs/soyweb.prod die a violent death. Escape it with a hex literal.

Test Plan: `./docs/soyweb-local.sh` and point browser to http://localhost:9811/
Do not create a dummy R.java buildable for android libraries not depping any resources.

Summary: Also reverts the change to QuickstartIntegrationTest as a result.

Test Plan: buck test --all
Move some of the magic for determining generic types into a helper class.

Summary:
Rearranging deckchairs shortly before working on using the Description to calculate a
Buildable's RuleKey.

Test Plan: buck test --all
Remove an unused IOException when creating RuleKeys.

Summary:
In the distant past, we almost definitely threw an IOException in one of the leaf methods
when calculating a RuleKey. That is no longer the case, yet we thread the exception
through several classes and different methods. Time to clean this up.

Test Plan: buck test --all
Get rid of IntermediateDexRule and move the AbiRule interface of the buildable.

Summary:
I also renamed the buildable class because it was getting really hard to keep
the code well formatted. Feel free to suggest a better name or to just revert it.

I want this change because I am working on another diff that gets rid of the
builder classes in buildables.

Test Plan: buck test --all
Kill AbstractBuildable.Builder

Summary:
There's some boilerplate involved with creating the associated buildrule and
updating the rule resolver. One step at a time.

Depends on D1263073.

Test Plan: buck test --all
Make ExopackageInstaller.logFiner private

Summary: This was public by accident.

Test Plan: Buildbot.
Fix ExopackageInstaller when many dex files need to be deleted

Summary:
Previously, we were using one "rm" command to remove all extraneous
files in the exopackage data dir.  However, adb can only execute
commands up to (a little under) 1024 bytes, so we were failing.  Now,
break up the list of files to delete into chunks and rm each chunk
separately.

Test Plan:
Installed on a device that was previously failing (install after
rebase), plus unit test.
Improved bash completion support for buck commands

Summary:
This adds bash completion for long parameters, targets, paths, device
serials, and a couple others.

Test Plan:
- Verify each of the following under bash 3 (default for OS-X) and
  bash 4 (default for MacPorts and Linux):
  - buck bu[tab]
  - buck build --num[tab]
  - buck build src/com/facebook/bu
  - buck build src/com/facebook/buck/and
  - buck build src/com/facebook/buck/android:
  - buck build src/com/facebook/buck/android:st
  - buck build //src/com/facebook/bu
  - buck build //src/com/facebook/buck/and
  - buck build //src/com/facebook/buck/android:
  - buck build //src/com/facebook/buck/android:st
[buck] RFC: lastupgrade check

Summary: We should be writing out lastupgrade check so that Xcode doesn't ask people to upgrade right away

Test Plan: Generate FBIntent, open Xcode, look for no warnings
Disable StringStartsWith PMD check

Summary:
This check is way too aggressive. I don't think it's worth
it for Buck to turn:

  String.startsWith("f");

to

  String.charAt(0) == 'f'

Test Plan: arc diff
Remove an unused field from AndroidDexTransitiveDependenciesGraph.

Test Plan: sandcastle
Remove dead code.

Summary:
Inspection of the code tells us this isn't called any more. Deleting it to make the
code base a little cleaner.

Test Plan: buck test --all
Fix bad cast style

Test Plan: ant checkstyle
Create script to automatically fix lint issues.

Summary: This script just fixes "followed by whitespace" issues, but could be extended to fix more.

Test Plan: Fixed typecasts in next diff
Add checkstyle rule for having operators at the end of the last line.

Test Plan: ant lint
Compile uber R.java parallel with the aapt_package step.

Summary:
Revives D1202870 with an additional check to verify that the string assets zip
is actually created before running `ApkBuilderStep`.

D1202870 was reverted earlier because fbandroid release builds were intermittently
missing entire `/assets/strings` directory in the APK. The additional assertion in
this diff should help track the bug.

Test Plan: buck test --all
Update java_library docs to mention exported_deps

Summary: ^

Test Plan: `./docs/soyweb_local.sh`
Delete the unused ResourcesAttributeBuilder and SrcsAttributeBuilder classes.

Summary: The interfaces were only being used in instanceof checks. Time to nuke them.

Test Plan:
buck test --all
sandcastle