{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/cli/pulls/comments/72186531","id":72186531,"diff_hunk":"@@ -0,0 +1,112 @@\n+// Licensed to the .NET Foundation under one or more agreements.\n+// The .NET Foundation licenses this file to you under the MIT license.\n+// See the LICENSE file in the project root for more information.\n+\n+using Microsoft.Build.Framework;\n+using Microsoft.Build.Utilities;\n+using System;\n+using System.IO;\n+using System.IO.Compression;\n+\n+namespace Microsoft.DotNet.Build.Tasks\n+{\n+    public sealed class TarGzFileExtractToDirectory : ToolTask\n+    {\n+        /// <summary>\n+        /// The path to the archive to extract.\n+        /// </summary>\n+        [Required]\n+        public string SourceArchive { get; set; }\n+\n+        /// <summary>\n+        /// The path of the directory to which the archive should be extracted.\n+        /// </summary>\n+        [Required]\n+        public string DestinationDirectory { get; set; }\n+\n+        /// <summary>\n+        /// Indicates if the destination directory should be cleaned if it already exists.\n+        /// </summary>\n+        public bool OverwriteDestination { get; set; }\n+\n+        protected override bool ValidateParameters()\n+        {\n+            base.ValidateParameters();\n+\n+            var retVal = true;\n+\n+            if (Directory.Exists(DestinationDirectory))\n+            {\n+                if (OverwriteDestination == true)\n+                {\n+                    Log.LogMessage(MessageImportance.Low, \"'{0}' already exists, trying to delete before unzipping...\", DestinationDirectory);\n+                    Directory.Delete(DestinationDirectory, recursive: true);\n+                }\n+                else\n+                {\n+                    Log.LogWarning(\"'{0}' already exists. Did you forget to set '{1}' to true?\", DestinationDirectory, nameof(OverwriteDestination));\n+\n+                    retVal = false;\n+                }\n+            }\n+\n+            if (!File.Exists(SourceArchive))\n+            {\n+                Log.LogError($\"SourceArchive '{SourceArchive} does not exist.\");\n+\n+                retVal = false;\n+            }\n+\n+            if (retVal)\n+            {\n+                Log.LogMessage($\"Creating Directory {DestinationDirectory}\");\n+                Directory.CreateDirectory(DestinationDirectory);\n+            }\n+            \n+            return retVal;\n+        }\n+\n+        public override bool Execute()\n+        {\n+            bool retVal = base.Execute();\n+\n+            if (!retVal)","path":"build_projects/dotnet-cli-build/TarGzFileExtractToDirectory.cs","position":73,"original_position":73,"commit_id":"29430e51e53f07cb9ec5fe3d592cd08b52449022","original_commit_id":"eb56d966461422b03f12632e09d0a49f7ff8c083","user":{"login":"piotrpMSFT","id":2379589,"avatar_url":"https://avatars.githubusercontent.com/u/2379589?v=3","gravatar_id":"","url":"https://api.github.com/users/piotrpMSFT","html_url":"https://github.com/piotrpMSFT","followers_url":"https://api.github.com/users/piotrpMSFT/followers","following_url":"https://api.github.com/users/piotrpMSFT/following{/other_user}","gists_url":"https://api.github.com/users/piotrpMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrpMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrpMSFT/subscriptions","organizations_url":"https://api.github.com/users/piotrpMSFT/orgs","repos_url":"https://api.github.com/users/piotrpMSFT/repos","events_url":"https://api.github.com/users/piotrpMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/piotrpMSFT/received_events","type":"User","site_admin":false},"body":"Can you file an issue in buildtools?","created_at":"2016-07-26T04:30:16Z","updated_at":"2016-07-26T04:30:16Z","html_url":"https://github.com/dotnet/cli/pull/3927#discussion_r72186531","pull_request_url":"https://api.github.com/repos/dotnet/cli/pulls/3927","_links":{"self":{"href":"https://api.github.com/repos/dotnet/cli/pulls/comments/72186531"},"html":{"href":"https://github.com/dotnet/cli/pull/3927#discussion_r72186531"},"pull_request":{"href":"https://api.github.com/repos/dotnet/cli/pulls/3927"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/cli/pulls/3927","id":78579370,"html_url":"https://github.com/dotnet/cli/pull/3927","diff_url":"https://github.com/dotnet/cli/pull/3927.diff","patch_url":"https://github.com/dotnet/cli/pull/3927.patch","issue_url":"https://api.github.com/repos/dotnet/cli/issues/3927","number":3927,"state":"closed","locked":false,"title":"Decompose Crossgen, remove CleanPublishOutput, replace ExtractArchive with *FileExtractToDirectory","user":{"login":"piotrpMSFT","id":2379589,"avatar_url":"https://avatars.githubusercontent.com/u/2379589?v=3","gravatar_id":"","url":"https://api.github.com/users/piotrpMSFT","html_url":"https://github.com/piotrpMSFT","followers_url":"https://api.github.com/users/piotrpMSFT/followers","following_url":"https://api.github.com/users/piotrpMSFT/following{/other_user}","gists_url":"https://api.github.com/users/piotrpMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrpMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrpMSFT/subscriptions","organizations_url":"https://api.github.com/users/piotrpMSFT/orgs","repos_url":"https://api.github.com/users/piotrpMSFT/repos","events_url":"https://api.github.com/users/piotrpMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/piotrpMSFT/received_events","type":"User","site_admin":false},"body":"Eliminates unnecessary CleanPublishOutput task\r\nEliminates repo-specific logic from Crossgen task, moving to msbuild\r\nMoves ExtractArchive task to matching buildtools tasks","created_at":"2016-07-23T18:46:11Z","updated_at":"2016-07-26T04:30:16Z","closed_at":"2016-07-26T04:29:59Z","merged_at":"2016-07-26T04:29:59Z","merge_commit_sha":"5ebc6a1ceb9ace1fbdda05a3e7788a3da9cfabbe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/cli/pulls/3927/commits","review_comments_url":"https://api.github.com/repos/dotnet/cli/pulls/3927/comments","review_comment_url":"https://api.github.com/repos/dotnet/cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/cli/issues/3927/comments","statuses_url":"https://api.github.com/repos/dotnet/cli/statuses/29430e51e53f07cb9ec5fe3d592cd08b52449022","head":{"label":"dotnet:piotrpMSFT/buildcleanup","ref":"piotrpMSFT/buildcleanup","sha":"29430e51e53f07cb9ec5fe3d592cd08b52449022","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":43568107,"name":"cli","full_name":"dotnet/cli","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/cli","description":"This repo contains the .NET Core command-line (CLI) tools, used for building .NET Core apps and libraries through your development flow (compiling, NuGet package management, running, testing, ...).","fork":false,"url":"https://api.github.com/repos/dotnet/cli","forks_url":"https://api.github.com/repos/dotnet/cli/forks","keys_url":"https://api.github.com/repos/dotnet/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/cli/teams","hooks_url":"https://api.github.com/repos/dotnet/cli/hooks","issue_events_url":"https://api.github.com/repos/dotnet/cli/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/cli/events","assignees_url":"https://api.github.com/repos/dotnet/cli/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/cli/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/cli/tags","blobs_url":"https://api.github.com/repos/dotnet/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/cli/languages","stargazers_url":"https://api.github.com/repos/dotnet/cli/stargazers","contributors_url":"https://api.github.com/repos/dotnet/cli/contributors","subscribers_url":"https://api.github.com/repos/dotnet/cli/subscribers","subscription_url":"https://api.github.com/repos/dotnet/cli/subscription","commits_url":"https://api.github.com/repos/dotnet/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/cli/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/cli/merges","archive_url":"https://api.github.com/repos/dotnet/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/cli/downloads","issues_url":"https://api.github.com/repos/dotnet/cli/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/cli/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/cli/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/cli/deployments","created_at":"2015-10-02T18:03:15Z","updated_at":"2016-07-25T19:00:37Z","pushed_at":"2016-07-26T04:30:00Z","git_url":"git://github.com/dotnet/cli.git","ssh_url":"git@github.com:dotnet/cli.git","clone_url":"https://github.com/dotnet/cli.git","svn_url":"https://github.com/dotnet/cli","homepage":"https://docs.microsoft.com/dotnet/ ","size":118490,"stargazers_count":1318,"watchers_count":1318,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":315,"mirror_url":null,"open_issues_count":856,"forks":315,"open_issues":856,"watchers":1318,"default_branch":"rel/1.0.0"}},"base":{"label":"dotnet:feature/msbuild","ref":"feature/msbuild","sha":"ee8a01b8d6bee091979a0a911928b13f39404b3b","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":43568107,"name":"cli","full_name":"dotnet/cli","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/cli","description":"This repo contains the .NET Core command-line (CLI) tools, used for building .NET Core apps and libraries through your development flow (compiling, NuGet package management, running, testing, ...).","fork":false,"url":"https://api.github.com/repos/dotnet/cli","forks_url":"https://api.github.com/repos/dotnet/cli/forks","keys_url":"https://api.github.com/repos/dotnet/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/cli/teams","hooks_url":"https://api.github.com/repos/dotnet/cli/hooks","issue_events_url":"https://api.github.com/repos/dotnet/cli/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/cli/events","assignees_url":"https://api.github.com/repos/dotnet/cli/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/cli/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/cli/tags","blobs_url":"https://api.github.com/repos/dotnet/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/cli/languages","stargazers_url":"https://api.github.com/repos/dotnet/cli/stargazers","contributors_url":"https://api.github.com/repos/dotnet/cli/contributors","subscribers_url":"https://api.github.com/repos/dotnet/cli/subscribers","subscription_url":"https://api.github.com/repos/dotnet/cli/subscription","commits_url":"https://api.github.com/repos/dotnet/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/cli/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/cli/merges","archive_url":"https://api.github.com/repos/dotnet/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/cli/downloads","issues_url":"https://api.github.com/repos/dotnet/cli/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/cli/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/cli/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/cli/deployments","created_at":"2015-10-02T18:03:15Z","updated_at":"2016-07-25T19:00:37Z","pushed_at":"2016-07-26T04:30:00Z","git_url":"git://github.com/dotnet/cli.git","ssh_url":"git@github.com:dotnet/cli.git","clone_url":"https://github.com/dotnet/cli.git","svn_url":"https://github.com/dotnet/cli","homepage":"https://docs.microsoft.com/dotnet/ ","size":118490,"stargazers_count":1318,"watchers_count":1318,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":315,"mirror_url":null,"open_issues_count":856,"forks":315,"open_issues":856,"watchers":1318,"default_branch":"rel/1.0.0"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/cli/pulls/3927"},"html":{"href":"https://github.com/dotnet/cli/pull/3927"},"issue":{"href":"https://api.github.com/repos/dotnet/cli/issues/3927"},"comments":{"href":"https://api.github.com/repos/dotnet/cli/issues/3927/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/cli/pulls/3927/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/cli/pulls/3927/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/cli/statuses/29430e51e53f07cb9ec5fe3d592cd08b52449022"}}}}
{"actor":{"display_login":"piotrpMSFT"}}