Rename the ArgObjectPopulatomatic to ConstructorArgMarshaller.

Summary:
When this class was added, it wasn't clear what a sensible name for it would be, and so
a totally unsuitable and ludicrous one was picked. As work on the plugin API has
progressed, the intent of this class has become clearer, and a better name can now be
selected.

Test Plan: buck test --all
Remove unnecessary @SuppressWarnings.

Test Plan: Created a fresh install of Eclipse and discovered this.
Get rid of absolute filepaths in sh_binary.

Summary:
The output of sh_binary can be fetched from cache, so it's important
that it doesn't contain any absolute filepaths from the machine that built it.
Instead, fetch the location of the script at runtime, and determine paths
relative to that.
Fix Eclipse warning about unresolved class reference in Javadoc.

Test Plan:
Sandcastle builds.
Saw warning in Eclipse go away.
Don't attempt to clean up .iml files; always warn to restart IntelliJ.

Summary: This was breaking teams that use symlinks.
Allow android_library rules to export their deps.

Test Plan: Unit tests
Change recordArtifact() to take a path relative to the project root.

Summary:
Previously, `BuildInfoRecorder.recordArtifact()` took a path relative to a
rule's `buck-out/gen/<build-target-base-path>` directory. This required all sorts
of path gymnastics to ensure that the correct path was recorded.

This diff simplifies things by taking a path relative to the project root,
which is what most BuildRules operate in, anyway. It also makes it more
straightforward to record files from under the `buck-out/bin` directory.

Test Plan: Sandcastle builds.
Fix BuckEventBus thread leak.

Summary:
Make BuckEventBus Closable, clean up its ExecutorService in
the overridden close method and allocate it in a try-with-resources
block around command execution to avoid Buck leaking threads when run
as buckd.

Test Plan:
0) buck test --all
1) buckd
2) for DIR in find . -type d; do buck query "$DIR ->"; done
3) killall -3 java
4) grep BuckEventBus .buckd/buckd.log
5) check that only a single BuckEventBus thread is shown in 4)
Made some improvements to the set of fakes we use for testing.

Summary:
Currently, we frequently mock BuildContext in unit tests for lack of a
good fake. This introduces a utility to set many of BuildContext.Builder's
fields to a reasonable default for tests.

It also adds a listener to the BuckEventBus used for tests that will
print errors to the console.

I also refactored some things to make it easier to specify a FakeFileHashCache
that can be used with a FakeRuleKeyBuilderFactory, which can in turn be used
with a FakeAbstractBuildRuleBuilderParams.

Test Plan: Sandcastle builds.
Extract OnDiskBuildInfo into an interface.

Summary:
Move the original implementation of `OnDiskBuildInfo` into `DefaultOnDiskBuildInfo`.
Now `FakeOnDiskBuildInfo` implements `OnDiskBuildInfo` rather than subclassing
`DefaultOnDiskBuildInfo`. This simplifies things, as `FakeOnDiskBuildInfo` no longer
needs to take a `ProjectFilesystem` or `BuildTarget` in its constructor.

Test Plan: Sandcastle builds.
Remove custom ExtractResourcesStep in lieu of ApkBuilder.addResourcesFromJar().

Summary:
Historically, if we needed to include a java_library that had resources
(i.e., files that it loaded via `Class.getResource()`), then we would have
to package those files into the APK so that `Class.getResource()` worked
when that code was run in an APK just like it did in a JAR.

To achieve this, we previously used `ExtractResourcesStep` to extract all
of the resources from all of the JAR files that went into an APK, and wrote
the resources to a directory. Then we passed that directory to `aapt`.

Back when I was still figuring out how the Ant scripts worked, I noticed that Ant
did this automagically. Presumably it was using this feature of `ApkBuilder`, which
I duplicated with my `ExtractResourcesStep`. Letting `ApkBuilder` do this seems
like a better way to go.

Most importantly, for my current purposes, this allows us to defer the computation of
`dexTransitiveDependencies` in `AndroidBinaryRule#getBuildSteps()`, which will make
it easier to deconstruct that method and farm it out into more specific build rules.
Update nailgun client to fix erroneous client disconnections.

Summary:
Updates the nailgun client to
https://github.com/martylamb/nailgun at commit
9cf2720e6c4c7b798b3ee3b724768b0d4df52793 which fixes heartbeat sending
logic by testing the interval between sent chunks after each call to
select, rather than just after select timeouts. This fixes problems
with erroneous client disconnections when using buckd caused by the
SuperConsole constantly sending stderr data to the client, which
resulted in no select timeouts and so no heartbeats from the client.

Test Plan:
0) buck test --all
1) buckd
2) set BUCKD_CLIENT_TIMEOUT_MILLIS in bin/buckd to 3000
2) buck build buck, check that it completes without timing out
Fix SuperConsole thread leak.

Summary:
Previously each buck command potentially created a
SuperConsole instance which created a ScheduledExecutorService which
was then leaked when running the command inside buckd. This change
makes the ScheduledExecutorService static, the SuperConsole Closable
so that it can cancel its scheduled updates and creates the
SuperConsole inside a try-with-resources block around command execution so
that it is always cleaned up properly.

Test Plan:
0) buck test --all
1) buckd
2) for DIR in `find . -type d`; do buck query "$DIR ->"; done
3) killall -3 java
4) grep SuperConsoleEventBusListener .buckd/buckd.log
5) check that only a single SuperConsoleEventBusListener thread is shown in 4)
Fix problem with project not excluding buck-cache and buck-out.

Summary:
There were two problems here: ignoredPaths never accepted buck-cache,
 and we never added exlcudes to a root if it didn't have sources.
Fix the output path for sh_binary.

Summary:
The sh_binary rule creates a clean src directory, but that directory wasn't
given a proper unique name, so it would pave other build outputs. Give it a
unique name.
Extract an InitializeFromDisk interface.

Summary:
Separate the concern of being a BuildRule or a Buildable from the concern of
being initialized from the disk. Ultimately, this is a responsibility of the
"build engine" rather than the rule itself, so this will help make the
separation of BuildEngine from BuildRule less painful.

Test Plan:
buck test --all
Clean build of the stable branch, checking that we hit the caches.
Require users to implement appendDetailsToRuleKey() for a Buildable.

Test Plan: Sandcastle builds.
Constructing Buildables from Descriptions.

Summary:
The next step on the plugin APIs. The key class is the Description, which
provides access to the Buildable the actually does the work, and the
constructor arg, which is used to generate the buck.py file.

Test Plan:
buck test --all
Early exit if there is no buck command to be run.

Summary: `indentation--`

Test Plan: ant test
`InitializableFromDisk` must declare the type of object it populates.

Summary:
Historically, the burden has been on developers to remember to implement
`initializeFromDisk()` in order to put in-memory data structures in the same
state when reading a `BuildRule` from cache as it would have created them when
building the rule locally. This was problematic as it required developers to
implement two code paths to achieve the same result, which was error-prone.

Here, we eliminate this problem by forcing this logic to go through one code path.
This diff requires the steps to serialize any data structures to disk,
and then AbstractCachingBuildRule will invoke `initializeFromDisk()`,
which must now return the data structures created anew, having been read from disk.
This will help with correctness, though it may also make things slightly slower,
as data that was previously immediately available to a `BuildRule` in memory now
has to be serialized and deserialized before it can be used.

Test Plan: Sandcastle builds.