Add resources_root to the rule key of DefaultJavaLibrary.

Summary:
I forgot to do this when I defined the resources_root field. This
makes sure the rule is rebuilt if the resources_root is changed.

Test Plan:
Define a random library in fbandroid, change the resources_root field, and
confirm that it rebuilds. (Also that it didn't before.) Note that this doesn't
repro in the buck project (that is, changing resources_root does cause a
rebuild, even without this diff), and even setting cache.mode doesn't make it
repro.  What config could it be?
Reverting previous commit and removed try-catch from CollectionTypeCoercer.fill

Summary:
Error message now looks like:
  java.lang.RuntimeException: Failed to coerce field named: srcs, src/com/facebook/buck/rules: Cannot coerce argument 'DoesNotExist.java' to interface com.facebook.buck.rules.SourcePath
with no duplicate

Test Plan: Built buck with src list containing an invalid source path
Remove an obsolete comment

Summary: The todo was done.  Yay.

Test Plan: Buildbot.
Make ProGuardObfuscateStep.create append steps to a builder

Summary:
No need to use a composite step for this, and breaking it out improves
reporting quality.  It also makes it easier to test the output.

Test Plan: Buildbot.
Allow using proguard without the Android SDK proguard config.

Summary:
Previously, we had a boolean that let you select between the default and
optimized configs from the sdk, but no way to omit that config entirely
(and presumably substitute your own modified version).  This replaces
that arg with an enum version that lets you select any of the three
possibilities.

The old argument is still respected, but the conversion is done entirely
within AndroidBinaryDescription.

Test Plan:
Unit tests.  Built one of our own apps with no default config and saw
the proguard command line change appropriately.
Fix build break in unit test

Summary: Sorry.

Test Plan:
buck test --all
(Successfully builds.)
Fix lint error in ProGuardObfuscateStep

Summary:
D1360166 introduced a lint error in ProGuardObfuscateStep
(declared variable unused if we throw).

This removes the variable in favor of inline usage and adds a
test.

Test Plan: Unit test included.
Add the cause exception string when failing to write the chrome trace file.

Test Plan: Unit Tests
Refactor (file extension -> Apple UTI) map and add inverse

Summary:
To parse .xcspec files, I need to re-use the mapping from
(file extension -> Apple UTI).

I actually need the inverse mapping, so this refactors the data into
a new class com.facebook.buck.apple.FileTypes and adds the inverse.

Test Plan: Unit tests included.
Deduplicate some logic in autodeps target printing.

Summary:
BuildTarget has some nice methods that we should've been using. As part of this
cleanup, make sure `BuildTarget.getBuildFilePath()` returns a relative path
instead of an leading-slash-rooted (but not properly absolutified!) path.

Test Plan:
Make sure autodeps is still outputting the right thing.  Update some unit tests
to no longer expect the leading slash. (Why was this ok before?!)
Fix a lint error.

Summary: I broke the build.

Test Plan: The build is fixed.
Add JavaPackageFinder to ExecutionContext.

Summary:
This is an alternative to adding it to JavacStep. Unfortunately, it does a
comparable amount of damage. Diffing to compare.

Test Plan: `buck test --all`
Make autodeps support missing symbols in the current package.

Summary:
When a java package is divided up into multiple java_library rules, it's
possible for those rules to be missing deps on one another. In that case, there
will be no package name given with the missing symbol in the compiler error
(because java allows different files in the same package to reference each
other's symbols unqualified). We need to infer the package in these cases.

This diff uses `JavaPackageFinder` along with the path of the source file to
infer the package. Here we attach the package finder to
`ExecutionContext` (as opposed to a previous approach where we put it
directly in `JavacStep`). The jury is still out on which one we prefer.

Test Plan: New unit tests for `JavacErrorParser`.
Have autodeps return targets like ':foo' where appropriate.

Summary:
Now that autodeps can handle missing deps in the same package, it should also
be able to take advantage of our nice concise syntax for referencing targets in
the same package.

Test Plan: Expand the existing tests to cover this case.
Interrupt the current thread on catching InterruptedExcepted in the test runner.

Summary:
ProcessExecutor catches an InterruptedException to kill the child process, but
since the exception was swallowed earlier, that catch/finally block would never
run leaving zombie child processes behind. This explains why buck test --debug
after interrupting an earlier buck test --debug invocation would not be able to
bind to port 5005.

Test Plan:
With buckd on,
buck test javatests/com/facebook/cache:cache --debug
Wait for the junit process to start and then Ctrl+C
run buck test --debug again and verify that it works.
Handle nullable exception messages cleanly in BuckEventAndroidLogger.

Summary:
The Android classes appear to use @NonNull when a parameter can't be null, which is the exact
opposite way that the rest of the Buck code deals with these things. According to the docs,
both the `throwable` and `errorFormat` parameters to Android's `ILogger.error()` method are
optional.

Test Plan:
buck test --all
Visual inspection.
Buck iOS SDK: Read default compiler from SDKSettings.plist

Summary:
The next step in building iOS code with Buck is to
apply the correct compiler and linker flags as defined by
.xcconfig files.

The meaning of the key-value pairs in .xcconfig files is
defined in .xcspec files bundled in Xcode plugins.

To discover which .xcspec file to use, we need to know which default
compiler Xcode wants to use. This (along with other default xcconfig
settings) is defined in a file SDKSettings.plist that comes with
Xcode.

This diff adds a new class com.facebook.apple.xcode.xcspec.SDKSettings
which parses the SDKSettings.plist file and extracts the default
settings (including the default compiler).

Test Plan: Integration test included.
Make small correction in .buckconfig docs

Summary:
The description above the cache config example was incorrect. I also
capitalized several instances of "Buck" to be consistent with the rest of the
document.

Test Plan:
Acquire several volunteers. Show them the documentation page for
.buckconfig and collect their comments about the accuracy of the example
descriptions and the consistency of the capitalization.
Make coercion errors human friendly

Summary:
Previously, failed coercions of input parameters would generate
runtime exceptions, which produced gross stack traces when they
hit the user.  This diff typifies and propgates exceptions generated
from coercion up high enough so that we can attach more human friendly
output like the build target.

This diff also changes how container types (e.g ##AppleSourceCoercerType##, ##CollectionTypeCoercer##)
throw their errors.  Catching coercion errors of their elements and
rethrowing with the entire collection (as is generally done now) doesn't
appear to be that useful to the user (as the user can typically locate
this information from the BUCK file).  This behavior has been changed
to allow the inner coercion errors to propagate out, which seem to lead
to significantly easier to understand errors.

Test Plan: Ran buck on a variety of malformed BUCK files: P12118587.
Fix breakages from D1387891

Summary:
With CI down, D1387891 broke various things.  This fixes the buck
build and a unittest.

Test Plan: tested locally