mirror of
https://github.com/flutter/packages.git
synced 2025-08-24 11:39:26 +08:00
[flutter_plugin_tool] Fix iOS/macOS naming (#4861)
This commit is contained in:
@ -21,8 +21,8 @@ class XcodeAnalyzeCommand extends PackageLoopingCommand {
|
||||
Platform platform = const LocalPlatform(),
|
||||
}) : _xcode = Xcode(processRunner: processRunner, log: true),
|
||||
super(packagesDir, processRunner: processRunner, platform: platform) {
|
||||
argParser.addFlag(kPlatformIos, help: 'Analyze iOS');
|
||||
argParser.addFlag(kPlatformMacos, help: 'Analyze macOS');
|
||||
argParser.addFlag(platformIOS, help: 'Analyze iOS');
|
||||
argParser.addFlag(platformMacOS, help: 'Analyze macOS');
|
||||
}
|
||||
|
||||
final Xcode _xcode;
|
||||
@ -36,7 +36,7 @@ class XcodeAnalyzeCommand extends PackageLoopingCommand {
|
||||
|
||||
@override
|
||||
Future<void> initializeRun() async {
|
||||
if (!(getBoolArg(kPlatformIos) || getBoolArg(kPlatformMacos))) {
|
||||
if (!(getBoolArg(platformIOS) || getBoolArg(platformMacOS))) {
|
||||
printError('At least one platform flag must be provided.');
|
||||
throw ToolExit(exitInvalidArguments);
|
||||
}
|
||||
@ -44,28 +44,28 @@ class XcodeAnalyzeCommand extends PackageLoopingCommand {
|
||||
|
||||
@override
|
||||
Future<PackageResult> runForPackage(RepositoryPackage package) async {
|
||||
final bool testIos = getBoolArg(kPlatformIos) &&
|
||||
pluginSupportsPlatform(kPlatformIos, package,
|
||||
final bool testIOS = getBoolArg(platformIOS) &&
|
||||
pluginSupportsPlatform(platformIOS, package,
|
||||
requiredMode: PlatformSupport.inline);
|
||||
final bool testMacos = getBoolArg(kPlatformMacos) &&
|
||||
pluginSupportsPlatform(kPlatformMacos, package,
|
||||
final bool testMacOS = getBoolArg(platformMacOS) &&
|
||||
pluginSupportsPlatform(platformMacOS, package,
|
||||
requiredMode: PlatformSupport.inline);
|
||||
|
||||
final bool multiplePlatformsRequested =
|
||||
getBoolArg(kPlatformIos) && getBoolArg(kPlatformMacos);
|
||||
if (!(testIos || testMacos)) {
|
||||
getBoolArg(platformIOS) && getBoolArg(platformMacOS);
|
||||
if (!(testIOS || testMacOS)) {
|
||||
return PackageResult.skip('Not implemented for target platform(s).');
|
||||
}
|
||||
|
||||
final List<String> failures = <String>[];
|
||||
if (testIos &&
|
||||
if (testIOS &&
|
||||
!await _analyzePlugin(package, 'iOS', extraFlags: <String>[
|
||||
'-destination',
|
||||
'generic/platform=iOS Simulator'
|
||||
])) {
|
||||
failures.add('iOS');
|
||||
}
|
||||
if (testMacos && !await _analyzePlugin(package, 'macOS')) {
|
||||
if (testMacOS && !await _analyzePlugin(package, 'macOS')) {
|
||||
failures.add('macOS');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user