Unverified Commit ef9866bf authored by stuartmorgan's avatar stuartmorgan Committed by GitHub

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.
parent 2f6a9866
......@@ -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,
......
......@@ -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.
///
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment