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

Option to prefer xcproject over xcworkspace (for schemes) #89

Closed
jandamm opened this issue Feb 14, 2020 · 6 comments · May be fixed by #90
Closed

Option to prefer xcproject over xcworkspace (for schemes) #89

jandamm opened this issue Feb 14, 2020 · 6 comments · May be fixed by #90

Comments

@jandamm
Copy link

jandamm commented Feb 14, 2020

When using Cocoapods you have a workspace where all the schemes of the pods and your own schemes exist.
Most of the time you don't want to run the pods schemes but only your own.

I would like to have an option to ignore the workspace for the list of your schemes.

If you don't like this option another way to fix this would be to look for Pods.xcodeproj and substract these schemes.

I'd try to implement this myself, if you'd be open to merge it 👍

@gfontenot
Copy link
Owner

Oh yeah this is a great idea! Maybe it makes the most sense to open up some kind of g:xcode_scheme_source option that users can set to override the default value (which would be the workspace/project as it works now)? That seems like the most flexible way to tackle it.

If you have the time and want to take this on, I'd love to see a PR and would be more than happy to review/merge it!

@jandamm
Copy link
Author

jandamm commented Feb 15, 2020

I think this matches the current way of configuring the project well.
I'll add that.

I'd like to add g:xcode_ignore_pods where the workspace schemes subtracting Pods/Pods.xcodeproj schemes would be shown. What do you think of this option? I would suggest a default value of 0 to not change the current default behavior.

@gfontenot
Copy link
Owner

I think I'd like to avoid building in any CocoaPods specific knowledge here, honestly. Maybe a compromise would be like g:xcode_scheme_source_ignore which would let you specify projects/workspaces to ignore? Then in your vimrc you could do like:

let g:xcode_scheme_source_ignore = [
  \ "Pods/Pods.xcodeproj"
  \ ]

or whatever to filter out any cocoapods sources from any of your projects?

@mokagio
Copy link

mokagio commented Feb 18, 2020

Love the ignore idea.

@jandamm
Copy link
Author

jandamm commented Mar 4, 2020

I've added the xcode_scheme_source_ignore. Unfortunately it is quite slow as it has to list schemes multiple times.

What do you think of g:xcode_prefer_projects which would result in ignoring any xcworkspace if there is a xcproject in the project root?
I think this would be the easiest solution (at least for me).

@jandamm
Copy link
Author

jandamm commented Aug 10, 2020

I've written a small plugin to source vim-files depending on the current project.
(Think of it as ftplugin/*.vim but using the cwd as project name)
Which fixes this issue for me.

@jandamm jandamm closed this as completed Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants