{"action":"created","comment":{"url":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/comments/27341109","id":27341109,"diff_hunk":"@@ -0,0 +1,32 @@\n+'use strict';\n+\n+var fs      = require('fs');\n+var path = require('path');\n+var Promise = require('../ext/promise');\n+\n+var versionCodeRegex = /(android-versionCode=\\\")[\\d.]+(\\\")/;\n+var versionCodeMatch = /android-versionCode=\\\"([\\d.])+\\\"/;\n+\n+module.exports = function(project) {\n+  return new Promise(function(resolve, reject){\n+    try {\n+      var cordovaPath = path.join(project.root, 'cordova');\n+      var configPath = path.join(cordovaPath, 'config.xml');\n+      var xml = fs.readFileSync(configPath, { encoding: 'utf8' });\n+\n+      var match = xml.match(versionCodeMatch);\n+      if(match) {\n+        var versionCode = (parseInt(match[1], 10)) + 1;\n+        var message     = 'Update config.xml with android-versionCode ' + versionCode;\n+\n+        return require('./modify-xml')(message, cordovaPath, function(xml) {\n+          return this.xmlReplace(versionCodeRegex, versionCode, xml);\n+        })().then(resolve, reject);\n+      } else {\n+        reject()\n+      }\n+    } catch (e) {\n+      reject(e)","path":"lib/tasks/update-config-xml-android-version-code.js","position":29,"original_position":29,"commit_id":"72dfe2f505e01bd4aba5dfa86e720a2895bdf303","original_commit_id":"72dfe2f505e01bd4aba5dfa86e720a2895bdf303","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Missing semicolon.","created_at":"2015-03-28T01:31:03Z","updated_at":"2015-03-28T01:31:03Z","html_url":"https://github.com/poetic/ember-cli-cordova/pull/127#discussion_r27341109","pull_request_url":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/comments/27341109"},"html":{"href":"https://github.com/poetic/ember-cli-cordova/pull/127#discussion_r27341109"},"pull_request":{"href":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/127","id":32156936,"html_url":"https://github.com/poetic/ember-cli-cordova/pull/127","diff_url":"https://github.com/poetic/ember-cli-cordova/pull/127.diff","patch_url":"https://github.com/poetic/ember-cli-cordova/pull/127.patch","issue_url":"https://api.github.com/repos/poetic/ember-cli-cordova/issues/127","number":127,"state":"open","locked":false,"title":"Update android versionCode when run cordova:archive","user":{"login":"dukex","id":91538,"avatar_url":"https://avatars.githubusercontent.com/u/91538?v=3","gravatar_id":"","url":"https://api.github.com/users/dukex","html_url":"https://github.com/dukex","followers_url":"https://api.github.com/users/dukex/followers","following_url":"https://api.github.com/users/dukex/following{/other_user}","gists_url":"https://api.github.com/users/dukex/gists{/gist_id}","starred_url":"https://api.github.com/users/dukex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dukex/subscriptions","organizations_url":"https://api.github.com/users/dukex/orgs","repos_url":"https://api.github.com/users/dukex/repos","events_url":"https://api.github.com/users/dukex/events{/privacy}","received_events_url":"https://api.github.com/users/dukex/received_events","type":"User","site_admin":false},"body":"Like android documentation:\r\n\r\n```\r\nandroid:versionCode — An integer value that represents the version of the application \r\ncode, relative to other versions.\r\nThe value is an integer so that other applications can programmatically \r\nevaluate it, for example to check an upgrade or downgrade relationship. \r\nYou can set the value to any integer you want, however you should make \r\nsure that each successive release of your application uses a greater value. \r\nThe system does not enforce this behavior, but increasing the value with \r\nsuccessive releases is normative.\r\nTypically, you would release the first version of your application with \r\nversionCode set to 1, then monotonically increase the value with each release, \r\nregardless whether the release constitutes a major or minor release. \r\nThis means that the android:versionCode value does not necessarily \r\nhave a strong resemblance to the application release version that is visible \r\nto the user (see android:versionName, below). Applications and publishing \r\nservices should not display this version value to users.\r\n```\r\n\r\nNow `ember cordova:archive` update android versionCode if **android-versionCode** is configured in config.xml\r\n","created_at":"2015-03-28T01:30:57Z","updated_at":"2015-03-28T01:31:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a583594b1f40e933890e1cb8332c04769cde0b6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/127/commits","review_comments_url":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/127/comments","review_comment_url":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/comments{/number}","comments_url":"https://api.github.com/repos/poetic/ember-cli-cordova/issues/127/comments","statuses_url":"https://api.github.com/repos/poetic/ember-cli-cordova/statuses/72dfe2f505e01bd4aba5dfa86e720a2895bdf303","head":{"label":"dukex:archive-android-version-code","ref":"archive-android-version-code","sha":"72dfe2f505e01bd4aba5dfa86e720a2895bdf303","user":{"login":"dukex","id":91538,"avatar_url":"https://avatars.githubusercontent.com/u/91538?v=3","gravatar_id":"","url":"https://api.github.com/users/dukex","html_url":"https://github.com/dukex","followers_url":"https://api.github.com/users/dukex/followers","following_url":"https://api.github.com/users/dukex/following{/other_user}","gists_url":"https://api.github.com/users/dukex/gists{/gist_id}","starred_url":"https://api.github.com/users/dukex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dukex/subscriptions","organizations_url":"https://api.github.com/users/dukex/orgs","repos_url":"https://api.github.com/users/dukex/repos","events_url":"https://api.github.com/users/dukex/events{/privacy}","received_events_url":"https://api.github.com/users/dukex/received_events","type":"User","site_admin":false},"repo":{"id":32642947,"name":"ember-cli-cordova","full_name":"dukex/ember-cli-cordova","owner":{"login":"dukex","id":91538,"avatar_url":"https://avatars.githubusercontent.com/u/91538?v=3","gravatar_id":"","url":"https://api.github.com/users/dukex","html_url":"https://github.com/dukex","followers_url":"https://api.github.com/users/dukex/followers","following_url":"https://api.github.com/users/dukex/following{/other_user}","gists_url":"https://api.github.com/users/dukex/gists{/gist_id}","starred_url":"https://api.github.com/users/dukex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dukex/subscriptions","organizations_url":"https://api.github.com/users/dukex/orgs","repos_url":"https://api.github.com/users/dukex/repos","events_url":"https://api.github.com/users/dukex/events{/privacy}","received_events_url":"https://api.github.com/users/dukex/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dukex/ember-cli-cordova","description":"A tool for creating hybrid apps using a combination of ember-cli and cordova","fork":true,"url":"https://api.github.com/repos/dukex/ember-cli-cordova","forks_url":"https://api.github.com/repos/dukex/ember-cli-cordova/forks","keys_url":"https://api.github.com/repos/dukex/ember-cli-cordova/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dukex/ember-cli-cordova/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dukex/ember-cli-cordova/teams","hooks_url":"https://api.github.com/repos/dukex/ember-cli-cordova/hooks","issue_events_url":"https://api.github.com/repos/dukex/ember-cli-cordova/issues/events{/number}","events_url":"https://api.github.com/repos/dukex/ember-cli-cordova/events","assignees_url":"https://api.github.com/repos/dukex/ember-cli-cordova/assignees{/user}","branches_url":"https://api.github.com/repos/dukex/ember-cli-cordova/branches{/branch}","tags_url":"https://api.github.com/repos/dukex/ember-cli-cordova/tags","blobs_url":"https://api.github.com/repos/dukex/ember-cli-cordova/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dukex/ember-cli-cordova/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dukex/ember-cli-cordova/git/refs{/sha}","trees_url":"https://api.github.com/repos/dukex/ember-cli-cordova/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dukex/ember-cli-cordova/statuses/{sha}","languages_url":"https://api.github.com/repos/dukex/ember-cli-cordova/languages","stargazers_url":"https://api.github.com/repos/dukex/ember-cli-cordova/stargazers","contributors_url":"https://api.github.com/repos/dukex/ember-cli-cordova/contributors","subscribers_url":"https://api.github.com/repos/dukex/ember-cli-cordova/subscribers","subscription_url":"https://api.github.com/repos/dukex/ember-cli-cordova/subscription","commits_url":"https://api.github.com/repos/dukex/ember-cli-cordova/commits{/sha}","git_commits_url":"https://api.github.com/repos/dukex/ember-cli-cordova/git/commits{/sha}","comments_url":"https://api.github.com/repos/dukex/ember-cli-cordova/comments{/number}","issue_comment_url":"https://api.github.com/repos/dukex/ember-cli-cordova/issues/comments{/number}","contents_url":"https://api.github.com/repos/dukex/ember-cli-cordova/contents/{+path}","compare_url":"https://api.github.com/repos/dukex/ember-cli-cordova/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dukex/ember-cli-cordova/merges","archive_url":"https://api.github.com/repos/dukex/ember-cli-cordova/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dukex/ember-cli-cordova/downloads","issues_url":"https://api.github.com/repos/dukex/ember-cli-cordova/issues{/number}","pulls_url":"https://api.github.com/repos/dukex/ember-cli-cordova/pulls{/number}","milestones_url":"https://api.github.com/repos/dukex/ember-cli-cordova/milestones{/number}","notifications_url":"https://api.github.com/repos/dukex/ember-cli-cordova/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dukex/ember-cli-cordova/labels{/name}","releases_url":"https://api.github.com/repos/dukex/ember-cli-cordova/releases{/id}","created_at":"2015-03-21T17:47:34Z","updated_at":"2015-03-21T17:47:34Z","pushed_at":"2015-03-28T01:24:47Z","git_url":"git://github.com/dukex/ember-cli-cordova.git","ssh_url":"git@github.com:dukex/ember-cli-cordova.git","clone_url":"https://github.com/dukex/ember-cli-cordova.git","svn_url":"https://github.com/dukex/ember-cli-cordova","homepage":null,"size":1355,"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":"poetic:master","ref":"master","sha":"1d610d55737c1f3f9f40dccbe766a4d8a3970797","user":{"login":"poetic","id":102288,"avatar_url":"https://avatars.githubusercontent.com/u/102288?v=3","gravatar_id":"","url":"https://api.github.com/users/poetic","html_url":"https://github.com/poetic","followers_url":"https://api.github.com/users/poetic/followers","following_url":"https://api.github.com/users/poetic/following{/other_user}","gists_url":"https://api.github.com/users/poetic/gists{/gist_id}","starred_url":"https://api.github.com/users/poetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poetic/subscriptions","organizations_url":"https://api.github.com/users/poetic/orgs","repos_url":"https://api.github.com/users/poetic/repos","events_url":"https://api.github.com/users/poetic/events{/privacy}","received_events_url":"https://api.github.com/users/poetic/received_events","type":"Organization","site_admin":false},"repo":{"id":19561489,"name":"ember-cli-cordova","full_name":"poetic/ember-cli-cordova","owner":{"login":"poetic","id":102288,"avatar_url":"https://avatars.githubusercontent.com/u/102288?v=3","gravatar_id":"","url":"https://api.github.com/users/poetic","html_url":"https://github.com/poetic","followers_url":"https://api.github.com/users/poetic/followers","following_url":"https://api.github.com/users/poetic/following{/other_user}","gists_url":"https://api.github.com/users/poetic/gists{/gist_id}","starred_url":"https://api.github.com/users/poetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poetic/subscriptions","organizations_url":"https://api.github.com/users/poetic/orgs","repos_url":"https://api.github.com/users/poetic/repos","events_url":"https://api.github.com/users/poetic/events{/privacy}","received_events_url":"https://api.github.com/users/poetic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/poetic/ember-cli-cordova","description":"A tool for creating hybrid apps using a combination of ember-cli and cordova","fork":false,"url":"https://api.github.com/repos/poetic/ember-cli-cordova","forks_url":"https://api.github.com/repos/poetic/ember-cli-cordova/forks","keys_url":"https://api.github.com/repos/poetic/ember-cli-cordova/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poetic/ember-cli-cordova/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poetic/ember-cli-cordova/teams","hooks_url":"https://api.github.com/repos/poetic/ember-cli-cordova/hooks","issue_events_url":"https://api.github.com/repos/poetic/ember-cli-cordova/issues/events{/number}","events_url":"https://api.github.com/repos/poetic/ember-cli-cordova/events","assignees_url":"https://api.github.com/repos/poetic/ember-cli-cordova/assignees{/user}","branches_url":"https://api.github.com/repos/poetic/ember-cli-cordova/branches{/branch}","tags_url":"https://api.github.com/repos/poetic/ember-cli-cordova/tags","blobs_url":"https://api.github.com/repos/poetic/ember-cli-cordova/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poetic/ember-cli-cordova/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poetic/ember-cli-cordova/git/refs{/sha}","trees_url":"https://api.github.com/repos/poetic/ember-cli-cordova/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poetic/ember-cli-cordova/statuses/{sha}","languages_url":"https://api.github.com/repos/poetic/ember-cli-cordova/languages","stargazers_url":"https://api.github.com/repos/poetic/ember-cli-cordova/stargazers","contributors_url":"https://api.github.com/repos/poetic/ember-cli-cordova/contributors","subscribers_url":"https://api.github.com/repos/poetic/ember-cli-cordova/subscribers","subscription_url":"https://api.github.com/repos/poetic/ember-cli-cordova/subscription","commits_url":"https://api.github.com/repos/poetic/ember-cli-cordova/commits{/sha}","git_commits_url":"https://api.github.com/repos/poetic/ember-cli-cordova/git/commits{/sha}","comments_url":"https://api.github.com/repos/poetic/ember-cli-cordova/comments{/number}","issue_comment_url":"https://api.github.com/repos/poetic/ember-cli-cordova/issues/comments{/number}","contents_url":"https://api.github.com/repos/poetic/ember-cli-cordova/contents/{+path}","compare_url":"https://api.github.com/repos/poetic/ember-cli-cordova/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poetic/ember-cli-cordova/merges","archive_url":"https://api.github.com/repos/poetic/ember-cli-cordova/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poetic/ember-cli-cordova/downloads","issues_url":"https://api.github.com/repos/poetic/ember-cli-cordova/issues{/number}","pulls_url":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls{/number}","milestones_url":"https://api.github.com/repos/poetic/ember-cli-cordova/milestones{/number}","notifications_url":"https://api.github.com/repos/poetic/ember-cli-cordova/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poetic/ember-cli-cordova/labels{/name}","releases_url":"https://api.github.com/repos/poetic/ember-cli-cordova/releases{/id}","created_at":"2014-05-08T05:19:18Z","updated_at":"2015-03-28T00:50:58Z","pushed_at":"2015-03-28T01:30:57Z","git_url":"git://github.com/poetic/ember-cli-cordova.git","ssh_url":"git@github.com:poetic/ember-cli-cordova.git","clone_url":"https://github.com/poetic/ember-cli-cordova.git","svn_url":"https://github.com/poetic/ember-cli-cordova","homepage":null,"size":2267,"stargazers_count":237,"watchers_count":237,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":16,"forks":25,"open_issues":16,"watchers":237,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/127"},"html":{"href":"https://github.com/poetic/ember-cli-cordova/pull/127"},"issue":{"href":"https://api.github.com/repos/poetic/ember-cli-cordova/issues/127"},"comments":{"href":"https://api.github.com/repos/poetic/ember-cli-cordova/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/poetic/ember-cli-cordova/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/poetic/ember-cli-cordova/statuses/72dfe2f505e01bd4aba5dfa86e720a2895bdf303"}}}}