Address simons's comments that I missed from D1302984.

Summary:
I re-created the scenario described in the large comment
in `CopyResourcesStep.java` and verified that the behavior still
works as described there.

Reformatted a `Pattern` that was defined across multiple lines.

Moved a check in a static method into a constant.

Test Plan: Sandcastle builds.
Remove methods from MorePaths that gave us the impression that Buck worked on Windows.

Summary:
Here is the list of methods that I removed from `MorePaths` in this diff:

  public static Path newPathInstance(String path);
  public static Path newPathInstance(File file);
  public static Path separatorsToUnix(String path);

These methods were bad because they purported to return `Path`s with UNIX seprators.
However, the seprator type is not a property of a `Path`. The separator is only
realized when `Path.toString()` is invoked. Therefore, the only way to pass around
a path with a specific separator type is to use a string.

Strings are convenient test values in unit tests and other places, so in the rare
event where separator-type-consistency is merited, the following methods from
`MorePaths` should be used:

  public static String pathWithUnixSeparators(String path);
  public static String pathWithUnixSeparators(Path path);

Test Plan:
Sandcastle builds.
After we export this change to GitHub, I'll see how things stand with
Buck on Windows on my home computer.
Prioritize API-version build-tools over android-version build-tools.

Summary:
As far as I can tell, the only way to get a build-tools dir named "android-*"
is to have it bundled with the SDK you download. Updates installed by the SDK
package manager seem to have the "19.0.0" style name. Since those should
presumably be newer, we should prefer them over the Android version names.

https://github.com/facebook/buck/issues/112

Test Plan:
Modified the corresponding unit test. Put an "android-4.3" directory in my SDK.
Observe that this breaks the build before this diff, but not anymore.
Remove references to genfile in our own tree.

Summary:
genfile() is being removed, since the valid use-cases are covered by SourcePaths, which are
simpler to grok than genfiles. This is a clean up diff that removes some of the references
from within buck's own tests and source.

Test Plan: buck test --all
Replace mock ExecutionContext with TestExecutionContext.

Test Plan: Unit test still passes.
Make the ErrorListener for a BuckEventBus used in tests less chatty.

Summary:
I changed the `ErrorListener` to check the level of the message that it
prints so that it should actually only make noise when there is an error.

I believe that I originally introduced `ErrorListener` in
https://phabricator.fb.com/D1067125 because, in the course of debugging
a unit test, I was missing error messages from Buck that would have been
helpful. This should preserve that property.

Test Plan:
Ran `DescribedRuleTest` and nothing was printed to stderr.
Previously, this would print "cheese" because it executed an `EchoStep`,
which is implemented as:

```
  context.getBuckEventBus().post(LogEvent.info(message));
```
Supply temporary directory to java_test()

Summary:
Similar to genrule() give the test running JVM a temporary directory
below buck-out that is uniquely named for this test target. Send
the path in by both the TMP environment variable and java.io.tmpdir
system property.

Fixes https://github.com/facebook/buck/issues/13

Signed-off-by: Simon Stewart <simons@fb.com>

Test Plan: buck test --all
Make it possible to override _all_ the deps for a BuildRule.

