Add a resources_root field to java_library and friends.

Summary:
When java_library rules have their own local resources, we usually try to put
those under one of the root-less dir names given in `src_roots` in the
.buckconfig. Sometimes that doesn't work well -- maybe the java_library dir is
already below one of the absolute paths that take precedence, or maybe the name
of the resources dir is too common to safely make it root-less. What's really
needed is for a java_library to be able to specify a resources directory that
only applies to that one rule. Thus, the new `resources_root` field.

Test Plan: New unit and integration tests.
Kill BuildRuleResolver.buildAndAddToIndex.

Summary:
This was added to be used in
ProjectGeneratorTest.testIosLibraryRuleWithGenruleDependency; however we
refactored the code to not need that method anymore.

Test Plan: buck test --all
Bump number of buckd runs before restarting buckd -> 64

Test Plan: yolo2
Stop "buck test" processes over-writing each others test files

Summary: Running multiple instance of `buck test` in the same working
copy is fine as long as they are testing different targets.  When they
are testing the same targets, they overwrite each others XML results
files.  This diff introduces a hack that forces the use of one-time
(i.e. never cache-able) unique results directories, specifically for
JUnit testing, so that multiple buck processes don't collide with each
other.

Test Plan:
Made some five second long tests and ran them at the same time.  Each
buck process only outputs the thing it tested.

Without this hack, the first buck reports the results from TestA, and
the second reports the results from TestA and TestB.  Worse, if I got
the timing right, the second could delete the TestA result in between
launching the JUnitRunner, and reading the subsequent results file, but
that's harder race-condition to simulate.
Easy: New class FileExtensions

Summary:
To support natively building iOS targets, we need to split
out sources and headers (which are currently mingled together in
the srcs parameter of ios_* targets).

This diff adds a new class FileExtensions which I will use to split
source files from header files. We have similar code in ProjectGenerator
which I'll refactor in the next diff.

Test Plan: Unit test in subsequent diff.
Use new class FileExtensions in ProjectGenerator

Summary:
This is a followup to D1386009, and refactors
ProjectGenerator to use the new class FileExtensions.

Depends On D1386009

Test Plan: Unit test in subsequent diff.
Support per-file compiler flags in AbstractNativeBuildable

Summary:
We'd like to use AbstractNativeBuildable for
iOS targets. iOS supports setting per-file compiler flags,
so this diff adds that support to AbstractNativeBuildable.

Test Plan: Not used in this diff. Unit test in subsequent diff.
Easy: Buck iOS tests: Ensure deps is non-null in tests

Summary:
I'm about to make it so we depend on the 'deps' field of
IosLibrary etc. being non-null. This is always true in production,
but in tests, we manually create the IosLibraryDescription.Arg
value and often leave fields null in tests.

This makes sure the deps field is always non-null in our tests.

Test Plan: ant test
buck for iOS v2: Make Apple binary targets implement AbstractNativeBuildable

Summary:
This is a first step towards making Buck build iOS targets
natively. Building targets doesn't quite work yet (we need to transform
xcconfig settings to clang / ld parameters) but this is a start.

I introduced a new value type, TargetSources. This is necessary
because AbstractNativeBuildable requires the subclass to pass in
certain information (source and header files) to the superclass
constructor.

Since Java requires the call to super() to be the first line in
the subclass constructor, we need to make sure IosLibraryDescription
and related classes wrap up and pass the source, header, and other
required data directly to the subclass constructor.

TargetSources bundles together two existing pieces of data (srcs and
perFileFlags) with two new pieces of data (srcPaths and
headerPaths). These will be passed to the constructor of IosLibrary,
IosBinary, etc.

I also had to make the constructor to ArStep public, since it had
package privacy before.

Depends On D1386196
Depends On D1386184
Depends On D1386032
Depends On D1386009

Test Plan: Unit tests included.
Add a copyright profile for IntelliJ

Test Plan: Create a new java class, verify copyright gets added.
Use a list instead of set to pass resoure directories to aapt.

Summary:
Since the ordering of these resource directories is important (which is why we
topo-sort the android resource rules in the first place).

Test Plan: buck test --all
Fixed the description of build target patterns ending with "...".

Summary: Reported in a comment of #137.
Add resources_root to the rule key of DefaultJavaLibrary.

Summary:
I forgot to do this when I defined the resources_root field. This
makes sure the rule is rebuilt if the resources_root is changed.

Test Plan:
Define a random library in fbandroid, change the resources_root field, and
confirm that it rebuilds. (Also that it didn't before.) Note that this doesn't
repro in the buck project (that is, changing resources_root does cause a
rebuild, even without this diff), and even setting cache.mode doesn't make it
repro.  What config could it be?
Reverting previous commit and removed try-catch from CollectionTypeCoercer.fill

Summary:
Error message now looks like:
  java.lang.RuntimeException: Failed to coerce field named: srcs, src/com/facebook/buck/rules: Cannot coerce argument 'DoesNotExist.java' to interface com.facebook.buck.rules.SourcePath
with no duplicate

Test Plan: Built buck with src list containing an invalid source path
Remove an obsolete comment

Summary: The todo was done.  Yay.

Test Plan: Buildbot.
Make ProGuardObfuscateStep.create append steps to a builder

Summary:
No need to use a composite step for this, and breaking it out improves
reporting quality.  It also makes it easier to test the output.

Test Plan: Buildbot.
Allow using proguard without the Android SDK proguard config.

Summary:
Previously, we had a boolean that let you select between the default and
optimized configs from the sdk, but no way to omit that config entirely
(and presumably substitute your own modified version).  This replaces
that arg with an enum version that lets you select any of the three
possibilities.

The old argument is still respected, but the conversion is done entirely
within AndroidBinaryDescription.

Test Plan:
Unit tests.  Built one of our own apps with no default config and saw
the proguard command line change appropriately.
Fix build break in unit test

Summary: Sorry.

Test Plan:
buck test --all
(Successfully builds.)
Fix lint error in ProGuardObfuscateStep

Summary:
D1360166 introduced a lint error in ProGuardObfuscateStep
(declared variable unused if we throw).

This removes the variable in favor of inline usage and adds a
test.

Test Plan: Unit test included.
Add the cause exception string when failing to write the chrome trace file.

Test Plan: Unit Tests