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

Explicit plugins and plugin configuration #2640

Closed
kylef opened this issue Oct 10, 2014 · 8 comments · Fixed by #2830
Closed

Explicit plugins and plugin configuration #2640

kylef opened this issue Oct 10, 2014 · 8 comments · Fixed by #2830
Assignees
Labels
d1:easy An easy ticket that is a good start for first-time contributors s3:detailed Issues with in-depth explanations and examples that make it easier to troubleshoot t3:discussion These are issues that can be non-issues, and encompass best practices, or plans for the future.

Comments

@kylef
Copy link
Contributor

kylef commented Oct 10, 2014

I think it would be nice to have explicit plugins defined in a Podfile, and also allow passing configuration down to the plugin.

Here's an example of usage:

plugin 'cocoapods-keys'
plugin 'slather'
plugin 'acknowledgements', :plist => 'Resources/Acknowledgements.plist'

This goes along with #2619.

@kylef kylef added the t3:discussion These are issues that can be non-issues, and encompass best practices, or plans for the future. label Oct 10, 2014
@kylef kylef changed the title Explicit plugins and plugin configration Explicit plugins and plugin configuration Oct 10, 2014
@orta
Copy link
Member

orta commented Oct 10, 2014

I think this is a lovely idea. Especially the arguments, right now I do this to ensure consistent per-project settings.

If possible, it'd be good to be able to also put plugin 'keys' and have it prepend cocoapods- if a keys gem can't be found. Understand if ruby gems API makes this unfeasible.

@kylef kylef self-assigned this Oct 10, 2014
@alloy
Copy link
Member

alloy commented Oct 14, 2014

I like this idea 👍

This combined with my thoughts on splitting off Xcode integration into a plugin would possibly allow the removal of the --no-integrate CLI option for:

plugin 'cocoapods-xcode'

And:

plugin 'cocoapods-xcode', :path => 'path/to/Project.xcodeproj'

@orta
Copy link
Member

orta commented Nov 14, 2014

How I'd expect this to work.

The plugins is an explicit contract for the API callbacks that exist in CocoaPods. If you have a plugin that extends the CocoaPods commands like cocoapods-try or cocoapods-open then you do not need to include it. They will still add commands like pod open to the tool.

If the plugin wants to act on a callback from CocoaPods, e.g. cocoapods-keys which makes changes after a Pod has finished it would have to be in the Podfile.

It would be good to install the Gem if it is not installed, and keep the version in the Podfile.lock. If this is basically too crazy it could go.

@segiddins
Copy link
Member

To make this change, when plugins register with the HooksManager, they will have to provide a name.

When run is called on the HooksManager, it will take an optional array of allowed plugin names whose hooks should be run (if empty run no hooks, if nil run all). The Installer will just use the list of allowed plugins in the Podfile. What needs to be decided upon is handling of expected plugins that aren't registered -- I think that the easiest way would be to have the Analyzer ensure that all plugins specified in the Podfile have been registered with the HooksManager.

No Lockfile changes should be needed.

@segiddins segiddins added s3:detailed Issues with in-depth explanations and examples that make it easier to troubleshoot d1:easy An easy ticket that is a good start for first-time contributors labels Nov 14, 2014
@segiddins segiddins self-assigned this Nov 15, 2014
@85danf
Copy link

85danf commented Jan 27, 2016

Hi,
sorry to comment on such an old issue - i'm writing a plugin to work with custom private Spec repositories and i'm trying to figure out if there's a way my plugin can be configured to work globally with a set of parameters instead of having to include it and the parameters in each Podfille.
Is it something that's achievable currently?
Thanks.

@orta
Copy link
Member

orta commented Jan 27, 2016

Your Podfile is ruby, you can do any computation you want

@85danf
Copy link

85danf commented Jan 27, 2016

Ok, but i'm looking to not have to do anything in the Podfile - I want a global configuration for the entire client, or per repo perhaps.

@segiddins
Copy link
Member

@Feldan not possible at the moment, sorry. Please let's not comment on long-closed issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d1:easy An easy ticket that is a good start for first-time contributors s3:detailed Issues with in-depth explanations and examples that make it easier to troubleshoot t3:discussion These are issues that can be non-issues, and encompass best practices, or plans for the future.
Projects
None yet
5 participants