Issue 1:
For reasons, I have a file called BUILD in my ios/ directory, which conflicts with Xcode's default build output directory ('build/'), since macOS has case-insensitive file system by default.

I can get around that by setting SYMROOT in project.pbxproj, but the flutter tools still insist on using 'build/'. It would be nice if the build directory was configurable with a command-line parameter, and the xcode_backend.sh script passed $SYMROOT in there.

Steps to Reproduce

Create an empty (non-directory) file named 'build' in ios/

flutter run // <-- doesn't work, fails building iOS project and flutter

Change SYMROOT in the Xcode project file

flutter run // <-- still doesn't work, but only flutter fails now

Flutter Doctor

[✓] Flutter (on Mac OS, channel master)

• Flutter at /Users/jakobr/src/flutter

• Framework revision 5f44b2d (8 hours ago), 2016-08-22 17:14:30

• Engine revision 0949efe

• Tools Dart version 1.19.0-dev.5.0

[x] Android toolchain - develop for Android devices

x Android Studio / Android SDK not found. Download from https://developer.android.com/sdk/

(or visit https://flutter.io/setup/#android-setup for detailed instructions).

[✓] iOS toolchain - develop for iOS devices (Xcode 7.3.1)

• XCode at /Applications/Xcode.app/Contents/Developer

• Xcode 7.3.1, Build version 7D1014

[✓] Atom - a lightweight development environment for Flutter

• flutter plugin version 0.2.4

• dartlang plugin version 0.6.35

Logs and Crash Reports

Flutter crash report; please file at https://github.com/flutter/flutter/issues.

command

flutter --suppress-analytics build flx --target=lib/main.dart --output-file=example/ios/Flutter/app.flx

exception

FileSystemException: Creation failed, path = 'build' (OS Error: File exists, errno = 17)

dart:io _Directory.createSync
package:file/src/sync/local/local_directory.dart 13 _LocalDirectory.create
package:flutter_tools/src/base/file_system.dart 65 ensureDirectoryExists
package:flutter_tools/src/flx.dart 86 build.<async>
===== asynchronous gap ===========================
dart:async _Completer.completeError
package:flutter_tools/src/flx.dart 114 build.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:flutter_tools/src/flx.dart build
package:flutter_tools/src/commands/build_flx.dart 44 BuildFlxCommand.runInProject.<async>
dart:async _SyncCompleter.complete
package:flutter_tools/src/commands/build.dart 56 BuildSubCommand.runInProject.<async>
===== asynchronous gap ===========================
dart:async _asyncThenWrapperHelper
package:flutter_tools/src/commands/build_flx.dart BuildFlxCommand.runInProject
package:flutter_tools/src/runner/flutter_command.dart 186 FlutterCommand._run.<async>
dart:async _SyncCompleter.complete
package:flutter_tools/src/dart/pub.dart 60 pubGet.<async>
dart:async _SyncCompleter.complete
package:flutter_tools/src/base/process.dart 77 runCommandAndStreamOutput.<async>
===== asynchronous gap ===========================
dart:async _asyncThenWrapperHelper
package:flutter_tools/src/runner/flutter_command.dart FlutterCommand._run
package:flutter_tools/src/runner/flutter_command.dart 116 FlutterCommand.run
package:args/command_runner.dart 177 CommandRunner.runCommand.<fn>
dart:async Future.Future.sync
package:args/command_runner.dart 130 CommandRunner.runCommand
package:flutter_tools/src/runner/flutter_command_runner.dart 177 FlutterCommandRunner.runCommand.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:flutter_tools/src/runner/flutter_command_runner.dart FlutterCommandRunner.runCommand
package:args/command_runner.dart 104 CommandRunner.run.<fn>
dart:async Future.Future.sync
package:args/command_runner.dart 104 CommandRunner.run
package:flutter_tools/src/runner/flutter_command_runner.dart 123 FlutterCommandRunner.run
package:flutter_tools/executable.dart 88 main.<async>.<fn>.<async>
===== asynchronous gap ===========================
package:stack_trace Chain.capture
package:flutter_tools/executable.dart 82 main.<async>

flutter doctor

Issue 2:
These two files have duplicated code:

packages/flutter/test/rendering/rendering_tester.dart
packages/flutter_test/lib/src/widget_tester.dart

We should consolidate to simplify maintenance.