You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/03/30 13:24:44 UTC
[GitHub] [cordova-cli] jfoclpf opened a new issue #552: Plugin to be installed only in a specific platform
jfoclpf opened a new issue #552:
URL: https://github.com/apache/cordova-cli/issues/552
# Feature Request
## Motivation Behind Feature
<!-- Why should this feature be implemented? What problem does it solve? -->
Many plugins do work only in a specific platform and crash in other platforms during build. Furthermore many plugins are specifically designed to a specific platform only, but their creators did not take that into account. There's also a popular request for this in Stackoverflow.
## Feature Description
<!--
Describe your feature request in detail
Please provide any code examples or screenshots of what this feature would look like
Are there any drawbacks? Will this break anything for existing users?
-->
It would be very advantageous to have in `package.json` some sort of way to inform that we just want a specific plugin installed only in a specific platform, and not in all platforms.
## Alternatives or Workarounds
<!--
Describe alternatives or workarounds you are currently using
Are there ways to do this with existing functionality?
-->
We can use plugman but it's not reliable nor there is a way to tell other people that we want a certain plugin installed only on a specific platform. I suppose we can also use a hook, but I was wondering before which event should we consider to process. We can also have git branches with different versions of `package.json` for different platforms.
The best way would be undoubtedly to have that information directly stored in `package.json`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-cli] jfoclpf commented on issue #552: Install plugin only in a specific platform (defined in package.json)
Posted by GitBox <gi...@apache.org>.
jfoclpf commented on issue #552:
URL: https://github.com/apache/cordova-cli/issues/552#issuecomment-810495966
Hi @breautek I know hooks, my projects have several hooks, but for now I just followed your tip and forked the plugin.
> Perhaps the before_plugin_install hook can be utilised for this and maybe you can modify the plugin.xml before Cordova consumes it to install it to the platforms.
Yes, it seems the way to go, but is `before_plugin_install` also triggered upon `cordova platform add <platform>` when plugins are installed? I suppose so but I want to be sure.
If I develop such hook it would be nice to share it, is there any repository of those general tool hooks? Once I also developed a nice [hook](https://github.com/jfoclpf/form-for-parking-violation/blob/master/hooks/convertHbsToHtml.js) for example for having handlebars partials in html and not a single big HTML file, but there's no easy way to share it with others for them to integrate in their projects.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-cli] breautek commented on issue #552: Install plugin only in a specific platform (defined in package.json)
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #552:
URL: https://github.com/apache/cordova-cli/issues/552#issuecomment-810347271
I'm not really sure what is involved... not exactly experienced with that of the Cordova codebase... but I think the hook idea is definitely worth a try.
Perhaps the `before_plugin_install` hook can be utilised for this and maybe you can modify the `plugin.xml` before Cordova consumes it to install it to the platforms. Hacky... but may work as a workaround.
https://cordova.apache.org/docs/en/10.x/guide/appdev/hooks/index.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-cli] breautek commented on issue #552: Plugin to be installed only in a specific platform (info stored in package.json)
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #552:
URL: https://github.com/apache/cordova-cli/issues/552#issuecomment-810241366
I know this isn't very clean and not a permanent solution, but a plugin could be forked and the other implementations could be removed from the `plugin.xml` file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-cli] jfoclpf commented on issue #552: Install plugin only in a specific platform (defined in package.json)
Posted by GitBox <gi...@apache.org>.
jfoclpf commented on issue #552:
URL: https://github.com/apache/cordova-cli/issues/552#issuecomment-810263500
I can fork a plugin to remove a platform but then I will not fetch the updates the plugin's creator will eventually make for the platform where it does work.
Do you think this is doable and integratable with a hook? Which before event should I process? Is Cordova Cli based on node? If you want I can develop some hook in nodejs to implement this feature.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org