GitHub PullRequestReviewCommentEvent at 2014-12-19 17:17:08
Repository: buildtools
Actor: davkean
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/buildtools/pulls/comments/22116163","id":22116163,"diff_hunk":"@@ -0,0 +1,305 @@\n+﻿//-----------------------------------------------------------------------\n+// <copyright file=\"ResolveNuGetPackages.cs\" company=\"Microsoft\">\n+//     Copyright (c) Microsoft Corporation.  All rights reserved.\n+// </copyright>\n+// <summary>Resolves the assets contained within NuGet packages</summary>\n+//-----------------------------------------------------------------------\n+using System;\n+using System.Collections.Generic;\n+using System.Collections.ObjectModel;\n+using System.Diagnostics;\n+using System.IO;\n+using System.Linq;\n+using System.Runtime.Versioning;\n+using System.Security;\n+using System.Text.RegularExpressions;\n+using System.Xml;\n+using System.Xml.Linq;\n+using Microsoft.Build.Framework;\n+using Microsoft.Build.Utilities;\n+using NuGet;\n+using NuGet.NuManifest;\n+using NuGet.NuManifest.DotNet;\n+using NuGet.NuManifest.Resolution;\n+\n+namespace Microsoft.Build.Tasks\n+{\n+    /// <summary>\n+    /// A task to resolve assets out of the packages referenced in a packages.config.\n+    /// </summary>\n+    public sealed class ResolveNuGetPackages : Task\n+    {\n+        /// <summary>\n+        /// Creates a new <see cref=\"ResolveNuGetPackages\"/>.\n+        /// </summary>\n+        public ResolveNuGetPackages()\n+        {\n+            ResolvedReferences = new ITaskItem[0];\n+            ResolvedAnalyzers = new ITaskItem[0];\n+        }\n+\n+        /// <summary>\n+        /// The path to the packages.config to resolve packages from.\n+        /// </summary>\n+        [Required]\n+        public string PackagesConfig\n+        {\n+            get;\n+            set;\n+        }\n+\n+        /// <summary>\n+        /// The full paths to resolved build-time dependencies.\n+        /// </summary>\n+        [Output]\n+        public ITaskItem[] ResolvedReferences\n+        {\n+            get;\n+            private set;\n+        }\n+\n+        /// <summary>\n+        /// The full paths to resolved analyzers.\n+        /// </summary>\n+        [Output]\n+        public ITaskItem[] ResolvedAnalyzers\n+        {\n+            get;\n+            private set;\n+        }\n+\n+        /// <summary>\n+        /// The name of the platform of binaries to choose. Examples include 'AnyCPU', 'x86', etc.\n+        /// </summary>\n+        public string Platform\n+        {\n+            get;\n+            private set;\n+        }\n+\n+        /// <summary>\n+        /// Name of the configuration (Debug or Release) to choose.\n+        /// </summary>\n+        public string Configuration\n+        {\n+            get;\n+            private set;\n+        }\n+\n+        /// <summary>\n+        /// The target framework moniker to use when selecting assets from packages.\n+        /// </summary>\n+        public string TargetFramework\n+        {\n+            get;\n+            private set;\n+        }\n+\n+        /// <summary>\n+        /// The target platform moniker to use when selecting assets from packages.\n+        /// </summary>\n+        public string TargetPlatformMoniker\n+        {\n+            get;\n+            private set;\n+        }\n+\n+        /// <summary>\n+        /// The language of the source files in the project.\n+        /// </summary>\n+        public string Language\n+        {\n+            get;\n+            private set;\n+        }\n+\n+        /// <summary>\n+        /// Performs the NuGet package resolution.\n+        /// </summary>\n+        public override bool Execute()\n+        {\n+            var analyzers = new List<ITaskItem>();\n+            var references = new List<ITaskItem>();\n+\n+            if (string.IsNullOrWhiteSpace(PackagesConfig))\n+            {\n+                Log.LogError(\"PackagesConfig property not specified.\");\n+                return false;\n+            }\n+\n+            if (!File.Exists(PackagesConfig))\n+            {\n+                Log.LogError(\"File '{0}' not found.\", PackagesConfig);\n+                return false;\n+            }\n+\n+            var targetFrameworks = new List<FrameworkName>();\n+            var targetFramework = new FrameworkName(TargetFramework);\n+\n+            if (targetFramework.Identifier == \".NETPortable\")\n+            {\n+                // Let's convert","path":"src/Microsoft.DotNet.Build.Tasks/ResolveNuGetPackages.cs","position":141,"original_position":141,"commit_id":"48eb8787ca57cf6a23e385134fbc65efffb0e702","original_commit_id":"48eb8787ca57cf6a23e385134fbc65efffb0e702","user":{"login":"davkean","id":1103906,"avatar_url":"https://avatars.githubusercontent.com/u/1103906?v=3","gravatar_id":"","url":"https://api.github.com/users/davkean","html_url":"https://github.com/davkean","followers_url":"https://api.github.com/users/davkean/followers","following_url":"https://api.github.com/users/davkean/following{/other_user}","gists_url":"https://api.github.com/users/davkean/gists{/gist_id}","starred_url":"https://api.github.com/users/davkean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davkean/subscriptions","organizations_url":"https://api.github.com/users/davkean/orgs","repos_url":"https://api.github.com/users/davkean/repos","events_url":"https://api.github.com/users/davkean/events{/privacy}","received_events_url":"https://api.github.com/users/davkean/received_events","type":"User","site_admin":false},"body":"I know this is temporary (and you didn't write the code), but can we catch a Directory not exists here? This is going to fail the build on a machine without VS.","created_at":"2014-12-19T17:17:08Z","updated_at":"2014-12-19T17:17:08Z","html_url":"https://github.com/dotnet/buildtools/pull/32#discussion_r22116163","pull_request_url":"https://api.github.com/repos/dotnet/buildtools/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/comments/22116163"},"html":{"href":"https://github.com/dotnet/buildtools/pull/32#discussion_r22116163"},"pull_request":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/buildtools/pulls/32","id":26383430,"html_url":"https://github.com/dotnet/buildtools/pull/32","diff_url":"https://github.com/dotnet/buildtools/pull/32.diff","patch_url":"https://github.com/dotnet/buildtools/pull/32.patch","issue_url":"https://api.github.com/repos/dotnet/buildtools/issues/32","number":32,"state":"open","locked":false,"title":"Add support for resolve references via packages.config.","user":{"login":"weshaggard","id":9010698,"avatar_url":"https://avatars.githubusercontent.com/u/9010698?v=3","gravatar_id":"","url":"https://api.github.com/users/weshaggard","html_url":"https://github.com/weshaggard","followers_url":"https://api.github.com/users/weshaggard/followers","following_url":"https://api.github.com/users/weshaggard/following{/other_user}","gists_url":"https://api.github.com/users/weshaggard/gists{/gist_id}","starred_url":"https://api.github.com/users/weshaggard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weshaggard/subscriptions","organizations_url":"https://api.github.com/users/weshaggard/orgs","repos_url":"https://api.github.com/users/weshaggard/repos","events_url":"https://api.github.com/users/weshaggard/events{/privacy}","received_events_url":"https://api.github.com/users/weshaggard/received_events","type":"User","site_admin":false},"body":"Code review request from @terrajobst and @davkean. ","created_at":"2014-12-19T16:46:45Z","updated_at":"2014-12-19T17:17:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a99b4308623393e14f63172c0a82cbb5063ccda0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/buildtools/pulls/32/commits","review_comments_url":"https://api.github.com/repos/dotnet/buildtools/pulls/32/comments","review_comment_url":"https://api.github.com/repos/dotnet/buildtools/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dotnet/buildtools/issues/32/comments","statuses_url":"https://api.github.com/repos/dotnet/buildtools/statuses/48eb8787ca57cf6a23e385134fbc65efffb0e702","head":{"label":"weshaggard:NugetResolve","ref":"NugetResolve","sha":"48eb8787ca57cf6a23e385134fbc65efffb0e702","user":{"login":"weshaggard","id":9010698,"avatar_url":"https://avatars.githubusercontent.com/u/9010698?v=3","gravatar_id":"","url":"https://api.github.com/users/weshaggard","html_url":"https://github.com/weshaggard","followers_url":"https://api.github.com/users/weshaggard/followers","following_url":"https://api.github.com/users/weshaggard/following{/other_user}","gists_url":"https://api.github.com/users/weshaggard/gists{/gist_id}","starred_url":"https://api.github.com/users/weshaggard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weshaggard/subscriptions","organizations_url":"https://api.github.com/users/weshaggard/orgs","repos_url":"https://api.github.com/users/weshaggard/repos","events_url":"https://api.github.com/users/weshaggard/events{/privacy}","received_events_url":"https://api.github.com/users/weshaggard/received_events","type":"User","site_admin":false},"repo":{"id":27045928,"name":"buildtools","full_name":"weshaggard/buildtools","owner":{"login":"weshaggard","id":9010698,"avatar_url":"https://avatars.githubusercontent.com/u/9010698?v=3","gravatar_id":"","url":"https://api.github.com/users/weshaggard","html_url":"https://github.com/weshaggard","followers_url":"https://api.github.com/users/weshaggard/followers","following_url":"https://api.github.com/users/weshaggard/following{/other_user}","gists_url":"https://api.github.com/users/weshaggard/gists{/gist_id}","starred_url":"https://api.github.com/users/weshaggard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weshaggard/subscriptions","organizations_url":"https://api.github.com/users/weshaggard/orgs","repos_url":"https://api.github.com/users/weshaggard/repos","events_url":"https://api.github.com/users/weshaggard/events{/privacy}","received_events_url":"https://api.github.com/users/weshaggard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weshaggard/buildtools","description":"Build tools that are necessary for building the .NET Core projects","fork":true,"url":"https://api.github.com/repos/weshaggard/buildtools","forks_url":"https://api.github.com/repos/weshaggard/buildtools/forks","keys_url":"https://api.github.com/repos/weshaggard/buildtools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weshaggard/buildtools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weshaggard/buildtools/teams","hooks_url":"https://api.github.com/repos/weshaggard/buildtools/hooks","issue_events_url":"https://api.github.com/repos/weshaggard/buildtools/issues/events{/number}","events_url":"https://api.github.com/repos/weshaggard/buildtools/events","assignees_url":"https://api.github.com/repos/weshaggard/buildtools/assignees{/user}","branches_url":"https://api.github.com/repos/weshaggard/buildtools/branches{/branch}","tags_url":"https://api.github.com/repos/weshaggard/buildtools/tags","blobs_url":"https://api.github.com/repos/weshaggard/buildtools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weshaggard/buildtools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weshaggard/buildtools/git/refs{/sha}","trees_url":"https://api.github.com/repos/weshaggard/buildtools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weshaggard/buildtools/statuses/{sha}","languages_url":"https://api.github.com/repos/weshaggard/buildtools/languages","stargazers_url":"https://api.github.com/repos/weshaggard/buildtools/stargazers","contributors_url":"https://api.github.com/repos/weshaggard/buildtools/contributors","subscribers_url":"https://api.github.com/repos/weshaggard/buildtools/subscribers","subscription_url":"https://api.github.com/repos/weshaggard/buildtools/subscription","commits_url":"https://api.github.com/repos/weshaggard/buildtools/commits{/sha}","git_commits_url":"https://api.github.com/repos/weshaggard/buildtools/git/commits{/sha}","comments_url":"https://api.github.com/repos/weshaggard/buildtools/comments{/number}","issue_comment_url":"https://api.github.com/repos/weshaggard/buildtools/issues/comments/{number}","contents_url":"https://api.github.com/repos/weshaggard/buildtools/contents/{+path}","compare_url":"https://api.github.com/repos/weshaggard/buildtools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weshaggard/buildtools/merges","archive_url":"https://api.github.com/repos/weshaggard/buildtools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weshaggard/buildtools/downloads","issues_url":"https://api.github.com/repos/weshaggard/buildtools/issues{/number}","pulls_url":"https://api.github.com/repos/weshaggard/buildtools/pulls{/number}","milestones_url":"https://api.github.com/repos/weshaggard/buildtools/milestones{/number}","notifications_url":"https://api.github.com/repos/weshaggard/buildtools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weshaggard/buildtools/labels{/name}","releases_url":"https://api.github.com/repos/weshaggard/buildtools/releases{/id}","created_at":"2014-11-23T20:13:50Z","updated_at":"2014-12-19T16:44:08Z","pushed_at":"2014-12-19T16:44:47Z","git_url":"git://github.com/weshaggard/buildtools.git","ssh_url":"git@github.com:weshaggard/buildtools.git","clone_url":"https://github.com/weshaggard/buildtools.git","svn_url":"https://github.com/weshaggard/buildtools","homepage":"","size":138,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"dotnet:master","ref":"master","sha":"cccba645dd8887bc7388a5d0bc0ac5d10b592323","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":26295349,"name":"buildtools","full_name":"dotnet/buildtools","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/buildtools","description":"Build tools that are necessary for building the .NET Core projects","fork":false,"url":"https://api.github.com/repos/dotnet/buildtools","forks_url":"https://api.github.com/repos/dotnet/buildtools/forks","keys_url":"https://api.github.com/repos/dotnet/buildtools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/buildtools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/buildtools/teams","hooks_url":"https://api.github.com/repos/dotnet/buildtools/hooks","issue_events_url":"https://api.github.com/repos/dotnet/buildtools/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/buildtools/events","assignees_url":"https://api.github.com/repos/dotnet/buildtools/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/buildtools/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/buildtools/tags","blobs_url":"https://api.github.com/repos/dotnet/buildtools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/buildtools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/buildtools/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/buildtools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/buildtools/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/buildtools/languages","stargazers_url":"https://api.github.com/repos/dotnet/buildtools/stargazers","contributors_url":"https://api.github.com/repos/dotnet/buildtools/contributors","subscribers_url":"https://api.github.com/repos/dotnet/buildtools/subscribers","subscription_url":"https://api.github.com/repos/dotnet/buildtools/subscription","commits_url":"https://api.github.com/repos/dotnet/buildtools/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/buildtools/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/buildtools/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/buildtools/issues/comments/{number}","contents_url":"https://api.github.com/repos/dotnet/buildtools/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/buildtools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/buildtools/merges","archive_url":"https://api.github.com/repos/dotnet/buildtools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/buildtools/downloads","issues_url":"https://api.github.com/repos/dotnet/buildtools/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/buildtools/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/buildtools/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/buildtools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/buildtools/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/buildtools/releases{/id}","created_at":"2014-11-06T23:43:05Z","updated_at":"2014-12-19T16:42:55Z","pushed_at":"2014-12-19T16:42:54Z","git_url":"git://github.com/dotnet/buildtools.git","ssh_url":"git@github.com:dotnet/buildtools.git","clone_url":"https://github.com/dotnet/buildtools.git","svn_url":"https://github.com/dotnet/buildtools","homepage":"","size":709,"stargazers_count":261,"watchers_count":261,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":80,"mirror_url":null,"open_issues_count":7,"forks":80,"open_issues":7,"watchers":261,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/32"},"html":{"href":"https://github.com/dotnet/buildtools/pull/32"},"issue":{"href":"https://api.github.com/repos/dotnet/buildtools/issues/32"},"comments":{"href":"https://api.github.com/repos/dotnet/buildtools/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/buildtools/statuses/48eb8787ca57cf6a23e385134fbc65efffb0e702"}}}}