move iosworkflow to globals (#52444)
This commit is contained in:
committed by
GitHub
parent
db6e2061aa
commit
38a8845481
@@ -24,7 +24,6 @@ import 'features.dart';
|
||||
import 'fuchsia/fuchsia_workflow.dart';
|
||||
import 'globals.dart' as globals;
|
||||
import 'intellij/intellij.dart';
|
||||
import 'ios/ios_workflow.dart';
|
||||
import 'ios/plist_parser.dart';
|
||||
import 'linux/linux_doctor.dart';
|
||||
import 'linux/linux_workflow.dart';
|
||||
@@ -77,7 +76,7 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider {
|
||||
FlutterValidator(),
|
||||
if (androidWorkflow.appliesToHostPlatform)
|
||||
GroupedValidator(<DoctorValidator>[androidValidator, androidLicenseValidator]),
|
||||
if (iosWorkflow.appliesToHostPlatform || macOSWorkflow.appliesToHostPlatform)
|
||||
if (globals.iosWorkflow.appliesToHostPlatform || macOSWorkflow.appliesToHostPlatform)
|
||||
GroupedValidator(<DoctorValidator>[xcodeValidator, cocoapodsValidator]),
|
||||
if (webWorkflow.appliesToHostPlatform)
|
||||
WebValidator(
|
||||
@@ -108,8 +107,8 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider {
|
||||
if (_workflows == null) {
|
||||
_workflows = <Workflow>[];
|
||||
|
||||
if (iosWorkflow.appliesToHostPlatform) {
|
||||
_workflows.add(iosWorkflow);
|
||||
if (globals.iosWorkflow.appliesToHostPlatform) {
|
||||
_workflows.add(globals.iosWorkflow);
|
||||
}
|
||||
|
||||
if (androidWorkflow.appliesToHostPlatform) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import 'base/terminal.dart';
|
||||
import 'base/user_messages.dart';
|
||||
import 'cache.dart';
|
||||
import 'ios/ios_deploy.dart';
|
||||
import 'ios/ios_workflow.dart';
|
||||
import 'ios/mac.dart';
|
||||
import 'ios/plist_parser.dart';
|
||||
import 'ios/simulators.dart';
|
||||
@@ -71,6 +72,7 @@ FlutterVersion get flutterVersion => context.get<FlutterVersion>();
|
||||
IMobileDevice get iMobileDevice => context.get<IMobileDevice>();
|
||||
IOSDeploy get iosDeploy => context.get<IOSDeploy>();
|
||||
IOSSimulatorUtils get iosSimulatorUtils => context.get<IOSSimulatorUtils>();
|
||||
IOSWorkflow get iosWorkflow => context.get<IOSWorkflow>();
|
||||
SimControl get simControl => context.get<SimControl>();
|
||||
UserMessages get userMessages => context.get<UserMessages>();
|
||||
Xcode get xcode => context.get<Xcode>();
|
||||
|
||||
@@ -26,7 +26,6 @@ import '../protocol_discovery.dart';
|
||||
import '../vmservice.dart';
|
||||
import 'fallback_discovery.dart';
|
||||
import 'ios_deploy.dart';
|
||||
import 'ios_workflow.dart';
|
||||
import 'mac.dart';
|
||||
|
||||
class IOSDevices extends PollingDeviceDiscovery {
|
||||
@@ -36,7 +35,7 @@ class IOSDevices extends PollingDeviceDiscovery {
|
||||
bool get supportsPlatform => globals.platform.isMacOS;
|
||||
|
||||
@override
|
||||
bool get canListAnything => iosWorkflow.canListDevices;
|
||||
bool get canListAnything => globals.iosWorkflow.canListDevices;
|
||||
|
||||
@override
|
||||
Future<List<Device>> pollingGetDevices() => IOSDevice.getAttachedDevices(globals.platform, globals.xcdevice);
|
||||
|
||||
@@ -8,7 +8,6 @@ import '../base/process.dart';
|
||||
import '../device.dart';
|
||||
import '../emulator.dart';
|
||||
import '../globals.dart' as globals;
|
||||
import 'ios_workflow.dart';
|
||||
import 'simulators.dart';
|
||||
|
||||
class IOSEmulators extends EmulatorDiscovery {
|
||||
@@ -16,7 +15,7 @@ class IOSEmulators extends EmulatorDiscovery {
|
||||
bool get supportsPlatform => globals.platform.isMacOS;
|
||||
|
||||
@override
|
||||
bool get canListAnything => iosWorkflow.canListEmulators;
|
||||
bool get canListAnything => globals.iosWorkflow.canListEmulators;
|
||||
|
||||
@override
|
||||
Future<List<Emulator>> get emulators async => getEmulators();
|
||||
|
||||
@@ -6,6 +6,7 @@ import '../base/context.dart';
|
||||
import '../doctor.dart';
|
||||
import '../globals.dart' as globals;
|
||||
|
||||
// TODO(fujino): remove once internal references replaced by `globals.iosWorkflow`
|
||||
IOSWorkflow get iosWorkflow => context.get<IOSWorkflow>();
|
||||
|
||||
class IOSWorkflow implements Workflow {
|
||||
|
||||
@@ -22,7 +22,6 @@ import '../globals.dart' as globals;
|
||||
import '../macos/xcode.dart';
|
||||
import '../project.dart';
|
||||
import '../protocol_discovery.dart';
|
||||
import 'ios_workflow.dart';
|
||||
import 'mac.dart';
|
||||
import 'plist_parser.dart';
|
||||
|
||||
@@ -41,7 +40,7 @@ class IOSSimulators extends PollingDeviceDiscovery {
|
||||
bool get supportsPlatform => globals.platform.isMacOS;
|
||||
|
||||
@override
|
||||
bool get canListAnything => iosWorkflow.canListDevices;
|
||||
bool get canListAnything => globals.iosWorkflow.canListDevices;
|
||||
|
||||
@override
|
||||
Future<List<Device>> pollingGetDevices() async => _iosSimulatorUtils.getAttachedDevices();
|
||||
|
||||
@@ -21,7 +21,6 @@ import 'package:flutter_tools/src/doctor.dart';
|
||||
import 'package:flutter_tools/src/ios/devices.dart';
|
||||
import 'package:flutter_tools/src/ios/mac.dart';
|
||||
import 'package:flutter_tools/src/ios/ios_deploy.dart';
|
||||
import 'package:flutter_tools/src/ios/ios_workflow.dart';
|
||||
import 'package:flutter_tools/src/macos/xcode.dart';
|
||||
import 'package:flutter_tools/src/mdns_discovery.dart';
|
||||
import 'package:flutter_tools/src/project.dart';
|
||||
@@ -1395,8 +1394,8 @@ class FakeIosDoctorProvider implements DoctorValidatorsProvider {
|
||||
List<Workflow> get workflows {
|
||||
if (_workflows == null) {
|
||||
_workflows = <Workflow>[];
|
||||
if (iosWorkflow.appliesToHostPlatform) {
|
||||
_workflows.add(iosWorkflow);
|
||||
if (globals.iosWorkflow.appliesToHostPlatform) {
|
||||
_workflows.add(globals.iosWorkflow);
|
||||
}
|
||||
}
|
||||
return _workflows;
|
||||
|
||||
Reference in New Issue
Block a user