jxcore/jxcore-cordova

The Right™ way of recompiling jxcore-cordova after updating extensions

julianh2o opened this issue · 5 comments

I used "jxc install" to install jxcore-cordova this time around and now need to update the plugin.xml, JXcoreExtension.java, and JXcoreExtension.h/m files.

What is the "Right" way of doing this?

I tinkered with it a bit but figured out that the following works:

cp -r plugins/io.jxcore.node ./       #Copy the io.jxcore.node folder out of plugins
cordova plugin remove io.jxcore.node  #remove the plugin
cp <newversion> ./plugin.xml
cp <newversion> ./io.jxcore.node/src/android/java/io/jxcore/node/JXcoreExtension.java
cp <newversion> ./io.jxcore.node/src/ios/JXcoreExtension.h
cp <newversion> ./io.jxcore.node/src/ios/JXcoreExtension.m
cordova plugin add io.jxcore.node     #now adding plugin from the temp folder in the root directory of the project
rm -rf io.jxcore.node                 #clean up the temporary folder

Is there a better way of doing this? Should there be? Perhaps a "jxc rebuild" or something like that?

I see "jxc update" and I'm wondering if this may be what I'm looking for... but it sounds like this is intended for downloading a new version and installing it rather than recompiling.

I see "jxc update" and I'm wondering if this may be what I'm looking for...

In fact jxc update is just an alias to jxc install --force.

Is there a better way of doing this?

Well, if your <newversion> is a copy of io.jxcore.node and contains your updates, you may call:

$ jxc install --force /path/to/newversion
or
$ jxc update /path/to/newversion

UPDATE:

$ jxc install /path/to/newversion --force

If you made the changes in place inside plugins/io.jxcore.node, you'd still have to copy the folder out, remove the plugin and reinstall it.. huh?

cordova build android or cordova build ios should be sufficient though..

If you made the changes in place inside plugins/io.jxcore.node,

I understood that you keep your changes in <newversion> folder. Then I assumed it stays e.g. outside cordova app folder (say /path/to/newversion). If that's the case then the above command will work and there will be no need for manual copy anymore as long as your <newversion> is a copy of io.jxcore.node, but contains your updates.

But if you modified contents of plugins/io.jxcore.node then @obastemur is right.

Ooh, yes, cordova build android and cordova build ios is what I'm looking for.

I keep my code in a non-compatible directory structure elsewhere. My makefile is in charge of setting up and rebuilding cordova (when building for mobile). I'll just update my makefile to copy the updated files into the plugins directory and run cordova build