Add missing pieces for 'driver' support on macOS (#34376)

- Adds desktop projects to ApplicationPackageStore
- Plumbs target overrides through the macOS build
This commit is contained in:
stuartmorgan
2019-06-18 11:14:46 -07:00
committed by GitHub
parent c19f78866d
commit cc541e6724
5 changed files with 29 additions and 5 deletions

View File

@@ -15,10 +15,13 @@ import '../project.dart';
import '../usage.dart';
import 'cocoapod_utils.dart';
/// Builds the macOS project through xcode build.
// TODO(jonahwilliams): support target option.
/// Builds the macOS project through xcodebuild.
// TODO(jonahwilliams): refactor to share code with the existing iOS code.
Future<void> buildMacOS(FlutterProject flutterProject, BuildInfo buildInfo) async {
Future<void> buildMacOS({
FlutterProject flutterProject,
BuildInfo buildInfo,
String targetOverride,
}) async {
final Directory flutterBuildDir = fs.directory(getMacOSBuildDirectory());
if (!flutterBuildDir.existsSync()) {
flutterBuildDir.createSync(recursive: true);
@@ -27,6 +30,7 @@ Future<void> buildMacOS(FlutterProject flutterProject, BuildInfo buildInfo) asyn
await updateGeneratedXcodeProperties(
project: flutterProject,
buildInfo: buildInfo,
targetOverride: targetOverride,
useMacOSConfig: true,
setSymroot: false,
);

View File

@@ -75,7 +75,11 @@ class MacOSDevice extends Device {
// Stop any running applications with the same executable.
if (!prebuiltApplication) {
Cache.releaseLockEarly();
await buildMacOS(FlutterProject.current(), debuggingOptions?.buildInfo);
await buildMacOS(
flutterProject: FlutterProject.current(),
buildInfo: debuggingOptions?.buildInfo,
targetOverride: mainPath,
);
}
// Ensure that the executable is locatable.