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
Introduce AndroidPackageable interface to collect artifacts that go into an APK.

Summary:
An `AndroidPackageable` decides what artifacts should end up in an APK as well
as other dependencies that need to go with it. The motivation behind doing this
is android_resource can remove its runtime dependency on android libraries while
at the same time ensuring that those dependencies end up in the APK.

This essentially distributes the logic in `AndroidTransitiveDependencyGraph` down
to the individual build rules. `AndroidPackageableCollection` is the union of
`AndroidTransitiveDependencies` and `AndroidDexTransitiveDependencies`.

Test Plan:
buck test --all
buck build instagram
SortedSetTypeCoercer: throw error on duplicate elements

Summary:
Previously, the ##SortedSetTypeCoercer## class would silently throw
away duplicates when converting from listy types.  This diff changes
this behavior so it throws a coersion error instead.

This probably isn't a huge deal for how we currently use this class,
as it's typically used to convert from a list of homogenous types.
However, when used with a collection of heterogenous types, where
some objects of different types are determined to be equal by the
comparison function, then this will help catch weird cases where
one of the objects is silently overriden (e.g. for the case of a
"named" source path, where a source path derived from a listed source
has the same "name" as a source path derived from a build target
representing a genrule).

Test Plan: added a unittest
Surface watchman query errors.

Summary:
Currently Watchman returns some errors as query results
without returning a non-zero exit status
(https://github.com/facebook/watchman/issues/42). This change surfaces
those errors as HumanReadableExceptions rather than silently
swallowing the errors and treating them as empty file change sets.

Test Plan: buck test --all
Correctly propagate InterruptedExceptions.

Summary:
Buck handles client disconnections by interupting the command
processing thread, unfortunately a number of exception handlers would
swallow the generated InterruptedExceptions resulting in command
execution to continue when it should have halted. This mostly
mechanical refactoring removes the erroneous InterruptedException
catch blocks and adds InterruptedException to the list of exceptions
thrown by affected methods. Where this is not possible due to the
method signature being defined by a system interface, the interruption
is propagated using Thread.currentThread().interrupt() which is the
correct way to preserve state when propagating interruptions.

Test Plan: buck test --all
Support file attributes in ProjectFilesystem and FakeProjectFilesystem

Summary:
I want to create generated projects as read-only, so people
don't try to modify them.

This adds support to ProjectFilesystem and FakeProjectFilesystem for
file attributes.

Test Plan: Unit and integration tests included.
Write Xcode projects, workspaces, and header maps as read-only

Summary:
We're soon going to remove the checked-in Xcode projects
from fbobjc.

This diff uses the new functionality from D1401826 to write
read-only Xcode projects, workspaces, and header maps.

I confirmed the Xcode UI handles this gracefully; it prompts
the user to let them know the project file is not writable
(it says "locked") if they try to change it.

Depends On D1401826

Test Plan: Integration test included.
Support change in zipalign path in Android SDK >= 19.1.0

Summary:
Google, as they often do, decided that it'd be fun to change the SDK file
structure. Earlier, there was one zipalign to rule them all under `<sdk>/tools/`.
Now apparently there's one per build tools version. i.e.
`<sdk>/build-tools/19.1.0/`, `<sdk>/build-tools/20.0.0`.

Test Plan:
Update my Android SDK. Notice `tools/zipalign` is gone and without this diff,
running buck build instagram fails with something similar to P12588785.

buck build instagram works after applying this diff!

Unit tests.
Add XCVersionGroup PBXReference to support editing xcdatamodeld files in generated projects.

Summary:
Versioned Core Data model files added to BUCK generated projects cannot be edited because they're added as PBXFileReference instead of XCVersionGroup.
This adds a PBXReference subclass to represent XCVersionGroup, and adds logic to generating them to ProjectGenerator.
Fixes T4335882

Test Plan: Run new tests, try to generate Apps/Tango project and edit Core Data model in TangoLib/Resources
Easy: Enable @SuppressWarnings("checkstyle.foo")

Summary:
In D1405028, I imported some open-source which fails
checkstyle. This allows us to use

  @SuppressWarnings({"checkstyle.foo","checkstyle.bar"})

to disable particular checkstyle warnings in Buck.

Test Plan: Used @SuppressWarnings("checkstyle.foo") in D1405028.
Allow step execution to be interrupted.

Summary:
Previously step processing occured uninterruptibly, which
meant that it could not be cancelled when a client disconnection was
detected. This change makes step execution interruptible so that
client disconnection can correctly cancel command execution.

Test Plan: buck test --all
Remove redundant catch block.

Summary:
Now that
BuildCommand.executeBuildAndPrintAnyFailuresToConsole throws
IntteruptedExceptions it no longer needs to catch them.

Test Plan: buck test --all
Remove redundant annotation.

Test Plan: buck test --all
Merge build rules and buildables.

Summary:
Reverse take-over of `BuildRule` by `Buildable`.

Changes:
- `Description.createBuildable(BuildRuleParams, Arg)` is now
  `Description.createBuildRule(buildRuleParamsWithDeclared, extraDeps,
  buildRuleResolver, arg)` and is additionally responsible for graph
  enhancement. As a result, we no longer use the `DependencyEnhancer`
  interface. Descriptions which do not perform graph enhancement
  basically pass
  `buildRuleParamsWithDeclaredDeps.copyWithAdditionalDeps(extraDeps)` to
  the build rule that they create. It's unfortunate that descriptions
  need to track this, but I found it hard to avoid this because we no
  longer have a `DescribedRule` that wraps a `Buildable`. However, with
  graph enhancement being done prior to constructing the build rule,
  rule objects are now immutable.
- java_library() used to stash union(declaredDeps, exportedDeps) and use
  that for computing transitive classpath entries (because we don't want
  to include provided deps). This was exposed as
  `DefaultJavaLibrary.getDeps()` which now clashes with
  `BuildRule.getDeps()`. As a result, I defined
  `JavaLibrary.getDepsForTransitiveClasspathEntries()`. Earlier this
  value was strictly `union(declaredDeps, exportedDeps)`; now it's
  `union(declaredDeps, inferredDeps) - providedDeps` which I feel is
  correct.
- Deleted `DescribedRuleBuilder` and `DescribedRuleFactory` which were
  anyways not being used (to get buck compiling). Also the relevant unit
  tests.

Test Plan:
buck test --all
sandcastle
Remove now dead Android*TransitiveDependencies code.

Summary: redparty

Test Plan: buck test --all