Summary:
Previously, `getEnhancedDeps()` provided this ability, but things have evolved
(see https://phabricator.fb.com/D1259127) to where there are "extra deps"
(that could come from things such as SourcePaths) that are not removed from
the deps, regardless of what `getEnhancedDeps()` does.

This is a smart default, as it prevents us from shooting ourselves in the foot,
but I need more flexibility in order to implement `gwt_application()` efficiently.
To underscore the danger, the method I am introducing that lets you override
all of the deps is named `iKnowWhatIAmDoingAndIWillSpecifyAllTheDepsMyself()`.

Test Plan: Updated existing test in `DescribedRuleBuilderTest` and added another test to it.
Add in a missing throw.

Summary: This line from D885367 created an exception without throwing it. Oops.

Test Plan:
Put `sys.exit(1)` at the *end* of
`src/com/facebook/buck/parser/buck.py`. Observe that buck fails with an
error. (If you put it at the beginning, this particular exception will
be suppressed by another, because try-with-resources have interesting
semantics when `close()` throws.) Without this diff, buck builds on
despite the error code.

Adding two new tests. Confirm that one of them fails when I revert the
code change.
Register a listener in BuildCommand to collect missing symbols.

Summary:
This is just the subscriber half of things. When this is ready, I'll
rebase D1290012 on this to actually post these events.

Test Plan:
This only works in concert with D1290012. Eventually there will be
integration tests for all this.
Expose getSrcRoots from BuckConfig.

Summary:
We need to be able to access the source roots in order to find Java
symbols for autodeps.

Test Plan:
Called from other diffs of mine, and will be exercised by
integration tests later. Is it worth adding a unit test here?
Make None the default value in buck.py for a string or number.

Summary:
This will make it easier to implement a field of a `ConstructorArg`
of type `Optional<Integer>` whose value will now be `Optional.absent()`
when the field is unspecified. This will make it possible for the following
to work correctly:

```
  int value = my_field.or(9);
```

Without this change, `value` will be `9`, even if this is what was specified
in the `BUCK` file:

```
  my_field = 0,
```

The old logic assumed that not specifying a value for `my_field` and
specifying a value of `0` were equivalent, so both were turned into
`Optional.absent()`.

Test Plan:
Added a test case to `DescribedRuleTest`.
Updated unit tests: all pass.
Fix bug where build.log would only be produced on first buckd run

Test Plan:
buckd
buck build buck
rm -rf buck-out/bin/buck.log
buck build buck

verify buck.log is present

Unit tests
don't do an eager filesystem crawl to create the build file tree

Summary:
BuildFileTree crawled the filesystem to build an in-memory
representation of the build file tree. On large filesystems, this takes
a long time.  This splits BuildFileTree into two implementation:
InMemoryBuildFileTree, which uses an in-memory representation and never
crawls the filesystem, and FilesystemBackedBuildFileTree, which scans
the filesystem as-needed.

Test Plan:
Added some tests to verify correct behavior of the new
FilesystemBackedBuildFileTree. The tests pass. buck build buck works.
Running buck on large directory hierarchies now goes much faster.
Fix a lint error. No logical changes.

Summary: Remove a comment that managed to sneak in.

Test Plan: Watch lint pass.
Make the JUnitStep use Paths to represents paths

Summary: Minor code clean up to more strongly type a Path.

Test Plan: buck test --all
Ensure genaidl rules generate an output.

Summary:
We could determine the output file name for an invocation of genaidl, but it's simpler
to just produce a source zip with a file name of the format that the javac steps can
make use.

This moves us one step closer to being able to remove genfile().

Test Plan: buck test --all
Provide an option in .buckconfig to override Android SDK aapt.

Summary:
I plan to combine all the steps that call `aapt` into a single step in a
subsequent diff. I also updated `BuckConfigTest` to check that the overridden
path is absolute, as it should be IMO.

Test Plan:
buck test --all

Also patched .buckconfig in fbandroid, added `aapt = aapt/aapt` under the tools
section, created a symlink from aapt/aapt to ~/aosp/out/...../aapt and ran
buck build instagram.
Introduce BuildableParams to hide information from BuildRuleParams.

Summary:
This makes it easier to instantiate a `DefaultJavaLibrary` or `PrebuiltJar`.

As a follow-up, I will try to change `Description.createBuildable()` to take
a `BuildableParams` instead of a `BuildRuleParams`; however, that is a bit
messy because there are some `Description`s that depend on the additional
behavior provided by `BuildRuleParams`.

Test Plan: Sandcastle builds.
WorkspaceGenerator for Xcode workspaces

Summary: A moderately nice abstraction on top of the DOM to create workspaces.

Test Plan: Unit test. At the top of this stack I generated an
xcworkspace/xcscheme/many projects, built, and ran an iOS app.