Fix 'buck audit input'

Summary:
Fix 'buck audit input'

AppleBundle was crashing 'buck audit input' on `for (Path input : rule.getInputs()) {...}`.
I changed all the instances of getInputsToCompareToOutput returning null to be safe.

Test Plan:
CI
Fix caching issue with android binary rules using preprocessor runs.

Summary:
smart-dex was using the class hashes from before the preprocessor runs.

This diff re-hashes jars after preprocessor scripts/proguard have run and
makes smart-dex use the new hashes.

Test Plan: Integration test added.
Correctly invalidate flavors from Parser cache on file change event

Summary:
A user reported the following scenario:

1) Repo has two targets `//foo:lib` and `//bar:lib`, where the latter depends on the former.
2) User runs `buck build //bar:lib#flavor`
3) File `foo/BUCK` is deleted
4) File `bar/BUCK` contains rule depending on `//foo:lib`, is
   changed to remove dependency
5) User runs `buck build //bar:lib#flavor` again
6) buckd raises an exception saying it can't find `//foo:lib`

I tracked this down to the logic in `Parser.invalidateDependents`
incorrectly relying on the cached map of (path -> JSON blob) pairs to
clean out the cached targets defined in `path` (by parsing the JSON
blobs and extracting the raw target names).

Unfortunately, only clearing out the raw target names from cache left
any flavors in cache, so they contained stale dependencies.

This diff adds a new multimap of (path -> [target1, target2,
target3-with-flavor, ...]) pairs to `Parser` so we can clear out all
cached targets of all flavors when the `BUCK` file at `path` is
invalidated, not just the raw target names.

I removed the logic which handled raw target names entirely from
`Parser.invalidateDependents`, since it's covered by the new map.  (We
can't remove `parsedBuildFiles` entirely since we still use it for
other purposes.)

Test Plan:
Unit test included. Before fix, test failed. After fix, test passed.

Reproduced scenario reported by user. Applied fix, scenario no longer caused an exception.
Fix audit owner command for rules that do not list all their inputs explicitly.

Summary:
For instance, input to the android_resource() rule is a directory. So earlier,
the audit owner command wouldn't work for files under the `res` directory.
With this diff, it checks if any of the inputs of the build rule is a prefix
of the command input.

Test Plan: Unit test.
Find python's default pex builder via the "path_to_pex_py" property

Summary:
When shipping buck as a PEX, we won't have access to the top-level
buck dir.

Test Plan: buck test --all
pexception: support building our pex building script as PEX

Summary:
This adds the necessary BUCK files and makes our pex builder script
schizophenic enough to run as both a standalone script and as a
part of a PEX.  By itself, this isn't entirely useful but is one of
the steps to ship buck as a giant PEX.

This also disables part of the twitter PEX code that auto-detects
the setuptools package from the system, as this got more problematic
to fake in our own `pkg_resources` module.

Test Plan: built as PEX and used it to build other PEX files
ExportFile: sub-class HasOutputName

Summary:
This allows python rules to namespace the output of export file rules
for use as python resources.

Test Plan: added test
Bump asm to 5.0.3 and jacoco to 0.7.2

Summary:
Update ASM to the latest released version. This necessitates an update of jacoco
to the latest version.

Test Plan: buck test --all --code-coverage
Rename ExoPackageInfo.metadata -> ExoPackageInfo.dexMetadata.

Summary: Because it will soon have ExoPackage.nativeLibsMetadata.

Test Plan: buck test --all
[mini-aapt] Do not look for xml id definitions/usages in xml files under values* directories.

Summary:
For a sample resource module with 100 strings per locale and about 40 locales,
this halves mini-aapt's execution time.

~670s vs ~300s

Test Plan: buck test --all
Revert mini-aapt change that introduced test failures.

Summary: This reverts commit 8ea205ff9277f948122f5dbe2f0d73a15ed4623e.

Test Plan: revert-hammer
Add methods to retrieve rule and raw path to SourcePathResolver.

Summary:
Getting a rule from a SourcePath that refers to the output of one
is trivial right now, but it will require a resolver when we
change the SourcePath to use a BuildTarget instead of a BuildRule.
This adds methods to SourcePathResolver to retrieve the rule whose
output a SourcePath refers to, and the raw path in the case it
doesn't refer to any rule's output.

Test Plan: CI
Move filterInputsToCompareToOutput and filterBuildRuleInputs to SourcePathResolver.

Summary:
Once the SourcePath subclass referring to outputs of BuildRule uses a
BuildTarget as reference, filterBuildRuleInputs will need access to a
SourcePathResolver. Move filterInputsToCompareToOutput for consistency
as well.

Test Plan: CI
Thread a SourcePathResolver through to RuleKey.Builder.

Summary:
As RuleKey.Builder needs to get the rules and paths SourcePathResolver, so
it's going to need a SourcePathResolver.

Test Plan: CI
Change BuildRuleSourcePath to BuildTargetSourcePath.

Summary:
This changes BuildRuleSourcePath to BuildTargetSourcePath. The class
still functions as a reference to the output of a rule, but it does
not hold a direct reference to the BuildRule, only to a BuildTarget.
This allows it to be created without having to create the BuildRule.
This is needed to be able to move the Description DTO creation to
parsing time, before the TargetGraph is transformed into an
ActionGraph.

Test Plan: CI
Remove BuildRuleResolver parameter from TypeCoercer#coerce.

Summary:
After changing ConstructorArg and SourcePath to use BuildTarget
instead of BuildRule, none of the TypeCoercer implementations
need BuildRuleResolver anymore. This removes it.

Test Plan: CI
Pass only SourcePathResolver in IosPostProcessResources.

Summary:
IosPostProcessResources receives a BuildRuleResolver, but only
really needs a SourcePathResolver. Most other BuildRule
implementations also only get a SourcePathResolver.

Test Plan: CI
Remove JavaLibrary#isVisibleTo.

Summary:
JavaLibrary#isVisibleTo is only used to checking suggested dependencies,
but introduces the visibility information, which shouldn't be needed in
either the target graph or the action graph, into the action graph.
While checking the target's visibility is a good thing it's not critical
enough to warrant this extra complication.

Test Plan: CI
Refer to static method directory by its name in AndroidBinary.

Summary: No logical change.

Test Plan: sandcastle
Add support for Objective-C and Objective-C++ to CxxSource

Summary:
I confirmed in Xcode the -x directives passed to clang for
Objective-C and Objective-C++, as well as the file extensions for
preprocessor output.

Test Plan: Updated CxxSourceTest, ran `ant java-test -Dtest.class=CxxSourceTest`