When building for any platform (iOS, macOS, web, or Android) from an Intel machine, we should print a message that this will be unsupported in a future version of Flutter.
See Design Doc: https://flutter.dev/go/macos-intel-deprecation
The host platform can be checked using globals.os.hostPlatform:
|
DarwinArch getCurrentDarwinArch() { |
|
return switch (globals.os.hostPlatform) { |
|
HostPlatform.darwin_arm64 => DarwinArch.arm64, |
|
HostPlatform.darwin_x64 => DarwinArch.x86_64, |
|
final HostPlatform unsupported => throw Exception( |
|
'Unsupported Darwin host platform "$unsupported"', |
|
), |
|
}; |
|
} |
I think likely the right place to print the warning is in FlutterCommand.verifyThenRunCommand so it's ran with every command:
|
Future<FlutterCommandResult> verifyThenRunCommand(String? commandPath) async { |
|
globals.preRunValidator.validate(); |
|
|
|
if (refreshWirelessDevices) { |
|
// Loading wireless devices takes longer so start it early. |
|
_targetDevices.startExtendedWirelessDeviceDiscovery( |
|
deviceDiscoveryTimeout: deviceDiscoveryTimeout, |
|
); |
|
} |
|
|
|
final FlutterProject project; |
|
try { |
|
project = await _updateCacheAndRunPubGet(); |
|
} finally { |
|
globals.cache.releaseLock(); |
|
} |
|
|
|
if (regeneratePlatformSpecificToolingDuringVerify) { |
|
await regeneratePlatformSpecificToolingIfApplicable( |
|
project, |
|
releaseMode: getBuildMode().isRelease, |
|
); |
|
} |
|
|
|
setupApplicationPackages(); |
|
|
|
if (commandPath != null) { |
|
analytics.send(await unifiedAnalyticsUsageValues(commandPath)); |
|
} |
|
|
|
return runCommand(); |
|
} |
When building for any platform (iOS, macOS, web, or Android) from an Intel machine, we should print a message that this will be unsupported in a future version of Flutter.
See Design Doc: https://flutter.dev/go/macos-intel-deprecation
The host platform can be checked using
globals.os.hostPlatform:flutter/packages/flutter_tools/lib/src/build_info.dart
Lines 845 to 853 in e228771
I think likely the right place to print the warning is in
FlutterCommand.verifyThenRunCommandso it's ran with every command:flutter/packages/flutter_tools/lib/src/runner/flutter_command.dart
Lines 1930 to 1961 in e228771