analyzer action

Adds analyzer action which allows individual targets in a scheme to be
analyzed. The action will run a regular build prior to running analysis.
It pulls analyzer results from the generated plist files instead of the
compiler output, thus allowing for incremental analyzer runs.
Merge pull request #78 from facebook/yiding/analyze-action

Added an analyzer action which allows for select targets in a scheme to be analyzed.
It also pulls analyzer results from the plist files rather than stderr, this makes it so incremental changes only requires incremental re-analyze. The results come out at the end of the run as special structured reporter events.
fix sporatic hanging in run-tests with parallelization

NSTask registers some mach ports with the current run loop on launch but
does not remove them until finalize. Sometimes the run loop will try to
read from these ports for reasons beyond my comprehension even after the
task exited, and hang there ad infinitum.

Here I change all NSTask uses to release as soon as possible. This seems
to resolve the issue (1/3 chance to < 1/20 chance in some tests I ran).

Also wrapped `readTillEndOfFileInBackgroundAndNotify` calls to inside
the runloop, per documentation.
Merge pull request #89 from facebook/yiding/fix-parallel-hanging

fix sporatic hanging in run-tests with parallelization
Make xctool support DEVELOPER_DIR
Merge pull request #93 from LegNeato/master

Make xctool support DEVELOPER_DIR
make 'script:' in .travis.yml do everything.

Previously I had it doing additional testing via the 'after_success:'
option, but if those scripts failed, they wouldn't fail the build.
Let's do everything in 'script:'.
better assertion message for buildSettingsForFirstBuildable

It would be nice if this assertion gave us more information when it
fails.
don't empty the environment when calling xcodebuild -showsdks

Sometimes we want environment variables (like DEVELOPER_DIR) to flow
through to xcodebuild or xcode-select since they'll influence how those
programs work.
TemporaryDirectoryForAction() gives you a temp dir for the current action

SchemeGenerator used to create its own temp directory to store the
generated workspace and scheme.  I'm about to add something else that
needs a temp directory and it'll be cleaner if we just have a general
purpose temp dir for the duration of each action.  The directory will
get cleaned up as soon as the action finishes.
fix the issue where we accumulate Tests-* folders in DerivedData

Every time xctool builds or runs tests, it generates a new workspace and
scheme.  When we invoke xcodebuild on that workspace/scheme, xcodebuild
creates a folder in the user's DerivedData like
'Tests-dgtnwkoyuhjfcibwyjiprineykfj'.

Since we override OBJROOT/SYMROOT/etc at the same time, this folder
serves no real purpose - it's junk.

Let's override 'IDECustomDerivedDataLocation' so this junk directory
gets created in the action's temp directory and is automatically
cleaned up on each run.

Test Plan:
Commented out the code that cleans up the temp dir - verified that the
junk DerivedData folder was placed there.
fix bug where TemporaryDirectoryForAction() would fail while under test.

While under test, TemporaryDirectoryForAction() always returns the same
directory (instead of a random one).  This works fine on your first test
run, but will fail on the second test run because the directory already
exists.

When under test, let's ignore that failure.
the TemporaryDirectoryForAction() dir should be cleaned before each test.

Otherwise, junk will accumulate between test runs and we'll get
failures.
move the routines that find the matching scheme path into their own methods.

This `populate` method is getting pretty big - let's refactor it a bit.
move the routines that populate buildable + testables into their own methods.

This populate function was getting too long.
the generated scheme for tests should match the original scheme's settings.

If the original scheme enabled 'parallelizeBuildables' or
'buildImplicitDependencies', then the generated scheme should use them,
too.
the generated Tests workspace should include all projects in subject's workspace

Previously, we only added projects for the buildables and testables to
the generated workspace.  This was fine, but it doesn't give Xcode's
Find Implicit Dependencies feature enough information to work from.
Let's make the generated workspace include all the projects.

Test Plan:
Tests pass.  Verified that find implicit dependencies now works with a
CocoaPods project.
show error when running iOS app tests and the TEST_HOST doesn't exist.

We'll now show...

```
  run-test TestProject-LibraryTests2.octest (iphonesimulator6.1,
application-test, GC OFF)
  failed: TEST_HOST doesn't exist at '/Users/fpotter/Library/Developer/Xcode/DerivedData/TestWorkspace-Library-dfkuuumeqgksbpctikbmroulmipg/Build/Products/Debug-iphonesimulator/TestProject-TestHost.app'
```
Revert "show error when running iOS app tests and the TEST_HOST doesn't exist."

This reverts commit fe38039701a4f16aff2ae2cac666bae6e1db236d.
Fix xctool run-tests hanging when run with parallelization

Fairly certain that libdispatch's dispatch_io_* stuff which is used by
NSTask (and which I've also tried to use directly) is buggy when used in
a heavily multithreaded context with pipes.

Rewrote `LaunchTaskAndCaptureOutput` using poll/read instead. This is
acceptable as every job was running synchronously in its own thread
anyway.