peripheryapp / periphery

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

Local Swift package not found after upgrading from 2.20.0 to 2.21.0 #756

Closed neilsardesai closed 2 weeks ago

neilsardesai commented 2 weeks ago

Hello, I just tried updating from Periphery 2.20.0 to 2.21.0, and the same command that used to work before is now erroring:

periphery scan --project 'PROJECT NAME.xcodeproj' --schemes 'MAIN APP' --targets 'MAIN APP' 'MAINAPPUI' 'MAIN APP TESTS' --retain-public --skip-schemes-validation --format Xcode

* Inspecting project... error: Target 'MAINAPPUI' does not exist in 'PROJECT NAME.xcodeproj'.

MAINAPPUI is a local Swift package consumed by MAIN APP. I wonder if this issue might be related to recent changes around handling of local Swift packages? (https://github.com/peripheryapp/periphery/commit/c0846a6019304587d3c351b3cfb80cd0f20d18c8)

ileitch commented 2 weeks ago

Is the local package listed in Package Dependencies in your project settings?

neilsardesai commented 2 weeks ago

Hey Ian, no the local package isn’t listed in Package Dependencies

ileitch commented 2 weeks ago

Adding it should fix the issue

neilsardesai commented 2 weeks ago

That did the trick. Thanks! I’ll go ahead and close this as resolved