{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/buildtools/pulls/comments/67536577","id":67536577,"diff_hunk":"@@ -111,14 +117,75 @@ public override bool Execute()\n             // Update framework dependencies sections\n             for (int i = 0; i < Frameworks.Length; i++)\n             {\n-                dependencies = GenerateDependencies(projectRoot, ExternalPackages, Frameworks[i]);\n+                dependencies = GenerateDependencies(projectRoot, ExternalPackages, packageInformation, Frameworks[i]);\n                 projectRoot = UpdateDependenciesProperty(projectRoot, dependencies, Frameworks[i]);\n             }\n             WriteProject(projectRoot, OutputProjectJson);\n \n             return true;\n         }\n \n+        /// <summary>\n+        /// Given a package name regex pattern, and an array of drop locations, create an array of objects\n+        /// containing package information (name, version,, prerelease version)\n+        /// </summary>\n+        /// <param name=\"packagesDrops\"></param>\n+        /// <returns></returns>\n+        private IEnumerable<ITaskItem> GatherPackageInformationFromDrops(string [] packagesDrops)\n+        {\n+            List<ITaskItem> packageNameItems = new List<ITaskItem>();\n+\n+            foreach (string packageDrop in packagesDrops)\n+            {\n+                if (!Directory.Exists(packageDrop))\n+                {\n+                    Log.LogWarning(\"PackageDrop does not exist - '{0}'\", packageDrop);\n+                    continue;\n+                }\n+                IEnumerable<ITaskItem> packages = Directory.GetFiles(packageDrop).Select(f => new TaskItem(Path.GetFileNameWithoutExtension(f)));\n+\n+                foreach (ITaskItem package in packages)\n+                {\n+                    packageNameItems.Add(CreatePackageItemFromString(package.ItemSpec));\n+                }\n+            }\n+            return packageNameItems;\n+        }\n+\n+        // A versions file is of the form https://github.com/dotnet/versions/blob/master/build-info/dotnet/corefx/master/Latest_Packages.txt\n+        private IEnumerable<ITaskItem> GatherPackageInformationFromVersionsFile(string versionsFile)\n+        {\n+            List<ITaskItem> packageNameItems = new List<ITaskItem>();\n+            if(!File.Exists(versionsFile))\n+            {\n+                Log.LogError(\"Specified versions file ({0}) does not exist.\", versionsFile);\n+            }\n+            var lines = File.ReadAllLines(versionsFile);\n+            foreach(string line in lines)\n+            { \n+                if(!string.IsNullOrWhiteSpace(line))\n+                {\n+                    string packageVersion = line.Replace(' ', '.');\n+                    packageNameItems.Add(CreatePackageItemFromString(packageVersion));\n+                }\n+            }\n+            return packageNameItems;\n+        }\n+\n+        private TaskItem CreatePackageItemFromString(string package)\n+        {\n+            Match m = _packageNameRegex.Match(package);\n+            TaskItem packageItem = null;\n+            if (m.Success)\n+            {\n+                packageItem = new TaskItem(m.Groups[0].Value);\n+                string name = m.Groups[1].Value;\n+                packageItem.SetMetadata(\"Name\", name);\n+                packageItem.SetMetadata(\"Version\", m.Groups[2].Value);\n+                packageItem.SetMetadata(\"ReleaseVersion\", m.Groups[3].Value);","path":"src/Microsoft.DotNet.Build.Tasks/AddDependenciesToProjectJson.cs","position":194,"original_position":194,"commit_id":"2f084904a4b5b1927d46b9f59bf2816deb82a2e9","original_commit_id":"2f084904a4b5b1927d46b9f59bf2816deb82a2e9","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":"ReleaseVersion => PrereleaseVersion.","created_at":"2016-06-17T16:17:56Z","updated_at":"2016-06-17T16:17:56Z","html_url":"https://github.com/dotnet/buildtools/pull/806#discussion_r67536577","pull_request_url":"https://api.github.com/repos/dotnet/buildtools/pulls/806","_links":{"self":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/comments/67536577"},"html":{"href":"https://github.com/dotnet/buildtools/pull/806#discussion_r67536577"},"pull_request":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/806"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/buildtools/pulls/806","id":73818523,"html_url":"https://github.com/dotnet/buildtools/pull/806","diff_url":"https://github.com/dotnet/buildtools/pull/806.diff","patch_url":"https://github.com/dotnet/buildtools/pull/806.patch","issue_url":"https://api.github.com/repos/dotnet/buildtools/issues/806","number":806,"state":"open","locked":false,"title":"Updates for ProjectReference -> Package dependency conversion.","user":{"login":"chcosta","id":10092143,"avatar_url":"https://avatars.githubusercontent.com/u/10092143?v=3","gravatar_id":"","url":"https://api.github.com/users/chcosta","html_url":"https://github.com/chcosta","followers_url":"https://api.github.com/users/chcosta/followers","following_url":"https://api.github.com/users/chcosta/following{/other_user}","gists_url":"https://api.github.com/users/chcosta/gists{/gist_id}","starred_url":"https://api.github.com/users/chcosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chcosta/subscriptions","organizations_url":"https://api.github.com/users/chcosta/orgs","repos_url":"https://api.github.com/users/chcosta/repos","events_url":"https://api.github.com/users/chcosta/events{/privacy}","received_events_url":"https://api.github.com/users/chcosta/received_events","type":"User","site_admin":false},"body":"  - Support stable package versions\r\n  - Remove build number override in favor of versions from a package drop or from a versions file\r\n  - Support package versions read from a versions file (not currently being utilized, but this adds support).\r\n  - Eliminate unneccessary regex properties\r\n  - Remove auto-assumed release version and package versions, if you want to specify a specific version, then provide a versions file.\r\n  - Remove ParsePackageNames task which is no longer required.\r\n\r\nThis will allow us to validate against stable packages in the release branch, if we port this to buildtools/release/1.0.0\r\n\r\n/cc @weshaggard @ericstj ","created_at":"2016-06-14T21:40:12Z","updated_at":"2016-06-17T16:17:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31c05aafd03200da2ca654e85124995dc22ea6cc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/buildtools/pulls/806/commits","review_comments_url":"https://api.github.com/repos/dotnet/buildtools/pulls/806/comments","review_comment_url":"https://api.github.com/repos/dotnet/buildtools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/buildtools/issues/806/comments","statuses_url":"https://api.github.com/repos/dotnet/buildtools/statuses/2f084904a4b5b1927d46b9f59bf2816deb82a2e9","head":{"label":"chcosta:pr2pd_fixes","ref":"pr2pd_fixes","sha":"2f084904a4b5b1927d46b9f59bf2816deb82a2e9","user":{"login":"chcosta","id":10092143,"avatar_url":"https://avatars.githubusercontent.com/u/10092143?v=3","gravatar_id":"","url":"https://api.github.com/users/chcosta","html_url":"https://github.com/chcosta","followers_url":"https://api.github.com/users/chcosta/followers","following_url":"https://api.github.com/users/chcosta/following{/other_user}","gists_url":"https://api.github.com/users/chcosta/gists{/gist_id}","starred_url":"https://api.github.com/users/chcosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chcosta/subscriptions","organizations_url":"https://api.github.com/users/chcosta/orgs","repos_url":"https://api.github.com/users/chcosta/repos","events_url":"https://api.github.com/users/chcosta/events{/privacy}","received_events_url":"https://api.github.com/users/chcosta/received_events","type":"User","site_admin":false},"repo":{"id":50137247,"name":"buildtools","full_name":"chcosta/buildtools","owner":{"login":"chcosta","id":10092143,"avatar_url":"https://avatars.githubusercontent.com/u/10092143?v=3","gravatar_id":"","url":"https://api.github.com/users/chcosta","html_url":"https://github.com/chcosta","followers_url":"https://api.github.com/users/chcosta/followers","following_url":"https://api.github.com/users/chcosta/following{/other_user}","gists_url":"https://api.github.com/users/chcosta/gists{/gist_id}","starred_url":"https://api.github.com/users/chcosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chcosta/subscriptions","organizations_url":"https://api.github.com/users/chcosta/orgs","repos_url":"https://api.github.com/users/chcosta/repos","events_url":"https://api.github.com/users/chcosta/events{/privacy}","received_events_url":"https://api.github.com/users/chcosta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chcosta/buildtools","description":"Build tools that are necessary for building the .NET Core projects","fork":true,"url":"https://api.github.com/repos/chcosta/buildtools","forks_url":"https://api.github.com/repos/chcosta/buildtools/forks","keys_url":"https://api.github.com/repos/chcosta/buildtools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chcosta/buildtools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chcosta/buildtools/teams","hooks_url":"https://api.github.com/repos/chcosta/buildtools/hooks","issue_events_url":"https://api.github.com/repos/chcosta/buildtools/issues/events{/number}","events_url":"https://api.github.com/repos/chcosta/buildtools/events","assignees_url":"https://api.github.com/repos/chcosta/buildtools/assignees{/user}","branches_url":"https://api.github.com/repos/chcosta/buildtools/branches{/branch}","tags_url":"https://api.github.com/repos/chcosta/buildtools/tags","blobs_url":"https://api.github.com/repos/chcosta/buildtools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chcosta/buildtools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chcosta/buildtools/git/refs{/sha}","trees_url":"https://api.github.com/repos/chcosta/buildtools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chcosta/buildtools/statuses/{sha}","languages_url":"https://api.github.com/repos/chcosta/buildtools/languages","stargazers_url":"https://api.github.com/repos/chcosta/buildtools/stargazers","contributors_url":"https://api.github.com/repos/chcosta/buildtools/contributors","subscribers_url":"https://api.github.com/repos/chcosta/buildtools/subscribers","subscription_url":"https://api.github.com/repos/chcosta/buildtools/subscription","commits_url":"https://api.github.com/repos/chcosta/buildtools/commits{/sha}","git_commits_url":"https://api.github.com/repos/chcosta/buildtools/git/commits{/sha}","comments_url":"https://api.github.com/repos/chcosta/buildtools/comments{/number}","issue_comment_url":"https://api.github.com/repos/chcosta/buildtools/issues/comments{/number}","contents_url":"https://api.github.com/repos/chcosta/buildtools/contents/{+path}","compare_url":"https://api.github.com/repos/chcosta/buildtools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chcosta/buildtools/merges","archive_url":"https://api.github.com/repos/chcosta/buildtools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chcosta/buildtools/downloads","issues_url":"https://api.github.com/repos/chcosta/buildtools/issues{/number}","pulls_url":"https://api.github.com/repos/chcosta/buildtools/pulls{/number}","milestones_url":"https://api.github.com/repos/chcosta/buildtools/milestones{/number}","notifications_url":"https://api.github.com/repos/chcosta/buildtools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chcosta/buildtools/labels{/name}","releases_url":"https://api.github.com/repos/chcosta/buildtools/releases{/id}","deployments_url":"https://api.github.com/repos/chcosta/buildtools/deployments","created_at":"2016-01-21T21:16:42Z","updated_at":"2016-01-21T21:16:43Z","pushed_at":"2016-06-14T22:56:17Z","git_url":"git://github.com/chcosta/buildtools.git","ssh_url":"git@github.com:chcosta/buildtools.git","clone_url":"https://github.com/chcosta/buildtools.git","svn_url":"https://github.com/chcosta/buildtools","homepage":"","size":3327,"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":"e04e17021bc809b95c243a4be2fe98467257d66c","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}","deployments_url":"https://api.github.com/repos/dotnet/buildtools/deployments","created_at":"2014-11-06T23:43:05Z","updated_at":"2016-06-16T14:41:28Z","pushed_at":"2016-06-17T14:30:00Z","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":4118,"stargazers_count":406,"watchers_count":406,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":187,"mirror_url":null,"open_issues_count":83,"forks":187,"open_issues":83,"watchers":406,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/806"},"html":{"href":"https://github.com/dotnet/buildtools/pull/806"},"issue":{"href":"https://api.github.com/repos/dotnet/buildtools/issues/806"},"comments":{"href":"https://api.github.com/repos/dotnet/buildtools/issues/806/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/806/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/buildtools/pulls/806/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/buildtools/statuses/2f084904a4b5b1927d46b9f59bf2816deb82a2e9"}}}}
{"actor":{"display_login":"weshaggard"}}