reintegrating modified plugin code (Android)

8 views
Skip to first unread message

Justin Regele

unread,
Mar 30, 2015, 2:54:18 PM3/30/15
to phon...@googlegroups.com
Does anyone know if it is possible to recompile plugin source code using the cordova cli? I found this post which wasn't very useful

A bit of background, I've integrated the cordova barcodescanner plugin into my app, but since it works in android as an activity that phonegap passes control to, I didn't have the control I needed per the project requirements. After using Android Studio to modify the zxing scanner activity code, I've got it working as a custom activity, but copying my changes back into the plugin directory tree doesn't work as the plugin isn't recompiling.

Any ideas?

Kerri Shotts

unread,
Mar 30, 2015, 3:39:59 PM3/30/15
to phon...@googlegroups.com
Personally, I'd abstract it out in to its own plugin. You don't have to share it if you don't want to (though it might be nice), since the CLIs can install locally. That way you can version track it nicely, and it will continue to play nice with the CLI.

Essentially you can duplicate the plugin's code tree, adjust the code as necessary (copy your changed files), and then alter the plugin.xml as needed. After that, uninstall the original barcode plugin and install yours (cordova plugin add path/to/plugin). Then if you need to make additional changes, do them in the plugin and then rm/add it again. 

Justin Regele

unread,
Mar 30, 2015, 5:43:23 PM3/30/15
to phon...@googlegroups.com
Thanks for your response.

I copied the plugin code to another directory and was able to add it locally, even make the app break by commenting out layouts, but when I commented out critical pieces of code, the app ran just fine. So I guess if I need to go this route I need to figure out how to recompile the Library within the plugin, as no compilation of the library happens during the build chain

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to a topic in the Google Groups "phonegap" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phonegap/VlCt1_Hw__Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages