Build macOS via workspace, rather than project (#33198)

This is necesasry to integrate CocoaPods, since CocoaPods operates
primarily on the workspace rather than the project.
This commit is contained in:
stuartmorgan
2019-05-22 19:58:29 -04:00
committed by GitHub
parent 2f6a986675
commit ef9866bf27
3 changed files with 8 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ Future<void> buildMacOS(FlutterProject flutterProject, BuildInfo buildInfo) asyn
'/usr/bin/env',
'xcrun',
'xcodebuild',
'-project', flutterProject.macos.xcodeProjectFile.path,
'-workspace', flutterProject.macos.xcodeWorkspace.path,
'-configuration', '$config',
'-scheme', 'Runner',
'-derivedDataPath', flutterBuildDir.absolute.path,

View File

@@ -571,6 +571,8 @@ class MacOSProject {
final FlutterProject project;
static const String _hostAppBundleName = 'Runner';
bool existsSync() => project.directory.childDirectory('macos').existsSync();
Directory get _editableDirectory => project.directory.childDirectory('macos');
@@ -582,7 +584,10 @@ class MacOSProject {
File get generatedXcodePropertiesFile => _cacheDirectory.childFile('Generated.xcconfig');
/// The Xcode project file.
Directory get xcodeProjectFile => _editableDirectory.childDirectory('Runner.xcodeproj');
Directory get xcodeProject => _editableDirectory.childDirectory('$_hostAppBundleName.xcodeproj');
/// The Xcode workspace file.
Directory get xcodeWorkspace => _editableDirectory.childDirectory('$_hostAppBundleName.xcworkspace');
/// The file where the Xcode build will write the name of the built app.
///

View File

@@ -75,7 +75,7 @@ void main() {
'/usr/bin/env',
'xcrun',
'xcodebuild',
'-project', flutterProject.macos.xcodeProjectFile.path,
'-workspace', flutterProject.macos.xcodeWorkspace.path,
'-configuration', 'Debug',
'-scheme', 'Runner',
'-derivedDataPath', flutterBuildDir.absolute.path,