Chris Bracken 385f23c545 macOS: Clean up create_macos_framework.py (#54543) (flutter/engine#54555)
Over time, this script and others in `sky/tools` have accumulated a lot of additional and sometimes duplicate code.

This is a first pass cleanup of `create_macos_framework.py` to extract common utility code to `sky/utils.py` and refactor for better readability.

The iOS analogue of this patch was flutter/engine#54500.

This is a reland of flutter/engine#54543 (reverted in flutter/engine#54550), which failed to set the `-y` option (preserve symlinks) when zipping `FlutterMacOS.xcframework` but did so for the other zip steps where required. Since there is no case where we *want* to archive dereferenced symlinks, and because it's required for macOS frameworks, we now set this option for all callers in the `sky_tools.create_zip()` function to avoid future cases where someone working on this code misses one. If we ever need it, we can extract a parameter. This patch also references the correct script in its description (the original incorrectly mentioned `create_ios_framework.py`).

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-14 19:55:20 +00:00
..