Create Parse and Step Events.

Test Plan: Unit tests.
Add Chrome Trace Events

Test Plan:
- Unit tests
- Built, viewed trace in chrome://tracing and verified there was no performance regression.
- Memory footprint increase was only a few megs.
Replace threading of EventBus with BuckEventBus

Test Plan: buck build, unit tests.
Catch an OOM when Cassandra tries to store an artifact.

Summary:
We observed an OOM in the wild, so made a stricter catch
block to trap this.

Test Plan: Sandcastle builds.
Introduce a Sha1HashCode class that we can use instead of passing around SHA-1s as strings.

Test Plan: Sandcastle builds.
Pad generated hashes with 0

Summary:
The AbiWriter may generate a hash that's less than 40 characters long if the generated hash
would have leading zeros. That's not good, so we pad the string to 40 characters.

Test Plan: buck test --all
Make getAbiKey() a method of the JavaLibraryRule interface.

Summary:
This is an important step in extending DefaultJavaLibraryRule
so that it implements AbiRule.

Test Plan: Sandcastle builds.
Change AndroidBinaryRule's proguardConfig from String to SourcePath.

Summary:
This will enable us to create a ProGuard config from a genrule.

Test Plan: Sandcastle builds.
Take into account the short name of a rule when building ndk_library

Summary: Because otherwise, hilariously, you can't have more than one ndk_library per folder.

Test Plan:
buck test --all
build and run our prod apps
Create a unit test to reproduce a bug in SourcePath.

Summary:
Mark the test with `@Ignore` and assigning to Simon to fix.

We need to get this fixed before we can start using
SourcePaths more broadly.

Test Plan: Sandcastle builds.
Refactor logging of build events to include parse time and log install/uninstall/startactivity

Test Plan:
Unit Tests
Ran "buck install" and "buck uninstall", verified install and uninstall information showed up in the trace.
Disable artifact caching for 'buck project'

Summary:
As a temporary workaround while buck is generating annotation sources,
we need to disable artifact caching for 'buck project'.  This is needed
because the annotation processing initial targets are added to the build
purely for their side-effects.  Obtaining the cached result defeats the
purpose of adding these targets to 'buck project'.

Test Plan: - unit tests
[buck] Add an option for native libraries to be treated as assets

Summary:
This makes it so that any native library declared using `ndk_build` or
`prebuilt_native_library` can indicate if it needs to be treated as an asset.
This could be useful if you want to extract/load these libraries on demand
and using mechanisms other than the Android system library loader.

Moreover, it will respect the build `cpu_filter`
and pick up the appropriate library for that cpu arch.

Libraries using this option are placed under `/assets/lib/` inside the APK.
Created an integration test to verify how `buck project` determines how many threads to use.

Summary:
I was considering introducing a `--num-threads` flag to `buck project`,
but this test shows that we can set this value via `.buckconfig`,
so I'm not convinced that the flag is necessary.

Test Plan: Sandcastle builds.
build-time downscaling for dpi-specific builds

Summary:
Our MDPI builds contain several HDPI and XHDPI drawables. This is because no
MDPI alternatives were ever provided and, as such, the resource
filter cannot discard the larger versions.

It's not a functional problem as Android downscales automatically at runtime,
however we can save at least 0.5 MiB in APK size for MDPI builds by performing
this operation at build time.

The question is, what implementation should we provide for image scaling?
ImageMagick is free, fast and does exactly what we want, it's available in the
package managers of our build machines, but it's not installed by default.
Handle package level annotations in the AbiWriter

Summary:
Oracle's best practices for java suggest using a file called "package-info.java" to store
package level docs. The AbiWriter should not include them in the ABI.

Test Plan:
buck test --all

Modified existing source by adding a "package-info.java" file and verified that the ABI was generated as expected.
Added infrastructure for generating deps in buck files.

Test Plan: Unit tests, tested with fb4a
Add in scuba event listener

Test Plan:
Unit Tests
Ran "buck build buck" and verified data made it into Scuba
Execute CassandraArtifactCache stores asynchronously.

Summary:
Use Astayanax's MutationBatch.executeAsync() rather than
MutationBatch.execute().  This causes the calling thread to return
immediately, and Astayanax synchronously executes to completion using a
thread within its own thread pool.

Test Plan:
Build repeatedly with cassandra caching enabled, and verify that no
errors (in particular failed artifact stores) are introduced.
Add command events to chrome tracer

Test Plan:
Unit tests
buck build, viewed trace.