Repository navigation
What's Changed
Fixes
- Cascade-delete orphaned objects on PreviewHost cleanup (#42): Earlier cleanup only removed the first matching
PreviewHostnative target and a single root-group child, leaving the rest of the attached objects orphaned in the pbxproj on every preview run —XCBuildConfiguration(Debug + Release) and theirXCConfigurationList;PBXSourcesBuildPhase/PBXFrameworksBuildPhase/PBXResourcesBuildPhase(and any embed-frameworks copy-files phase) plus theirPBXBuildFileentries;PBXTargetDependencyentries and theirPBXContainerItemProxy; forwardedXCSwiftPackageProductDependencystubs; thePreviewHost.appPBXFileReference(including its slot in the Products group); and additionalPreviewHostPBXGroups with their children. Because each leak left anotherPreviewHosttarget / group in the tree, the next run's.first(where:)only peeled one off and every subsequent inject piled another full set on top — so projects accumulated hundreds of lines of cruft and broken file references pointing at deleted.preview-host-XXXXX/temp directories. Cleanup now iterates over allPreviewHosttargets and cascade-deletes their build phases + build files, configuration list + configurations, dependencies + container item proxies, package product deps, and product reference (also removing it from the Products group); recursively scrubs everyPreviewHostPBXGroupand its children; and runs a final pass to remove any orphanPreviewHost.apprefs left behind by earlier broken cleanups. A regression test runs inject + cleanup three times on the same project and asserts noPreviewHost-related target, group, file ref, or build configuration survives any cleanup pass.
New Contributors
Full Changelog: v2.0.6...v2.0.7