Skip to content

v2.0.7 – PreviewHost cleanup no longer leaks pbxproj entries

Latest

Choose a tag to compare

@Iron-Ham Iron-Ham released this 11 May 14:40
· 1 commit to main since this release
9f291f6

What's Changed

Fixes

  • Cascade-delete orphaned objects on PreviewHost cleanup (#42): Earlier cleanup only removed the first matching PreviewHost native 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 their XCConfigurationList; PBXSourcesBuildPhase / PBXFrameworksBuildPhase / PBXResourcesBuildPhase (and any embed-frameworks copy-files phase) plus their PBXBuildFile entries; PBXTargetDependency entries and their PBXContainerItemProxy; forwarded XCSwiftPackageProductDependency stubs; the PreviewHost.app PBXFileReference (including its slot in the Products group); and additional PreviewHost PBXGroups with their children. Because each leak left another PreviewHost target / 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 all PreviewHost targets 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 every PreviewHost PBXGroup and its children; and runs a final pass to remove any orphan PreviewHost.app refs left behind by earlier broken cleanups. A regression test runs inject + cleanup three times on the same project and asserts no PreviewHost-related target, group, file ref, or build configuration survives any cleanup pass.

New Contributors

  • 🎉 @teradyl made their first contribution in #42 — thank you!

Full Changelog: v2.0.6...v2.0.7