breautek commented on issue #962: URL: https://github.com/apache/cordova-lib/issues/962#issuecomment-3334998398
> The problem is that the plugin uses special code in the build pipeline (build.gradle) that reads configuration directly from package.json. I have no idea what you mean by this. None of Apache-maintained plugins utilises "special code" in gradle, definitely not the geolocation plugin which for android is more or less a dummy plugin just to provide glue for permission requests. > Since aliases is supported by npm, and cordova uses npm for installation I guessed it would work. Aliasing is not supported by Cordova. The id inside `plugin.xml` must match the package.json `name` field. This is primarily for legacy purposes and may change in the future but for today they must match. The plugin xml describes details about the plugin for restoring, and will use the `id` attribute as the package to install on project restoration. So if the plugin id does not match the package name, the restoration process will attempt to install a different package. If you're forking the plugin and changing the package name, you must also update the `plugin.xml` `id` attribute as erisu described above: https://github.com/apache/cordova-lib/issues/962#issuecomment-3332556880 If you have your own private registry, you can also maintain the original plugin id, and still publish your own version of the plugin to that registry, which can be ideal as it won't break potential dependencies if one plugin depends on another plugin. This is what I personally do for some plugins that isn't maintained by the original authors. For these reasons I'm closing this issue, it's not a bug. I understand how this can be confusing. Personally I want to get rid of `plugin.xml` altogether or at least most of it, have the `package.json` the single source of truth for plugin id and version at the very least. The last time I explored this topic though I think there were concerns on breaking existing plugins. If plugin id from `plugin.xml` was not used at all by Cordova tooling, then the NPM aliasing will probably just simply work. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
