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.
Merge pull request #100 from facebook/yiding/fix-parallelization-hang-again

Fix xctool run-tests hanging when run with parallelization... again
Merge pull request #98 from facebook/fpotter/fix-implicit-dependencies

Make xctool play nice with Find Implicit Dependencies
adding travis status badge.
xctool's build products should have a bin, lib, libexec dir structure.

This will give us something that looks like --

../xctool/bin/xctool
../xctool/lib/otest-shim-ios.dylib
../xctool/lib/otest-shim-osx.dylib
../xctool/lib/xcodebuild-fastsettings-shim.dylib
../xctool/lib/xcodebuild-shim.dylib
../xctool/libexec/mobile-installation-helper.app
../xctool/libexec/otest-query-ios
../xctool/libexec/otest-query-osx

This will make xctool play nicer with Homebrew.
Don't encode '(null)' into path when platform is unknown