What's the best workflow for development of Cordova plugins?


#1

I am developing a Cordova plugin (iOS only at this point). I’ve put the plugin into the local/plugins folder. Whenever I change my Objective C code there, it triggers reload, but the plugin does not get reloaded.

So, to avoid restarting Meteor all the time, I have to write my code in .meteor/local/cordova-build/platforms/ios/myname/Plugins folder. I then simply press the triangle “Build and Run” button in xcode, and my plugin is loaded.

(In fact, I am developing inside xcode).

Now all is great, but I have to remember to select-all, copy and paste from xcode to local/plugins, and I am fortunate that it’s just one file. If I forget to do that and restart Meteor, I lose my changes. (Has happened a coupe of times).

To solve this, I removed meteor/local from .gitignore, and now can at least find my changes in git, usually (it also gives me a nice awareness of Meteor’s internals, so all is cool).

This is kind of crazy. Is there a better way?


#2

You shouldn’t have to put your plugin in .meteor/local/plugins manually. Instead, what you might want to do is to develop your plugin in a separate repository and add its working directory using the meteor add cordova file://... syntax. Adding plugins from the local file system means they will be rebuilt every time you do a meteor run.