Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scanning project containing local packages #787

Open
PiotrPawlus opened this issue Aug 14, 2024 · 2 comments
Open

Scanning project containing local packages #787

PiotrPawlus opened this issue Aug 14, 2024 · 2 comments
Labels
needs investigation Bug report that needs confirmation
Milestone

Comments

@PiotrPawlus
Copy link

Description

I'm currently working on a project that contains one target but multiple schemes that represent my Local packages. CLI generates the YML file detecting all targets and schemes.

Steps to Reproduce

index_store_path:
- build/DerivedData/My_Project/Index.noindex/DataStore
retain_public: true
retain_objc_accessible: true
retain_objc_annotated: true
retain_assign_only_properties: true
retain_assign_only_property_types: true
retain_swift_ui_previews: true                        
retain_codable_properties: true
verbose: false
schemes:
- Ads
- MyFoundation
- MyProject
- Design
# And many many more 
skip_build: true
targets:
- MyProject
workspace: MyProject.xcworkspace

Actual Behavior

The "main" project is scanned correctly. The local packages are not scanned.

Environment

  • periphery version 2.21.0
  • Xcode 15.4

Additionally

  • I tried to build the project with xcodebuild for each of the targets but periphery won't allow me to provide dd for each of it for each of the schemes we have
@Xopoko
Copy link

Xopoko commented Aug 14, 2024

I’m experiencing the exact same issue!

Initially, I thought it was related to my settings, so I tried modifying various project build configurations (using Tuist). I even looked into the 'DataStore/V5' folder to see what was inside and found that it contains files from local packages. However, Periphery still only scans the files that are directly part of the project, ignoring those in the packages.

I also tried opening the package using the xed . command, and then I ran xcodebuild from the generated .xcworkspace. After that, I pointed Periphery to the DerivedData directory that was created, and it successfully scanned and identified unused code in that specific package.

UPD:

During debugging, I noticed that localPackages in XcodeProject.swift is always empty. I tried to fix it by allowing the paths for each local package to be passed through configuration, but that didn't help. I continued debugging and discovered that Periphery only works with source files listed in .pbxproj. The source files of my local packages weren't there. I'm still searching for the bug.

UPD:
The new version 3.0.0.beta2 fixes this problem.

@ileitch ileitch added the needs investigation Bug report that needs confirmation label Aug 23, 2024
@ileitch ileitch added this to the v3 milestone Sep 15, 2024
@ileitch
Copy link
Contributor

ileitch commented Sep 15, 2024

As noted by @Xopoko, this should be resolved in the 3.0 beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation Bug report that needs confirmation
Projects
None yet
Development

No branches or pull requests

3 participants