{"action":"opened","number":50,"pull_request":{"url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/pulls/50","id":48009279,"html_url":"https://github.com/apla/me.apla.cordova.app-preferences/pull/50","diff_url":"https://github.com/apla/me.apla.cordova.app-preferences/pull/50.diff","patch_url":"https://github.com/apla/me.apla.cordova.app-preferences/pull/50.patch","issue_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/issues/50","number":50,"state":"open","locked":false,"title":"Automate plugin processing using hooks and automate ios xcodeproj insertion","user":{"login":"SomaticIT","id":3431295,"avatar_url":"https://avatars.githubusercontent.com/u/3431295?v=3","gravatar_id":"","url":"https://api.github.com/users/SomaticIT","html_url":"https://github.com/SomaticIT","followers_url":"https://api.github.com/users/SomaticIT/followers","following_url":"https://api.github.com/users/SomaticIT/following{/other_user}","gists_url":"https://api.github.com/users/SomaticIT/gists{/gist_id}","starred_url":"https://api.github.com/users/SomaticIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SomaticIT/subscriptions","organizations_url":"https://api.github.com/users/SomaticIT/orgs","repos_url":"https://api.github.com/users/SomaticIT/repos","events_url":"https://api.github.com/users/SomaticIT/events{/privacy}","received_events_url":"https://api.github.com/users/SomaticIT/received_events","type":"User","site_admin":false},"body":"Hello,\r\n\r\nThis PR is linked to issue #46.\r\nThis PR allows to automatically generates natives bindings for `app-settings.json`.\r\n\r\nTo 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](https://cordova.apache.org/docs/en/5.1.1/guide/appdev/hooks/index.html#link-7):\r\n* `lib/filesystem.js`: Wrapper for native `fs` module using promise.\r\n* `lib/settings.js`: Manage `app-settings.json` (get, create, remove).\r\n* `lib/mappings.js`: Contains mapping definitions for each platforms.\r\n* `lib/ios.js,lib/android.js`: Platform specific modules which expose build and clean methods.\r\n\r\nAll 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` (using `build-app-settings.js`).\r\n\r\nThen I added 3 books :\r\n* __after_plugin_add__: This hook is executed immediately after plugin installation. It adds a default `app-settings.json` to application.\r\n* __before_plugin_rm__: This hook is executed just before plugin uninstallation. It clean every modifications done by the plugin (native code, XML configurations, etc.).\r\n* __after_render__: This hook is executed immediately after each `prepare` opérations. It adds Native bindings and XML configuration to platforms projects using `app-settings.json` configuration.\r\n\r\nI also moved existing tests to separates spec definitions in order to keep tests aligned with lib.\r\n\r\nPossible Improvements :\r\n* Only build prepared platform during __after_render__ book.\r\n* Easily build new platforms by creating a new independent platform module (eg. build html form for Windows, blackberry, etc.).\r\n\r\nHope you will love it.","created_at":"2015-10-18T14:16:17Z","updated_at":"2015-10-18T14:16:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/pulls/50/commits","review_comments_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/pulls/50/comments","review_comment_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/issues/50/comments","statuses_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/statuses/d1b4629d5b05bff507d8453a42eb1c7b0727defe","head":{"label":"Touchit:plugin-automation","ref":"plugin-automation","sha":"d1b4629d5b05bff507d8453a42eb1c7b0727defe","user":{"login":"Touchit","id":4162992,"avatar_url":"https://avatars.githubusercontent.com/u/4162992?v=3","gravatar_id":"","url":"https://api.github.com/users/Touchit","html_url":"https://github.com/Touchit","followers_url":"https://api.github.com/users/Touchit/followers","following_url":"https://api.github.com/users/Touchit/following{/other_user}","gists_url":"https://api.github.com/users/Touchit/gists{/gist_id}","starred_url":"https://api.github.com/users/Touchit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Touchit/subscriptions","organizations_url":"https://api.github.com/users/Touchit/orgs","repos_url":"https://api.github.com/users/Touchit/repos","events_url":"https://api.github.com/users/Touchit/events{/privacy}","received_events_url":"https://api.github.com/users/Touchit/received_events","type":"Organization","site_admin":false},"repo":{"id":44469787,"name":"me.apla.cordova.app-preferences","full_name":"Touchit/me.apla.cordova.app-preferences","owner":{"login":"Touchit","id":4162992,"avatar_url":"https://avatars.githubusercontent.com/u/4162992?v=3","gravatar_id":"","url":"https://api.github.com/users/Touchit","html_url":"https://github.com/Touchit","followers_url":"https://api.github.com/users/Touchit/followers","following_url":"https://api.github.com/users/Touchit/following{/other_user}","gists_url":"https://api.github.com/users/Touchit/gists{/gist_id}","starred_url":"https://api.github.com/users/Touchit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Touchit/subscriptions","organizations_url":"https://api.github.com/users/Touchit/orgs","repos_url":"https://api.github.com/users/Touchit/repos","events_url":"https://api.github.com/users/Touchit/events{/privacy}","received_events_url":"https://api.github.com/users/Touchit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Touchit/me.apla.cordova.app-preferences","description":"App preferences plugin for cordova","fork":true,"url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences","forks_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/forks","keys_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/teams","hooks_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/hooks","issue_events_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/issues/events{/number}","events_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/events","assignees_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/assignees{/user}","branches_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/branches{/branch}","tags_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/tags","blobs_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/git/refs{/sha}","trees_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/statuses/{sha}","languages_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/languages","stargazers_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/stargazers","contributors_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/contributors","subscribers_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/subscribers","subscription_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/subscription","commits_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/commits{/sha}","git_commits_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/git/commits{/sha}","comments_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/comments{/number}","issue_comment_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/issues/comments{/number}","contents_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/contents/{+path}","compare_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/merges","archive_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/downloads","issues_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/issues{/number}","pulls_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/pulls{/number}","milestones_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/milestones{/number}","notifications_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/labels{/name}","releases_url":"https://api.github.com/repos/Touchit/me.apla.cordova.app-preferences/releases{/id}","created_at":"2015-10-18T07:44:52Z","updated_at":"2015-10-18T07:44:52Z","pushed_at":"2015-10-18T13:48:58Z","git_url":"git://github.com/Touchit/me.apla.cordova.app-preferences.git","ssh_url":"git@github.com:Touchit/me.apla.cordova.app-preferences.git","clone_url":"https://github.com/Touchit/me.apla.cordova.app-preferences.git","svn_url":"https://github.com/Touchit/me.apla.cordova.app-preferences","homepage":null,"size":703,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apla:master","ref":"master","sha":"c8d6685bb28a322a5e8dbd3b7c94719e85b21a4e","user":{"login":"apla","id":85349,"avatar_url":"https://avatars.githubusercontent.com/u/85349?v=3","gravatar_id":"","url":"https://api.github.com/users/apla","html_url":"https://github.com/apla","followers_url":"https://api.github.com/users/apla/followers","following_url":"https://api.github.com/users/apla/following{/other_user}","gists_url":"https://api.github.com/users/apla/gists{/gist_id}","starred_url":"https://api.github.com/users/apla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apla/subscriptions","organizations_url":"https://api.github.com/users/apla/orgs","repos_url":"https://api.github.com/users/apla/repos","events_url":"https://api.github.com/users/apla/events{/privacy}","received_events_url":"https://api.github.com/users/apla/received_events","type":"User","site_admin":false},"repo":{"id":11876207,"name":"me.apla.cordova.app-preferences","full_name":"apla/me.apla.cordova.app-preferences","owner":{"login":"apla","id":85349,"avatar_url":"https://avatars.githubusercontent.com/u/85349?v=3","gravatar_id":"","url":"https://api.github.com/users/apla","html_url":"https://github.com/apla","followers_url":"https://api.github.com/users/apla/followers","following_url":"https://api.github.com/users/apla/following{/other_user}","gists_url":"https://api.github.com/users/apla/gists{/gist_id}","starred_url":"https://api.github.com/users/apla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apla/subscriptions","organizations_url":"https://api.github.com/users/apla/orgs","repos_url":"https://api.github.com/users/apla/repos","events_url":"https://api.github.com/users/apla/events{/privacy}","received_events_url":"https://api.github.com/users/apla/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apla/me.apla.cordova.app-preferences","description":"App preferences plugin for cordova","fork":false,"url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences","forks_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/forks","keys_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/teams","hooks_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/hooks","issue_events_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/issues/events{/number}","events_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/events","assignees_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/assignees{/user}","branches_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/branches{/branch}","tags_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/tags","blobs_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/git/refs{/sha}","trees_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/statuses/{sha}","languages_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/languages","stargazers_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/stargazers","contributors_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/contributors","subscribers_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/subscribers","subscription_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/subscription","commits_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/commits{/sha}","git_commits_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/git/commits{/sha}","comments_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/comments{/number}","issue_comment_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/issues/comments{/number}","contents_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/contents/{+path}","compare_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/merges","archive_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/downloads","issues_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/issues{/number}","pulls_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/pulls{/number}","milestones_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/milestones{/number}","notifications_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/labels{/name}","releases_url":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/releases{/id}","created_at":"2013-08-04T08:52:58Z","updated_at":"2015-10-18T07:21:12Z","pushed_at":"2015-10-18T14:16:18Z","git_url":"git://github.com/apla/me.apla.cordova.app-preferences.git","ssh_url":"git@github.com:apla/me.apla.cordova.app-preferences.git","clone_url":"https://github.com/apla/me.apla.cordova.app-preferences.git","svn_url":"https://github.com/apla/me.apla.cordova.app-preferences","homepage":null,"size":996,"stargazers_count":72,"watchers_count":72,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":14,"forks":33,"open_issues":14,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/pulls/50"},"html":{"href":"https://github.com/apla/me.apla.cordova.app-preferences/pull/50"},"issue":{"href":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/issues/50"},"comments":{"href":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/apla/me.apla.cordova.app-preferences/statuses/d1b4629d5b05bff507d8453a42eb1c7b0727defe"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":8,"additions":1025,"deletions":626,"changed_files":16}}