Add ios_test to xcode project generation.

Summary: And refactor unit tests a bit.

Test Plan: Add additional unit tests.
Project generation support of `IOSBinaryRule`.

Summary: This adds IOSBinary rule support to the xcode project generator.
Add dx code from KitKat.

Summary:
This is an export of the dx directory from the dalvik repository from
0f45d4c669a4b771ecbf2dcb533394ed62ec8cd7, which is just what
origin/master is at today.

This is not MOE-protected because we are going to be including our
changes in the Open Source Buck release.

Test Plan:
Buildbot.
Verified that the git tree has the same hash.
Add dex code from KitKat.

Summary:
This is an export of the dex directory from the libcore repository from
a6d2e94e518857b84ae2230a0f053eac77bae216, which is just what
origin/master is at today.

Test Plan:
Buildbot.
Verified that the git tree has the same hash.
Allow DexMerger to merge multiple dex files at a time.

Summary:
Previously, this class could only merge 2 dex files, which led to N^2
runtime when merging lots of dex files.  This version is about 10x
faster for my test case (about 100 dex files).

Most of the changes were just replacing "dexA", "dexB", and related
objects with lists and maps.  The only complicated part was the
hand-implemented 2-way merge algorithm, which I replaced with Guava's
Iterators.mergeSorted (which required implementing a proper iterator for
the section).

Note that I overwrite the uValue variable on a match because the old
code prefers writing the second value.  This should not matter since
they are presumably equal, but I figured I might as well preserve the
behavior.

Test Plan:
This is a port of a diff that we've been using in debug builds of FB4A,
Messenger, and Instagram for a few months.  All three still build and
start.
Update DX to use single-pass merging.

Summary:
Previously, when merging many dex files, DX would incrementally merge
each one into the sum of the previous ones, which required N^2 time.
Now we use the new DexMerger constructor to merge them all in a single
pass, which is linear-ish.

Test Plan:
This is a port of a diff that we've been using in debug builds of FB4A,
Messenger, and Instagram for a few months.  All three still build and
start.
Make /etc/dx executable and update the libdir variable.

Summary: This is necessary for executing dx out of the Buck build directory.

Test Plan: Did a build with dex merging.
Update scripts and configs to point at kitkat dx instead of jellybean.

Summary:
Just removing the (moe-stripped) gitignore line, because we don't build
dx with Buck anymore.

Test Plan: Built an app with dex merging.
The `GenStringSourceMapStep` can now be enabled by `passing build_string_source_map = true` to `android_binary()`.

Summary:
This is part 2. The first diff added the new build step, this diff makes
it available.  I'm amazed that I need all this code to add a simple
on/off option. It works, but I wish it was less code.

Test Plan:
`buck build pages`
To enable the new step, add this to fbandroid/BUILD_DEFS after line 712:
`build_string_source_map = (buck_package_type == 'release'),`
Remove dead buck code.

Summary: The convenience method `BuckBlockJUnit4ClassRunner#runTest()`
isn't used anywhere, and inhibits understanding of the code!

Test Plan: Build and test in a clean repo.
Fix buck test selectors (when using a custom runner and a timeout).

Summary: If you specify a test to `@RunWith(something else)` then
`org.junit.runner.Description`s aren't sent to the test filter for each
test method -- they are only sent for each test class.  It appears that
only `BuckBlockJUnit4ClassRunner` provides that, and this diff makes
sure we always use that runner when we're using test-selectors.

Test Plan: Test showing the bug (being fixed) included.
Remove assertExitCode().

Summary: Remove `assertExitCode(int)` and replace it with
`assertSuccess()`, `assertFailure()` and `assertTestFailure()`.

Test Plan: `buck test --all`
Add a special "buck test" exit code for test failures.

Summary:
If `buck test ...` executed correctly and found tests that failed, exit
with a specific exit code that means just that.

If something about Buck failed outside of a test failure, we just exit
with code 1.

Test Plan: `buck test --all`
Add ability to look for android ndk in a directory that can contain a range of ndks.

Test Plan:
Buck build fb4a with garbage NDK, verify ndk libs pulled from cache.

Set ndk.repository, verify we chose best ndk.
Fix how shell step logs process output to buck event bus.
Record build rule success type in build log.

Summary:
I plan to parse the `build.log` file in integration tests to verify if a rule
is not rebuilt because of matching ABI key.
Add first-order dependency analysis support to buck (part 1).

Summary:
This adds support for determining the classes that Dalvik requires in
the same dex to allow pre-verification of a class.

This is part of a series of changes to support scenario-guided
optimization of which classes to include in the primary dex.

Test Plan: Unit tests.
Add new types of buck test result.

Summary:
Instead of just pass / fail, add a new type of buck test result for
"assumption failure".  These failures represent tests that didn't pass,
but also didn't start from the solid set of assumptions required to say
they are definitely failing either.

As an example, in Bully in FB4A, we'll fail tests with assumption
failures for things like intern endpoint failures, when verifying some
UI action has had an effect on the backend.

This diff changes the Facebook test-console integration to mark tests as
"skipped" if they have assumption failures, and no other non-assumption
failures.c

Test Plan:
Create a pair of JUnit test classes: one with all assumption failures,
and one with assumption failures and a real error.

On the command line, the former passes, and the latter fails.
Improve module names.

Summary:
Rename some Buck module names so that they are readable, without
spelling mistakes:

| Before                  | After                    |
| ----------------------- | ------------------------ |
| `.../test/resulttype`   | `.../test/result/type`   |
| `.../test/resultgroups` | `.../test/result/group`  |

Test Plan: `ant clean && ant && buck build buck && buck test --all`
Respect label priority in `buck test --exclude x --include x+y`.

Summary:
Selecting test rules with label sets was a bit janky.  We had two
options that respected inclusion before exclusion, which meant we
couldn't include everything with `labelA` but not if it had `labelB`.
The practical consequnce of this is in the attached task, and tested in
`TestCommandTest#testLabelPriority()`.

This diff also de-stringly-types labels in the codebase.

Test Plan: Included tests.