flutter/packages/flutter_tools/bin
Victoria Ashworth e18c5e209c
Improve build time when using SwiftPM (#150052)
When using SwiftPM, we use `flutter assemble` in an Xcode Pre-action to run the `debug_unpack_macos` (or profile/release) target. This target is also later used in a Run Script build phase. Depending on `ARCHS` build setting, the Flutter/FlutterMacOS binary is thinned. In the Run Script build phase, `ARCHS` is filtered to the active arch. However, in the Pre-action it doesn't always filter to the active arch. As a workaround, assume arm64 if the [`NATIVE_ARCH`](https://developer.apple.com/documentation/xcode/build-settings-reference/#NATIVEARCH) is arm, otherwise assume x86_64.

Also, this PR adds a define flag `PreBuildAction`, which gives the Pre-action a [unique configuration of defines](fdb74fd3e7/packages/flutter_tools/lib/src/build_system/build_system.dart (L355-L372)) and therefore a separate filecache from the Run Script build phase filecache. This improves caching so the Run Script build phase action doesn't find missing targets in the filecache. It also uses this flag to skip cleaning up the previous build files.

Lastly, skip the Pre-action if the build command is `clean`.

Note: For iOS, if [`CodesignIdentity`](14df7be3f9/packages/flutter_tools/bin/xcode_backend.dart (L470-L473)) is set, the Pre-action and Run Script build phase will not match because the Pre-action does not send the `EXPANDED_CODE_SIGN_IDENTITY` and therefore will codesign it with [`-`](14df7be3f9/packages/flutter_tools/lib/src/build_system/targets/ios.dart (L695)) instead. This will cause `debug_unpack_macos` to invalidate and rerun every time. A potential solution would be to move [codesigning out of the Run Script build phase](14df7be3f9/packages/flutter_tools/lib/src/build_system/targets/ios.dart (L299)) to the [Thin Binary build phase](14df7be3f9/packages/flutter_tools/bin/xcode_backend.dart (L204-L257)) after it's copied into the TARGET_BUILD_DIR, like we do with [macOS](14df7be3f9/packages/flutter_tools/bin/macos_assemble.sh (L179-L183)).
2024-06-12 21:16:07 +00:00
..
analysis_options.yaml Enable avoid_print lint. (#91444) 2021-10-07 16:48:04 -07:00
flutter_tools.dart Reland "Null safety migration of packages/flutter_tools/bin" (#111756) 2022-09-16 12:39:55 -07:00
fuchsia_asset_builder.dart consolidate AssetBundle::entries and AssetBundle::entryKinds into a new type, AssetBundleEntry (#142029) 2024-01-23 22:00:46 +00:00
fuchsia_tester.dart Reland "Move native assets to isolated/ directory" (#143055) 2024-02-08 17:49:48 +00:00
macos_assemble.sh Improve build time when using SwiftPM (#150052) 2024-06-12 21:16:07 +00:00
podhelper.rb Replace CocoaPods deprecated exists? with exist? (#147056) 2024-04-19 15:21:04 +00:00
tool_backend.bat License update (#45373) 2019-11-27 15:04:02 -08:00
tool_backend.dart Enable native compilation for windows-arm64 (#141930) 2024-01-26 00:08:20 +00:00
tool_backend.sh License update (#45373) 2019-11-27 15:04:02 -08:00
xcode_backend.dart Improve build time when using SwiftPM (#150052) 2024-06-12 21:16:07 +00:00
xcode_backend.sh [flutter_tools] Port xcode backend to dart (#86753) 2021-07-27 14:39:05 -07:00
xcode_debug.js Wait for CONFIGURATION_BUILD_DIR to update when debugging with Xcode (#135444) 2023-09-26 17:48:19 +00:00