From 6073a7e991e28b6d73c2347a66f730adbf667551 Mon Sep 17 00:00:00 2001 From: Collin Jackson Date: Tue, 12 Jul 2016 17:30:32 -0700 Subject: [PATCH] Fall back to the default xcodeproj if a workspace cannot be found (e.g. for example apps) --- packages/flutter_tools/lib/src/ios/mac.dart | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index 0bb5515a65..8e72015fb9 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -123,11 +123,20 @@ Future buildXcodeProject({ 'build', '-configuration', 'Release', 'ONLY_ACTIVE_ARCH=YES', - '-workspace', 'Runner.xcworkspace', - '-scheme', 'Runner', - "BUILD_DIR=${path.absolute(app.rootPath, 'build')}", ]; + List contents = new Directory(app.rootPath).listSync(); + for (FileSystemEntity entity in contents) { + if (path.extension(entity.path) == '.xcworkspace') { + commands.addAll([ + '-workspace', path.basename(entity.path), + '-scheme', path.basenameWithoutExtension(entity.path), + "BUILD_DIR=${path.absolute(app.rootPath, 'build')}", + ]); + break; + } + } + if (buildForDevice) { commands.addAll(['-sdk', 'iphoneos', '-arch', 'arm64']); if (!codesign) {