Compile tests using ecj.

Summary:
Fix the issues identified by ecj so that we can use ecj to compile our tests.

This generalizes the `<ecj>` macro in `build.xml` so that it can be used in
`<target name="compile-tests">`.

Note that I had to make several changes to `TypeCoercerTest` so that generics
were more explicit to get a test to pass that previously worked with javac but
started failing when being compiled by ecj. Here is an example:

javac
```
assertThat(
    traversal.getObjects(),
    Matchers.<Object>contains(ImmutableList.of(
        sameInstance((Object) input),
        sameInstance((Object) input.get(0)))));
```

ecj
```
assertThat(
    traversal.getObjects(),
    Matchers.contains(ImmutableList.<Matcher<? super Object>>of(
        sameInstance((Object) input),
        sameInstance((Object) input.get(0)))));
```

Note that `Matchers.contains()` is heavily overloaded, as all of the following methods return `Matcher<Iterable<? extends E>>`:

* `Matcher.contains(E...)`
* `Matcher.contains(List<Matcher<? super E>>)`
* `Matcher.contains(Matcher<? super E>...)`
* `Matcher.contains(Matcher<? super E>)`

From the error messages, it appears that javac assumed the second definition but ecj assumed the first definition, which was able to satisfy the second definition, though was less specific.

Test Plan: rm -rf build/testclasses/ && ant compile-tests
Require developers to flag switch statement if not all enum cases are listed.

Test Plan:
Verify building with Ant succeeds and that there are no yellow warning
icons in Eclipse.
buck: add whole-archive support for C/C++ libs

Summary:
Normally when doing static linking, we hand off the C/C++ library
archives to the linker and let it use the normal symbol tracking to
determine if object files from the archive make it into the final
binary.  However, occasionally libraries (e.g. the thrift compilers main
internal lib) rely on static initializers and may sometimes be dropped
even.

This diff adds an option for C/C++ libraries to force them to always
link every object file they contain into the main binary to support
this use-case.

Test Plan:
- included test
- built thrift compiler in fbcode, which uses this
Generate shared library rules for C/C++ libraries

Summary:
Previously, the C/C++ support only generated non-PIC compile rules
and static libraries for C/C++ libs/binaries.  This diff also
generates rules for PIC compilation and shared libraries for C/C++
libraries.  Currently, nothing uses these rules, but subsequent diffs
will use this to allow python libraries to depend on C/C++ libraries.

Test Plan: - included tests
Allow python rules to depend on C++ libraries

Summary:
This diff makes C++ libraries a python packageable, allowing a
python binary/library to depend on C++ library rules.  This types of
deps cause the python package to pull in the shared library version
of the C++ library and map it into the python package by it's soname.

This doesn't actually add shared lib support to the python executable
archive format (e.g PEX), but just gets the buck-side prereqs out of
the way.

Test Plan:
- included tests
- built PARs in fbcode by overriding path_to_pex in .buckconfig
Add C/C++ prebuilt library description to model third-party libs

Summary:
This diff adds a new C/C++ library description that wraps prebuilt
third-party library rules, allowing existing C/C++ binary and library
rules (and python rules) to depend on them and link them in to the
final executable.

The interface has a few options to model the different third-party
libs:
- headerOnly: The third-party has only headers, and no library (e.g.
  boost)
- external: The third-party library should be found externally at
  runtime.  This means we always dynamically link against it and
  never package it into PEXs/PARs (e.g. libc.so).
- soname: The SONAME embedded into the shared library.
- includeDirs: include directories, relative to the BUCK file directory,
  to add to the preprocessor flags for dependents.
- libDir: The directory relative to the BUCK file directory where
  libraries are found.
- libName: The short name of the library (e.g. lib<name>.a).

Test Plan: - included tests
Remove unneeded NoSuchBuildTargetException from throw specs

Summary:
D1527024 made it so the build target parse no longer threw
NoSuchBuildTargetExceptions.  This diff removes the corresponding
throw spec from functions that wrap the parser in BuckConfig and
BuildRuleFactoryParams.

