cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Braden Shepherdson <bra...@chromium.org>
Subject Updating plugin code on prepare
Date Tue, 24 Sep 2013 18:58:53 GMT
Michal and I were discussing how to make the plugin developer experience
better, by having `cordova prepare` update the platform projects properly
when you change a plugin in place.

I propose the following changes:

1. On plugin install, we cache the plugin.xml in $PROJECT/.cordova
somewhere.
2. On 'cordova prepare', compare each plugin's plugin.xml against the
cached one.
    a. If they have changed, uninstall the plugin using the old plugin.xml,
then reinstall using the new one (and update the cached plugin.xml).
    b. If they are identical, copy all the native code files from the
plugin into the project again.

The idea is that you can change your plugin's native code, JS modules, or
assets, and after a prepare you'll be running the latest. We already have
cordova plugin add foo --link, but it wasn't very useful. This will make
plugin development a much smoother flow, without too much implementation
effort.

Checking for changes to plugin.xml lets us know that no files have been
added or removed, that <config-file> edits haven't changed, and so on,
meaning that simply copying the native code again will be sufficient.

What do people think? Any gotchas that I overlooked?

Braden

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message