feat(flutter_tools): migrate Apple build commands to typed options - #192818
Conversation
…ions # Conflicts: # packages/flutter_tools/lib/src/runner/flutter_command.dart
There was a problem hiding this comment.
Code Review
This pull request refactors command-line option registration across several Apple-related build commands to use a structured, descriptor-based approach with OptionDescriptor and OptionBundle. A critical compilation issue was identified in DarwinAddToAppOptionsBundle.onRegister, where the non-existent methods enableUsesTargetOption and enableUsesPubOption are called on FlutterCommand instead of usesTargetOption and usesPubOption.
…ions # Conflicts: # packages/flutter_tools/lib/src/commands/build_ios.dart # packages/flutter_tools/lib/src/commands/build_macos.dart
|
@kevmoo some tests are failing: |
…ateTests
`BuildSwiftPackage.generateTests` previously checked `boolArg('ci', global: true)`,
which is only true when `--ci` is explicitly passed on the command line.
Using `usingCISystem` caused `generateTests` to return `true` whenever
`LUCI_CI=True` was set in the environment on LUCI bots (breaking
`swift_package_manager_add2app_test.dart` in `Mac tool_integration_tests_8`).
- Add `CommonOptions.ci` (`OptionScope.global`) for `--ci` and register it in `FlutterCommandRunner`.
- Update `FlutterCommand.usingCISystem` and `BuildSwiftPackage.generateTests` to read `getValue(CommonOptions.ci)`.
- Add hermetic regression test in `build_swift_package_test.dart`.
|
Thanks for flagging, @okorohelijah! Fixed in 45abce6. Root cause: We added a typed global descriptor |
Migrates Apple build subcommands (
build ios,build ipa,build macos,build ios-framework,build macos-framework, andbuild swift-package) to use typed option descriptors and option bundles.BuildInfoOptions.codesignIdentityandDebuggingOptionDescriptors.publishPortdescriptors.AppleBuildOptionsBundlefor common Apple compilation and build options (flavor,splitDebugInfo,obfuscate,extraFrontEndOptions,extraGenSnapshotOptions,performanceMeasurementFile,analyzeSize, andcodeSizeDirectory).DarwinCodeSignXCFrameworksOptionsBundlecomposingcodesignandcodesignIdentity.usesDarwinCodeSignXCFrameworksOptionhelper fromFlutterCommandas all callers (build ios-framework,build macos-framework,build swift-package) have migrated.FlutterCommand.addPublishPortandFlutterCommand.disablePortPublicationto useDebuggingOptionDescriptors.publishPort.registerOptionBundlesandargParser.addDescriptors.getValue(...)/wasParsed(...)viaSafeArgResults.AppleBuildOptionsBundleandDarwinCodeSignXCFrameworksOptionsBundleinoption_descriptor_test.dart.Pre-launch Checklist
///).