Test Plan: buck test --all
Add more constructors for FakeBuildRule class

Summary:
I've been adding helper functions to construct ##FakeBuildRule##
objects in enough tests that it's probably worth making these
constructors.

Test Plan: used in various tests
Archive: record output to BuildableContext

Summary: Cache the output of the archive rule.

Test Plan: included test
Add .buckconfig.local to the .gitignore

Summary: So I can experiment with changes to Buck's own config before landing things.

Test Plan: Visual inspection
Genrule: include output name in rule key

Summary:
Previously, the output name used to form the output path used in
the genrule was not included in the genrule, which meant if the
user changed the output name in their BUCK file, buck wouldn't
necessary re-run the rule and generate the new output.

Test Plan:
Included a unittest.  Also, created a simple genrule locally and
verified that just changing the output name did not cause a rebuild
without this change.
Thread Python version down through to PEX

Test Plan: Unit tests
Revert "Add .buckconfig project options for workspace_and_projects and with_tests"

Summary:
We don't want to support these config options; we'll pass them from the
command line when needed.
Use ng-stop and ng-stats commands to kill buckd.

Summary:
Earlier, we used `os.kill()` to kill the buckd process by pid, and wait for 10
seconds to check if a process with the same pid is still running before
terminating the process using `SIGKILL`.

Now, we use the `ng-stop` command to shutdown the nailgun server which blocks
until the server is shutdown.

Test Plan:
```
$ buckd
$ buckd --kill
```
Verify buckd is killed.
Do not use the process id of buckd anywhere in the launcher scripts.

Summary:
Previously, we were using the PID to check if buckd was running, and to kill
the running buckd process. Now, we use `ng-stats` and `ng-stop` commands to
achieve the same results respectively.

Test Plan: Run buck and buckd commands, verify that buckd is used, and killed correctly.
Ensure we generate empty launch, profile, archive, and analyze actions

Summary:
Previously, for an Xcode scheme with no src_target, we left
out the launch, profile, archive, and analyze actions entirely from
the generated scheme XML file.

Xcode is OK with this, but it turns out if you make such a scheme in
Xcode, it does add the actions -- it just leaves them empty.

Some external tools like 'xctool' do depend on these empty actions,
so this diff updates SchemeGenerator to add the empty actions with
their default configurations and adds a test.

Test Plan: Unit test included.
Get the Parser working with cross-repo targets.

Summary:
With these changes, my toy cross-repo example actually makes it
through the Parser (and merrily fails during build step execution).

Very few changes in Parser were actually necessary Just To Get It Working. The
majority of this diff is plumbing a BuildTargetParser down to all the TypeCoercers.
We decided it was better to include this in the constructor than to change the
signature of `coerce` everywhere.

Note that right now we're still using one ProjectBuildFileParser to parse all
the repos. That keeps the changes in Parser smaller for now.

Test Plan: New integration test, `CrossRepoTargetsIntegrationTest`.
thrift: make thrift support more general and extensible

Summary:
This moves the core, language-independent thrift stuff into its own
class and adds an extensible framework for add language-specific
support, which is where the java support now lives.  The key changes
to the thrift support will create multiple build rules to run the
thrift compiler on individial thrift sources in parallel, creates
symlink trees to isolate only the thrift headers you depend on for
inclusion, and propagates the language-flavored deps correctly.

Test Plan:
- included tests
- built components in fbcode using the C/C++ support
Add C/C++ thrift support

Summary:
This adds a language specific enhancer for the cpp and cpp2 languages
supported by thrift/thrift2, and has them generate a C/C++ library.

Test Plan:
- included tests
- build projects in fbcode
Add python thrift support

Summary:
This adds a language specific enhancer for python which packages
up all the thrift generated sources into a PythonLibrary rule
consumable by python binaries.

Test Plan:
- included tests
- build projects in fbcode