{"action":"created","comment":{"url":"https://api.github.com/repos/brthor/cli-1/pulls/comments/54499256","id":54499256,"diff_hunk":"@@ -0,0 +1,205 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.IO;\n+using System.Linq;\n+using System.Runtime.InteropServices;\n+using Microsoft.DotNet.ProjectModel;\n+using Microsoft.DotNet.ProjectModel.Graph;\n+using Microsoft.Extensions.PlatformAbstractions;\n+using NuGet.Frameworks;\n+using NuGet.Packaging;\n+using NuGet.Versioning;\n+\n+namespace Microsoft.DotNet.Cli.Utils\n+{\n+    internal class ProjectToolsPackageCommandResolver : ICommandResolver\n+    {\n+        private static readonly NuGetFramework s_toolPackageFramework = FrameworkConstants.CommonFrameworks.DnxCore50;\n+\n+        private List<string> _allowedCommandExtensions;\n+        private IPackagedCommandSpecCreator _packagedCommandSpecCreator;\n+\n+        public ProjectToolsPackageCommandResolver(IPackagedCommandSpecCreator packagedCommandSpecCreator)\n+        {\n+            _packagedCommandSpecCreator = packagedCommandSpecCreator;\n+\n+            _allowedCommandExtensions = new List<string>() \n+            {\n+                FileNameSuffixes.DotNet.DynamicLib\n+            };\n+        }\n+\n+        public CommandSpec Resolve(CommandResolverArguments commandResolverArguments)\n+        {\n+            return ResolveFromProjectTools(\n+                commandResolverArguments.CommandName, \n+                commandResolverArguments.CommandArguments,\n+                commandResolverArguments.ProjectDirectory);\n+        }\n+\n+        public CommandSpec ResolveFromProjectTools(\n+            string commandName, \n+            IEnumerable<string> args,\n+            string projectDirectory)\n+        {\n+            var projectContext = GetProjectContextFromDirectory(projectDirectory, s_toolPackageFramework);\n+\n+            if (projectContext == null)\n+            {\n+                return null;\n+            }\n+\n+            var toolsLibraries = projectContext.ProjectFile.Tools;","path":"src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsPackageCommandResolver.cs","position":52,"original_position":52,"commit_id":"3479cbe3e5db7a2e88163a18e47cadf2d54e962c","original_commit_id":"3479cbe3e5db7a2e88163a18e47cadf2d54e962c","user":{"login":"brthor","id":14280892,"avatar_url":"https://avatars.githubusercontent.com/u/14280892?v=3","gravatar_id":"","url":"https://api.github.com/users/brthor","html_url":"https://github.com/brthor","followers_url":"https://api.github.com/users/brthor/followers","following_url":"https://api.github.com/users/brthor/following{/other_user}","gists_url":"https://api.github.com/users/brthor/gists{/gist_id}","starred_url":"https://api.github.com/users/brthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brthor/subscriptions","organizations_url":"https://api.github.com/users/brthor/orgs","repos_url":"https://api.github.com/users/brthor/repos","events_url":"https://api.github.com/users/brthor/events{/privacy}","received_events_url":"https://api.github.com/users/brthor/received_events","type":"User","site_admin":false},"body":"I like it. Will be very useful","created_at":"2016-02-29T23:37:45Z","updated_at":"2016-02-29T23:37:45Z","html_url":"https://github.com/brthor/cli-1/pull/9#discussion_r54499256","pull_request_url":"https://api.github.com/repos/brthor/cli-1/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/brthor/cli-1/pulls/comments/54499256"},"html":{"href":"https://github.com/brthor/cli-1/pull/9#discussion_r54499256"},"pull_request":{"href":"https://api.github.com/repos/brthor/cli-1/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/brthor/cli-1/pulls/9","id":61157939,"html_url":"https://github.com/brthor/cli-1/pull/9","diff_url":"https://github.com/brthor/cli-1/pull/9.diff","patch_url":"https://github.com/brthor/cli-1/pull/9.patch","issue_url":"https://api.github.com/repos/brthor/cli-1/issues/9","number":9,"state":"open","locked":false,"title":"Brthor/cli nuget tools","user":{"login":"brthor","id":14280892,"avatar_url":"https://avatars.githubusercontent.com/u/14280892?v=3","gravatar_id":"","url":"https://api.github.com/users/brthor","html_url":"https://github.com/brthor","followers_url":"https://api.github.com/users/brthor/followers","following_url":"https://api.github.com/users/brthor/following{/other_user}","gists_url":"https://api.github.com/users/brthor/gists{/gist_id}","starred_url":"https://api.github.com/users/brthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brthor/subscriptions","organizations_url":"https://api.github.com/users/brthor/orgs","repos_url":"https://api.github.com/users/brthor/repos","events_url":"https://api.github.com/users/brthor/events{/privacy}","received_events_url":"https://api.github.com/users/brthor/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-29T22:32:49Z","updated_at":"2016-02-29T23:37:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9c8bd2c65c47162483f2d65df0c3eefc540357c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/brthor/cli-1/pulls/9/commits","review_comments_url":"https://api.github.com/repos/brthor/cli-1/pulls/9/comments","review_comment_url":"https://api.github.com/repos/brthor/cli-1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brthor/cli-1/issues/9/comments","statuses_url":"https://api.github.com/repos/brthor/cli-1/statuses/3479cbe3e5db7a2e88163a18e47cadf2d54e962c","head":{"label":"brthor:brthor/cli-nuget-tools","ref":"brthor/cli-nuget-tools","sha":"3479cbe3e5db7a2e88163a18e47cadf2d54e962c","user":{"login":"brthor","id":14280892,"avatar_url":"https://avatars.githubusercontent.com/u/14280892?v=3","gravatar_id":"","url":"https://api.github.com/users/brthor","html_url":"https://github.com/brthor","followers_url":"https://api.github.com/users/brthor/followers","following_url":"https://api.github.com/users/brthor/following{/other_user}","gists_url":"https://api.github.com/users/brthor/gists{/gist_id}","starred_url":"https://api.github.com/users/brthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brthor/subscriptions","organizations_url":"https://api.github.com/users/brthor/orgs","repos_url":"https://api.github.com/users/brthor/repos","events_url":"https://api.github.com/users/brthor/events{/privacy}","received_events_url":"https://api.github.com/users/brthor/received_events","type":"User","site_admin":false},"repo":{"id":46514660,"name":"cli-1","full_name":"brthor/cli-1","owner":{"login":"brthor","id":14280892,"avatar_url":"https://avatars.githubusercontent.com/u/14280892?v=3","gravatar_id":"","url":"https://api.github.com/users/brthor","html_url":"https://github.com/brthor","followers_url":"https://api.github.com/users/brthor/followers","following_url":"https://api.github.com/users/brthor/following{/other_user}","gists_url":"https://api.github.com/users/brthor/gists{/gist_id}","starred_url":"https://api.github.com/users/brthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brthor/subscriptions","organizations_url":"https://api.github.com/users/brthor/orgs","repos_url":"https://api.github.com/users/brthor/repos","events_url":"https://api.github.com/users/brthor/events{/privacy}","received_events_url":"https://api.github.com/users/brthor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brthor/cli-1","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":true,"url":"https://api.github.com/repos/brthor/cli-1","forks_url":"https://api.github.com/repos/brthor/cli-1/forks","keys_url":"https://api.github.com/repos/brthor/cli-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brthor/cli-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brthor/cli-1/teams","hooks_url":"https://api.github.com/repos/brthor/cli-1/hooks","issue_events_url":"https://api.github.com/repos/brthor/cli-1/issues/events{/number}","events_url":"https://api.github.com/repos/brthor/cli-1/events","assignees_url":"https://api.github.com/repos/brthor/cli-1/assignees{/user}","branches_url":"https://api.github.com/repos/brthor/cli-1/branches{/branch}","tags_url":"https://api.github.com/repos/brthor/cli-1/tags","blobs_url":"https://api.github.com/repos/brthor/cli-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brthor/cli-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brthor/cli-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/brthor/cli-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brthor/cli-1/statuses/{sha}","languages_url":"https://api.github.com/repos/brthor/cli-1/languages","stargazers_url":"https://api.github.com/repos/brthor/cli-1/stargazers","contributors_url":"https://api.github.com/repos/brthor/cli-1/contributors","subscribers_url":"https://api.github.com/repos/brthor/cli-1/subscribers","subscription_url":"https://api.github.com/repos/brthor/cli-1/subscription","commits_url":"https://api.github.com/repos/brthor/cli-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/brthor/cli-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/brthor/cli-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/brthor/cli-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/brthor/cli-1/contents/{+path}","compare_url":"https://api.github.com/repos/brthor/cli-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brthor/cli-1/merges","archive_url":"https://api.github.com/repos/brthor/cli-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brthor/cli-1/downloads","issues_url":"https://api.github.com/repos/brthor/cli-1/issues{/number}","pulls_url":"https://api.github.com/repos/brthor/cli-1/pulls{/number}","milestones_url":"https://api.github.com/repos/brthor/cli-1/milestones{/number}","notifications_url":"https://api.github.com/repos/brthor/cli-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brthor/cli-1/labels{/name}","releases_url":"https://api.github.com/repos/brthor/cli-1/releases{/id}","deployments_url":"https://api.github.com/repos/brthor/cli-1/deployments","created_at":"2015-11-19T19:17:23Z","updated_at":"2015-11-19T19:17:29Z","pushed_at":"2016-02-29T22:32:49Z","git_url":"git://github.com/brthor/cli-1.git","ssh_url":"git@github.com:brthor/cli-1.git","clone_url":"https://github.com/brthor/cli-1.git","svn_url":"https://github.com/brthor/cli-1","homepage":"http://dotnet.github.io/","size":17637,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"brthor:rel/1.0.0","ref":"rel/1.0.0","sha":"93f0a2b28df62f47c7e0b3010aaa2b8d7cc8198b","user":{"login":"brthor","id":14280892,"avatar_url":"https://avatars.githubusercontent.com/u/14280892?v=3","gravatar_id":"","url":"https://api.github.com/users/brthor","html_url":"https://github.com/brthor","followers_url":"https://api.github.com/users/brthor/followers","following_url":"https://api.github.com/users/brthor/following{/other_user}","gists_url":"https://api.github.com/users/brthor/gists{/gist_id}","starred_url":"https://api.github.com/users/brthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brthor/subscriptions","organizations_url":"https://api.github.com/users/brthor/orgs","repos_url":"https://api.github.com/users/brthor/repos","events_url":"https://api.github.com/users/brthor/events{/privacy}","received_events_url":"https://api.github.com/users/brthor/received_events","type":"User","site_admin":false},"repo":{"id":46514660,"name":"cli-1","full_name":"brthor/cli-1","owner":{"login":"brthor","id":14280892,"avatar_url":"https://avatars.githubusercontent.com/u/14280892?v=3","gravatar_id":"","url":"https://api.github.com/users/brthor","html_url":"https://github.com/brthor","followers_url":"https://api.github.com/users/brthor/followers","following_url":"https://api.github.com/users/brthor/following{/other_user}","gists_url":"https://api.github.com/users/brthor/gists{/gist_id}","starred_url":"https://api.github.com/users/brthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brthor/subscriptions","organizations_url":"https://api.github.com/users/brthor/orgs","repos_url":"https://api.github.com/users/brthor/repos","events_url":"https://api.github.com/users/brthor/events{/privacy}","received_events_url":"https://api.github.com/users/brthor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brthor/cli-1","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":true,"url":"https://api.github.com/repos/brthor/cli-1","forks_url":"https://api.github.com/repos/brthor/cli-1/forks","keys_url":"https://api.github.com/repos/brthor/cli-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brthor/cli-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brthor/cli-1/teams","hooks_url":"https://api.github.com/repos/brthor/cli-1/hooks","issue_events_url":"https://api.github.com/repos/brthor/cli-1/issues/events{/number}","events_url":"https://api.github.com/repos/brthor/cli-1/events","assignees_url":"https://api.github.com/repos/brthor/cli-1/assignees{/user}","branches_url":"https://api.github.com/repos/brthor/cli-1/branches{/branch}","tags_url":"https://api.github.com/repos/brthor/cli-1/tags","blobs_url":"https://api.github.com/repos/brthor/cli-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brthor/cli-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brthor/cli-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/brthor/cli-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brthor/cli-1/statuses/{sha}","languages_url":"https://api.github.com/repos/brthor/cli-1/languages","stargazers_url":"https://api.github.com/repos/brthor/cli-1/stargazers","contributors_url":"https://api.github.com/repos/brthor/cli-1/contributors","subscribers_url":"https://api.github.com/repos/brthor/cli-1/subscribers","subscription_url":"https://api.github.com/repos/brthor/cli-1/subscription","commits_url":"https://api.github.com/repos/brthor/cli-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/brthor/cli-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/brthor/cli-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/brthor/cli-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/brthor/cli-1/contents/{+path}","compare_url":"https://api.github.com/repos/brthor/cli-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brthor/cli-1/merges","archive_url":"https://api.github.com/repos/brthor/cli-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brthor/cli-1/downloads","issues_url":"https://api.github.com/repos/brthor/cli-1/issues{/number}","pulls_url":"https://api.github.com/repos/brthor/cli-1/pulls{/number}","milestones_url":"https://api.github.com/repos/brthor/cli-1/milestones{/number}","notifications_url":"https://api.github.com/repos/brthor/cli-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brthor/cli-1/labels{/name}","releases_url":"https://api.github.com/repos/brthor/cli-1/releases{/id}","deployments_url":"https://api.github.com/repos/brthor/cli-1/deployments","created_at":"2015-11-19T19:17:23Z","updated_at":"2015-11-19T19:17:29Z","pushed_at":"2016-02-29T22:32:49Z","git_url":"git://github.com/brthor/cli-1.git","ssh_url":"git@github.com:brthor/cli-1.git","clone_url":"https://github.com/brthor/cli-1.git","svn_url":"https://github.com/brthor/cli-1","homepage":"http://dotnet.github.io/","size":17637,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brthor/cli-1/pulls/9"},"html":{"href":"https://github.com/brthor/cli-1/pull/9"},"issue":{"href":"https://api.github.com/repos/brthor/cli-1/issues/9"},"comments":{"href":"https://api.github.com/repos/brthor/cli-1/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/brthor/cli-1/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/brthor/cli-1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brthor/cli-1/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/brthor/cli-1/statuses/3479cbe3e5db7a2e88163a18e47cadf2d54e962c"}}}}