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
[SR-13948] SPM doesn't exclude files and directories marked as exclude #4460
Comments
@swift-ci create |
The `exclude` parameter solely has an effect on the build, not on which files are shown in Xcode. Xcode will currently always show any files that are part of the directory tree that contains the package manifest (with some limited exceptions, e.g. we won't show .xcodeproj files). |
Comment by Ariel Elkin (JIRA) @neonichu I see now. I find this counterintuitive. When Xcode opens an .xcodeproj file it only displays the files included therein. This is intuitive, as you'd expect to see just the files included in the Xcode project. So I would expect Xcode to behave analogously when opening a Package.swift file. It should just display files explicitly marked as being part of the package, and not display files explicitly marked as NOT being part of the package. In addition, showing excluded files in Xcode leads to unnecessarily higher cognitive load (a package's directory can include files irrelevant to the package itself such as ci scripts, derived data folders, ancillary files from other dependency managers. All these will bloat Xcode's UI) Please consider amending the current behaviour, or updating the docs for `exclude` |
Seconded! I am the developer of a free and opensource library and I find this to be very annoying. For Cocoapods support this issue doesn't appear for our users. For SPM support it does. My first reaction and others from my users was this was a huge issue for our Swift package. Is there any way to prioritize this? @neonichu @tomerd @shahmishal Thanks! |
@neonichu this seems to be more of an Xcode level issue, correct? |
Yep, this is entirely about what is shown by the project navigator in Xcode. |
is there better way to track this then? maybe apple feedback? |
I recently faced a similar issue. I ended up using a workaround posted here to use an empty
|
@setoelkahfi is this issue reproducible for you only in Xcode or with command-line invocations of SwiftPM too? |
Attachment: Download
Environment
Swift 5.3
Xcode 12.2
Additional Detail from JIRA
md5: 935b0a6f5320e383eed668eabaa960a1
Issue Description:
Marking directories and files in a target's `exclude` seems to have no effect.
See an example here:
https://github.com/pocketsvg/PocketSVG/
https://github.com/pocketsvg/PocketSVG/blob/master/Package.swift#L25
I would expect "Demos", "ci", "derived_data", "PocketSVG.podspec" to be excluded, but they are still included in the package when you open it in Xcode.
The text was updated successfully, but these errors were encountered: