{"action":"created","comment":{"url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/comments/52174626","id":52174626,"diff_hunk":"@@ -253,7 +255,63 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject\n \t}\n \n \tpublic prepareProject(): IFuture<void> {\n-\t\treturn Future.fromResult();\n+\t\treturn (() => {\n+\t\t\t// Delete the AndroidManifest.xml file from res directory as the runtime will consider it as addition to the one in src/main and will try to merge them.\n+\t\t\t// However now they are the same file.\n+\t\t\tlet resDestinationDir = this.getAppResourcesDestinationDirectoryPath().wait();\n+\t\t\tlet androidManifestPath = path.join(resDestinationDir, this.platformData.configurationFileName);\n+\t\t\tthis.$fs.deleteFile(androidManifestPath).wait();\n+\t\t}).future<void>()();\n+\t}\n+\n+\tpublic ensureConfigurationFileInAppResources(): IFuture<void> {\n+\t\treturn (() => {\n+\t\t\tlet originalAndroidManifestFilePath = path.join(this.$projectData.appResourcesDirectoryPath, this.$devicePlatformsConstants.Android, this.platformData.configurationFileName),\n+\t\t\t\thasAndroidManifestInAppResources = this.$fs.exists(originalAndroidManifestFilePath).wait(),\n+\t\t\t\tshouldExtractDefaultManifest = !hasAndroidManifestInAppResources;\n+\n+\t\t\tif(hasAndroidManifestInAppResources) {\n+\t\t\t\t// Check if the AndroidManifest in app/App_Resouces is the correct one\n+\t\t\t\t// Use a real magic to detect if this is the correct file, by checking some mandatory strings.\n+\t\t\t\tlet fileContent = this.$fs.readText(originalAndroidManifestFilePath).wait(),\n+\t\t\t\t\tisFileCorrect = !!(~fileContent.indexOf(\"android:minSdkVersion\") && ~fileContent.indexOf(\"android:targetSdkVersion\")\n+\t\t\t\t\t\t\t\t\t&& ~fileContent.indexOf(\"uses-permission\") && ~fileContent.indexOf(\"<application\")\n+\t\t\t\t\t\t\t\t\t&& ~fileContent.indexOf(\"<activity\") && ~fileContent.indexOf(\"<intent-filter>\")\n+\t\t\t\t\t\t\t\t\t&& ~fileContent.indexOf(\"android.intent.action.MAIN\") && ~fileContent.indexOf(\"com.tns.ErrorReportActivity\")\n+\t\t\t\t\t\t\t\t\t&& ~fileContent.indexOf(\"android:versionCode\"));\n+\n+\t\t\t\tthis.$logger.trace(`Existing ${this.platformData.configurationFileName} is ${isFileCorrect ? \"\" : \"NOT \"}correct.`);\n+\n+\t\t\t\tif(!isFileCorrect) {\n+\t\t\t\t\tshouldExtractDefaultManifest = true;\n+\t\t\t\t\tlet newNameForOriginalManifest = \"old.\" + this.platformData.configurationFileName,","path":"lib/services/android-project-service.ts","position":45,"original_position":45,"commit_id":"3168b3de4a216eaed75eb1f9d3e69b20b7b9c2b9","original_commit_id":"3168b3de4a216eaed75eb1f9d3e69b20b7b9c2b9","user":{"login":"teobugslayer","id":5443453,"avatar_url":"https://avatars.githubusercontent.com/u/5443453?v=3","gravatar_id":"","url":"https://api.github.com/users/teobugslayer","html_url":"https://github.com/teobugslayer","followers_url":"https://api.github.com/users/teobugslayer/followers","following_url":"https://api.github.com/users/teobugslayer/following{/other_user}","gists_url":"https://api.github.com/users/teobugslayer/gists{/gist_id}","starred_url":"https://api.github.com/users/teobugslayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teobugslayer/subscriptions","organizations_url":"https://api.github.com/users/teobugslayer/orgs","repos_url":"https://api.github.com/users/teobugslayer/repos","events_url":"https://api.github.com/users/teobugslayer/events{/privacy}","received_events_url":"https://api.github.com/users/teobugslayer/received_events","type":"User","site_admin":false},"body":"Usually, such files are named .backup, .old, etc. (As a user) I would be very surprised to find it with a prefix.","created_at":"2016-02-08T14:30:25Z","updated_at":"2016-02-08T14:30:25Z","html_url":"https://github.com/NativeScript/nativescript-cli/pull/1460#discussion_r52174626","pull_request_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/1460","_links":{"self":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/comments/52174626"},"html":{"href":"https://github.com/NativeScript/nativescript-cli/pull/1460#discussion_r52174626"},"pull_request":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/1460"}}},"pull_request":{"url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/1460","id":58613801,"html_url":"https://github.com/NativeScript/nativescript-cli/pull/1460","diff_url":"https://github.com/NativeScript/nativescript-cli/pull/1460.diff","patch_url":"https://github.com/NativeScript/nativescript-cli/pull/1460.patch","issue_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/1460","number":1460,"state":"open","locked":false,"title":"Use AndroidManifest from App_Resources as full manifest","user":{"login":"rosen-vladimirov","id":8351653,"avatar_url":"https://avatars.githubusercontent.com/u/8351653?v=3","gravatar_id":"","url":"https://api.github.com/users/rosen-vladimirov","html_url":"https://github.com/rosen-vladimirov","followers_url":"https://api.github.com/users/rosen-vladimirov/followers","following_url":"https://api.github.com/users/rosen-vladimirov/following{/other_user}","gists_url":"https://api.github.com/users/rosen-vladimirov/gists{/gist_id}","starred_url":"https://api.github.com/users/rosen-vladimirov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosen-vladimirov/subscriptions","organizations_url":"https://api.github.com/users/rosen-vladimirov/orgs","repos_url":"https://api.github.com/users/rosen-vladimirov/repos","events_url":"https://api.github.com/users/rosen-vladimirov/events{/privacy}","received_events_url":"https://api.github.com/users/rosen-vladimirov/received_events","type":"User","site_admin":false},"body":"For iOS we'll have full Info.plist in app/App_Resources/iOS.\r\nCurrently for Android we allow placing a file, that will be merged with default AndroidManifest from the runtime.\r\nChange the Android implementation, so now the AndroidManifest placed in app/App_Resources/Android will be the full one.\r\nIn such file is not present in user's project, extract it from default template.\r\nIn case there's already such file and it doesn't seems correct, rename it to old.AndroidManifest.xml, extract correct manifest from template and inform the user that he'll have to merge the files manually.","created_at":"2016-02-08T14:13:10Z","updated_at":"2016-02-08T14:30:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9313ff42b1650f04adc817ef5085d3f7d2d117b9","assignee":{"login":"rosen-vladimirov","id":8351653,"avatar_url":"https://avatars.githubusercontent.com/u/8351653?v=3","gravatar_id":"","url":"https://api.github.com/users/rosen-vladimirov","html_url":"https://github.com/rosen-vladimirov","followers_url":"https://api.github.com/users/rosen-vladimirov/followers","following_url":"https://api.github.com/users/rosen-vladimirov/following{/other_user}","gists_url":"https://api.github.com/users/rosen-vladimirov/gists{/gist_id}","starred_url":"https://api.github.com/users/rosen-vladimirov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosen-vladimirov/subscriptions","organizations_url":"https://api.github.com/users/rosen-vladimirov/orgs","repos_url":"https://api.github.com/users/rosen-vladimirov/repos","events_url":"https://api.github.com/users/rosen-vladimirov/events{/privacy}","received_events_url":"https://api.github.com/users/rosen-vladimirov/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/NativeScript/nativescript-cli/milestones/27","html_url":"https://github.com/NativeScript/nativescript-cli/milestones/1.6.0","labels_url":"https://api.github.com/repos/NativeScript/nativescript-cli/milestones/27/labels","id":1338575,"number":27,"title":"1.6.0","description":"","creator":{"login":"teobugslayer","id":5443453,"avatar_url":"https://avatars.githubusercontent.com/u/5443453?v=3","gravatar_id":"","url":"https://api.github.com/users/teobugslayer","html_url":"https://github.com/teobugslayer","followers_url":"https://api.github.com/users/teobugslayer/followers","following_url":"https://api.github.com/users/teobugslayer/following{/other_user}","gists_url":"https://api.github.com/users/teobugslayer/gists{/gist_id}","starred_url":"https://api.github.com/users/teobugslayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teobugslayer/subscriptions","organizations_url":"https://api.github.com/users/teobugslayer/orgs","repos_url":"https://api.github.com/users/teobugslayer/repos","events_url":"https://api.github.com/users/teobugslayer/events{/privacy}","received_events_url":"https://api.github.com/users/teobugslayer/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":39,"state":"open","created_at":"2015-10-05T16:14:56Z","updated_at":"2016-02-08T14:13:10Z","due_on":"2016-02-16T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/1460/commits","review_comments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/1460/comments","review_comment_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/1460/comments","statuses_url":"https://api.github.com/repos/NativeScript/nativescript-cli/statuses/3168b3de4a216eaed75eb1f9d3e69b20b7b9c2b9","head":{"label":"NativeScript:vladimirov/android-manifest-in-app-resources","ref":"vladimirov/android-manifest-in-app-resources","sha":"3168b3de4a216eaed75eb1f9d3e69b20b7b9c2b9","user":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"repo":{"id":21347346,"name":"nativescript-cli","full_name":"NativeScript/nativescript-cli","owner":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NativeScript/nativescript-cli","description":"Command-line interface for building NativeScript apps","fork":false,"url":"https://api.github.com/repos/NativeScript/nativescript-cli","forks_url":"https://api.github.com/repos/NativeScript/nativescript-cli/forks","keys_url":"https://api.github.com/repos/NativeScript/nativescript-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NativeScript/nativescript-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NativeScript/nativescript-cli/teams","hooks_url":"https://api.github.com/repos/NativeScript/nativescript-cli/hooks","issue_events_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/events{/number}","events_url":"https://api.github.com/repos/NativeScript/nativescript-cli/events","assignees_url":"https://api.github.com/repos/NativeScript/nativescript-cli/assignees{/user}","branches_url":"https://api.github.com/repos/NativeScript/nativescript-cli/branches{/branch}","tags_url":"https://api.github.com/repos/NativeScript/nativescript-cli/tags","blobs_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NativeScript/nativescript-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/NativeScript/nativescript-cli/languages","stargazers_url":"https://api.github.com/repos/NativeScript/nativescript-cli/stargazers","contributors_url":"https://api.github.com/repos/NativeScript/nativescript-cli/contributors","subscribers_url":"https://api.github.com/repos/NativeScript/nativescript-cli/subscribers","subscription_url":"https://api.github.com/repos/NativeScript/nativescript-cli/subscription","commits_url":"https://api.github.com/repos/NativeScript/nativescript-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/NativeScript/nativescript-cli/contents/{+path}","compare_url":"https://api.github.com/repos/NativeScript/nativescript-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NativeScript/nativescript-cli/merges","archive_url":"https://api.github.com/repos/NativeScript/nativescript-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NativeScript/nativescript-cli/downloads","issues_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues{/number}","pulls_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/NativeScript/nativescript-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/NativeScript/nativescript-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NativeScript/nativescript-cli/labels{/name}","releases_url":"https://api.github.com/repos/NativeScript/nativescript-cli/releases{/id}","deployments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/deployments","created_at":"2014-06-30T10:21:20Z","updated_at":"2016-02-03T21:49:34Z","pushed_at":"2016-02-08T14:13:11Z","git_url":"git://github.com/NativeScript/nativescript-cli.git","ssh_url":"git@github.com:NativeScript/nativescript-cli.git","clone_url":"https://github.com/NativeScript/nativescript-cli.git","svn_url":"https://github.com/NativeScript/nativescript-cli","homepage":"https://www.npmjs.com/package/nativescript","size":36681,"stargazers_count":342,"watchers_count":342,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":150,"forks":57,"open_issues":150,"watchers":342,"default_branch":"master"}},"base":{"label":"NativeScript:master","ref":"master","sha":"c1ecc5753f043c984ef9dd4bde7293d14536b886","user":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"repo":{"id":21347346,"name":"nativescript-cli","full_name":"NativeScript/nativescript-cli","owner":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NativeScript/nativescript-cli","description":"Command-line interface for building NativeScript apps","fork":false,"url":"https://api.github.com/repos/NativeScript/nativescript-cli","forks_url":"https://api.github.com/repos/NativeScript/nativescript-cli/forks","keys_url":"https://api.github.com/repos/NativeScript/nativescript-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NativeScript/nativescript-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NativeScript/nativescript-cli/teams","hooks_url":"https://api.github.com/repos/NativeScript/nativescript-cli/hooks","issue_events_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/events{/number}","events_url":"https://api.github.com/repos/NativeScript/nativescript-cli/events","assignees_url":"https://api.github.com/repos/NativeScript/nativescript-cli/assignees{/user}","branches_url":"https://api.github.com/repos/NativeScript/nativescript-cli/branches{/branch}","tags_url":"https://api.github.com/repos/NativeScript/nativescript-cli/tags","blobs_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NativeScript/nativescript-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/NativeScript/nativescript-cli/languages","stargazers_url":"https://api.github.com/repos/NativeScript/nativescript-cli/stargazers","contributors_url":"https://api.github.com/repos/NativeScript/nativescript-cli/contributors","subscribers_url":"https://api.github.com/repos/NativeScript/nativescript-cli/subscribers","subscription_url":"https://api.github.com/repos/NativeScript/nativescript-cli/subscription","commits_url":"https://api.github.com/repos/NativeScript/nativescript-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/NativeScript/nativescript-cli/contents/{+path}","compare_url":"https://api.github.com/repos/NativeScript/nativescript-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NativeScript/nativescript-cli/merges","archive_url":"https://api.github.com/repos/NativeScript/nativescript-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NativeScript/nativescript-cli/downloads","issues_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues{/number}","pulls_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/NativeScript/nativescript-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/NativeScript/nativescript-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NativeScript/nativescript-cli/labels{/name}","releases_url":"https://api.github.com/repos/NativeScript/nativescript-cli/releases{/id}","deployments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/deployments","created_at":"2014-06-30T10:21:20Z","updated_at":"2016-02-03T21:49:34Z","pushed_at":"2016-02-08T14:13:11Z","git_url":"git://github.com/NativeScript/nativescript-cli.git","ssh_url":"git@github.com:NativeScript/nativescript-cli.git","clone_url":"https://github.com/NativeScript/nativescript-cli.git","svn_url":"https://github.com/NativeScript/nativescript-cli","homepage":"https://www.npmjs.com/package/nativescript","size":36681,"stargazers_count":342,"watchers_count":342,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":150,"forks":57,"open_issues":150,"watchers":342,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/1460"},"html":{"href":"https://github.com/NativeScript/nativescript-cli/pull/1460"},"issue":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/1460"},"comments":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/1460/comments"},"review_comments":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/1460/comments"},"review_comment":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/1460/commits"},"statuses":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/statuses/3168b3de4a216eaed75eb1f9d3e69b20b7b9c2b9"}}}}