Add implicit dep for default C++ test type

Summary:
Previously ##cxx_test## would default to gtest if no explicit test
type was set, but wouldn't add the implicit dependency.

Test Plan: added test
Make `CxxBinary.getExecutableCommand()` return a resolved path

Summary:
This previously wasn't being resolved, which made it useless when
used by genrules.

Test Plan: added test
Use mini-aapt to generate R.txt of android resources.

Summary:
Previously, we were invoking `aapt` to generate the R.txt file for an
android_resource() rule, and passing it resource directories from all the
transitive android_resource depenedencies.

With this diff, we use `MiniAaptStep` to generate a similar `R.txt` file,
but it only contains symbols from the android resource module and not its
transitive dependencies. Also, we only pass the first order dependencies
of the android resource rule. As a result, the ABI key also includes just
the first order deps now.
Use the first order deps of android libraries to compute the dummy R.java.

Summary:
Pretty much what the title says.

In order to support `aar`s, I had add a new dummy build rule, which is both
an android library and android resource (because we no longer look for all
android resource rules in the transitive closure).

Test Plan: buck test --all
Combine generating R.java and packaging resources in the same aapt invocation.

Summary:
Previously, we used `UberRDotJava` to generate the uber R.java file using `aapt`
and `AaptPackageResources` to generate the resource APK, i.e. APK containing
the compiled resources and assets. This was done so that we could compile and dex
the R.java as soon as it was available and not block dependent rules. That is no
longer a restriction with pre-dexing.

This diff merges the two into `AaptPackageResources`. As a side-effect, this
generally reduces build times because we only have one aapt invocation running
(even though previously the 2 invocations were run in parallel).

Test Plan: buck test test/com/facebook/buck/android
Import pathlib (BSD license) to third-party/py

Summary:
I'm replacing buck.py's glob() with the one from pathlib.

This imports the unmodified pathlib from
https://bitbucket.org/pitrou/pathlib/src (revision 182) to
third-party/py/pathlib.

I updated build.xml to run pathlib's tests under py-test.

@ignore-conflict-markers

Test Plan: ant py-test
Switch back to transitive resource dependencies for Robolectric tests.

Summary:
Apparently, first order deps are enough to get the rules built, but not enough
to actually run them. So switch back to transitive deps, while still using
mini-aapt.

Robolectric also expects the styleable array to be of the same size as the
number of <attr> nodes inside the <declare-styleable> node. It doesn't
matter what the resource ids are though, so just use `0x7f000000`.

Test Plan:
Add a unit test.
sandcastle
Easy: Add logging to ChromeTraceBuildListener

Summary:
I was surprised to find the Chrome trace build listener
happened after the nailgun client disconnected. This adds debug
logs so we know when it happens.

Test Plan: buck build buck, see output in buck-out/log/buck-0.log
More cygwin jiggery-pokery.

Summary:
As suggsted by David Ostrovsky. This introduces the following:

1. git tree can be retrieved for some reasons: fake it for now.
2. path and separator translation between Cygwin and Windows path
   to make Java happy.

I am reliably informed that this gets Buck up and running on Windows, but
not to the point where compilation succeeds, because Python can't be found.
For that to work, the "[tools] -> python" section in `.buckconfig` needs to
be set to (probably) a Windows path.

Test Plan:
Complete hearsay about the ability to run on Cygwin
Still works on OS X.
Pass build ID from 'buck' Python launcher to Java

Summary:
Currently, buckd determines each command's build ID by
generating a random UUID each time a client connects.

We'd like to have consistent Chrome trace logs between Python
and Java, so this diff:

1) Generates the build ID UUID in Python, and
2) Passes the build ID up to Java via the BUCK_BUILD_ID system
environment variable

Test Plan:
Confirmed both Python and Java wrote traces with the
same build ID:

  % buck project
  % ls -l buck-out/log/traces/{build,launch}.trace
    buck-out/log/traces/build.trace -> buck-out/log/traces/build.2014-09-25.13-53-20.31c8975e-a300-496f-8e18-424c6e34ba88.trace
    buck-out/log/traces/launch.trace -> buck-out/log/traces/launch.2014-09-25.13-53-20.31c8975e-a300-496f-8e18-424c6e34ba88.trace

Tested `NO_BUCKD=1 buck build buck`, confirmed it worked.

Set `port = 8081` in `[httpserver]` in `.buckconfig.local`, confirmed http://localhost:8081/traces worked and I could load build traces.
Ensure we print buck.py stderr to logs

Summary:
Currently, `ProjectBuildFileParser` ensures it writes
buck.py's stderr to `Console`, but nothing ensures stderr goes to the
logs.

I've been working on improving `buck.py`'s `glob()` method, and it was
really difficult to diagnose problems via Buck's debug logs.

To help with that, this diff introduces an optional delegate
`InputStreamConsumer.Handler` which allows users of
`InputStreamConsumer` to get a callback for each line of input.

I use the delegate from `ProjectBuildFileParser` to log a warning
to the debug logs for each line printed by buck.py to stderr.

(Unlike error logs, we do not send warning logs to the console -- only
to the debug logs on disk.)

Test Plan:
Added `print >>sys.stderr, "Oops"` to `buck.py`. Confirmed
it showed up on console and in the logs.
Fix workspace generation including all projects in all generated workspaces.

Summary:
Workspace used to include projects in the same BUCK files as the targets they
depended on. This meant it would miss projects defined in separate BUCK files.
When this was fixed initially a regression was introduced where workspaces
would include all projects when being generated together. This fixes that and
add a new regression test.

Test Plan: CI, new unit test, run buck project --workspace-and-projects in repo
Remove dead code from UberRDotJavaUtil.

Test Plan: sandcastle
Update infer annotations file.

Test Plan: buck build buck
Fix ant default.

Test Plan: sandcastle
Update IntelliJ project.

Summary:
Update IntelliJ project to refer to new version of third
party library.

Test Plan: CI
Ignore hidden files when processing resource file names.

Test Plan: Unit test.
Remove ConstructorArg

Summary:
`ConstructorArg` adds noise to class signatures and doesn't provide any concrete
information to developers, since `Description` returns an argument of type `T`.
Since it's not providing useful signal, it should be removed.

Test Plan: buck test --all
The `UberRDotJava` class is unused.

Summary: "I see dead code".

Test Plan: buck test --all
Treat assumptions as errors

Summary:
We already have an option `test.assumptions-are-errors` that treats an assumption-violated-exception as an error in that it prints the full stack trace.

This diff extends the notion of `assumptions-are-errors` by exiting with a non-zero exit status if assumption-violatied-exceptions occur.

Test Plan:
Updated the test project in `test/com/facebook/buck/junit/testdata/assumption_violations/` with a `.buckconfig` that turns on `tests.assumptions-are-errors`, and checked that the exit status was 42.

If we land this diff I'll write a real test; I'm trying to rush this diff out to help fix a problem in CT-scan.