Closed SomaticIT closed 8 years ago
I made one mistake and mixed two separate functionalities in one repo — plugin and preference generator. Until Cordova 5.0 this is not a problem because cordova using one repo for modules and you can install generators by running npm. Seems like your PR can handle this problem.
Thanks for merging.
I tested it with Cordova 5.3.3 and it seems to work with both build-app-settings.js
and cordova prepare
.
One thing I didn't report in my previous comment, I had to replace libxmljs
dependency by elementtree
which is user by cordova-lib internally.
Thanks.
Did you publish 0.7.2 release ?
Yes, you can update via npm. I've already found libxmljs
> elementtree
migration and it is fine.
Great ! Thanks.
facing a small issue cause of this. if i remove and re-add android platform getting following error -
Error: ENOENT, open 'platforms/android/src/me/apla/cordova/AppPreferencesActivity.java'
at Error (native)
perhaps moving the hook to before_build might help?
I don't add platform directory to version control. I also do customization on plugins and sometimes need to reset platform directory.
Hello,
This PR is linked to issue #46. This PR allows to automatically generates natives bindings for
app-settings.json
.To avoid code duplication and optimise build process I rewrote
lib/mobile_preferences.js
into separated context independent modules and using promises to be compatible with Cordova Hooks:lib/filesystem.js
: Wrapper for nativefs
module using promise.lib/settings.js
: Manageapp-settings.json
(get, create, remove).lib/mappings.js
: Contains mapping definitions for each platforms.lib/ios.js,lib/android.js
: Platform specific modules which expose build and clean methods.All those modules have dependencies injected, allowing to use Cordova inner require context when using plugin from cli (using hooks) and node.js context when using the plugin from
plugman
(usingbuild-app-settings.js
).Then I added 3 books :
app-settings.json
to application.prepare
opérations. It adds Native bindings and XML configuration to platforms projects usingapp-settings.json
configuration.I also moved existing tests to separates spec definitions in order to keep tests aligned with lib.
Possible Improvements :
Hope you will love it.