Merge pull request #4906 from collinjackson/fallback

Fall back to the default xcodeproj if a workspace cannot be found
This commit is contained in:
Collin Jackson 2016-07-12 18:14:38 -07:00 committed by GitHub
commit 8891acc18a

View File

@ -123,11 +123,20 @@ Future<XcodeBuildResult> buildXcodeProject({
'build',
'-configuration', 'Release',
'ONLY_ACTIVE_ARCH=YES',
'-workspace', 'Runner.xcworkspace',
'-scheme', 'Runner',
"BUILD_DIR=${path.absolute(app.rootPath, 'build')}",
];
List<FileSystemEntity> contents = new Directory(app.rootPath).listSync();
for (FileSystemEntity entity in contents) {
if (path.extension(entity.path) == '.xcworkspace') {
commands.addAll(<String>[
'-workspace', path.basename(entity.path),
'-scheme', path.basenameWithoutExtension(entity.path),
"BUILD_DIR=${path.absolute(app.rootPath, 'build')}",
]);
break;
}
}
if (buildForDevice) {
commands.addAll(<String>['-sdk', 'iphoneos', '-arch', 'arm64']);
if (!codesign) {