MobileNativeFoundation / rules_xcodeproj

Bazel rules for generating Xcode projects.
MIT License
521 stars 83 forks source link

Fix Xcode Previews in App Extensions #2999

Closed andre-alves closed 5 months ago

andre-alves commented 6 months ago

Fix #2997.

brentleyjones commented 6 months ago

Thanks for this. I'll consider this and another possible change (to fix an incremental install issue).

andre-alves commented 6 months ago

I just noticed while testing in my project that this diff is not 100% respecting focus settings. I'm trying to respect focused_targets and unfocused_targerts because we should only add to direct_dependencies when the extension target has a target in Xcode.

ERROR: Internal precondition failure:
external/rules_xcodeproj/tools/generators/pbxtargetdependencies/src/Generator/ConsolidateTargets.swift:145: Target "@//iFood:iFoodApp ios-sim_arm64-min14.0-applebin_ios-ios_sim_arm64-dbg-ST-be4f50282876" dependency on "@//iFood/WidgetExtension:WidgetExtension ios-sim_arm64-min14.0-applebin_ios-ios_sim_arm64-dbg-ST-be4f50282876" not found in `targetIDMapping`

I was expecting focused_extension_infos to have extensions filtered out in all cases, will need to investigate more.

Thanks Brentley!

----- EDIT -----

Updated to use extensions_info + focused_labels filter, fixed the issue above.

andre-alves commented 5 months ago

Fixed in https://github.com/MobileNativeFoundation/rules_xcodeproj/pull/3005 Closed.