peripheryapp / periphery

A tool to identify unused code in Swift projects.
MIT License
5.02k stars 178 forks source link

Do you have any idea how I can integrate Xcode generated source code? #726

Open AF-cgi opened 3 months ago

AF-cgi commented 3 months ago

Using Xcode 15.2, periphery 2.18.0. I want to use periphery also to scan generated code from SwiftGen, R.swift, Xcode or macros. For SwiftGen and R.swift it's not a big deal, because their output files are part of the Xcode project directly. But for Xcode-generated code like GeneratedAssetSymbols.swift or macros like #Preview it doesn't work. Maybe you have an idea how I can solve this. The GeneratedAssetSymbols.swift is located at ~/Library/Developer/Xcode/DerivedData/YourProject-abc123/Build/Intermediates.noindex/YourProject.build/Debug-iphonesimulator/YourProject.build/DerivedSources/*.swift. The macros are located at /private/var/folders/x4/pm..._.../T/swift-generated-sources

Lommelun commented 3 weeks ago

Same thing for xcode package plugin generated code. Stored at ~/Library/Developer/Xcode/DerivedData/*/SourcePackages/Plugins/*.output/**/*.