{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/arcade/pulls/comments/242335966","pull_request_review_id":185821586,"id":242335966,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjMzNTk2Ng==","diff_hunk":"@@ -0,0 +1,65 @@\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.CodeAnalysis;\n+using Microsoft.CodeAnalysis.CSharp;\n+using Microsoft.CodeAnalysis.CSharp.Syntax;\n+\n+namespace Microsoft.DotNet.Build.Tasks.Packaging\n+{\n+    internal class PublicTypesToInternalRewriter : CSharpSyntaxRewriter\n+    {\n+        public PublicTypesToInternalRewriter()\n+            : base(false) { }\n+\n+        public override SyntaxNode VisitStructDeclaration(StructDeclarationSyntax node)\n+        {\n+            return base.VisitStructDeclaration((StructDeclarationSyntax)ChangePublicDeclarationToInternal(node));\n+        }\n+\n+        public override SyntaxNode VisitInterfaceDeclaration(InterfaceDeclarationSyntax node)\n+        {\n+            return base.VisitInterfaceDeclaration((InterfaceDeclarationSyntax)ChangePublicDeclarationToInternal(node));\n+        }\n+\n+        public override SyntaxNode VisitEnumDeclaration(EnumDeclarationSyntax node)\n+        {\n+            return base.VisitEnumDeclaration((EnumDeclarationSyntax)ChangePublicDeclarationToInternal(node));\n+        }\n+\n+        public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)\n+        {\n+            return base.VisitClassDeclaration((ClassDeclarationSyntax)ChangePublicDeclarationToInternal(node));\n+        }\n+\n+        private SyntaxNode ChangePublicDeclarationToInternal(BaseTypeDeclarationSyntax node)\n+        {\n+            SyntaxToken publicToken;\n+            if (HasPublicModifier(node, out publicToken))\n+            {\n+                return node.ReplaceToken(publicToken, SyntaxFactory.Token(SyntaxKind.InternalKeyword)\n+                                                                    .WithLeadingTrivia(publicToken.LeadingTrivia)\n+                                                                    .WithTrailingTrivia(publicToken.TrailingTrivia));\n+            }\n+            else\n+            {\n+                return node;\n+            }\n+        }\n+\n+        private bool HasPublicModifier(BaseTypeDeclarationSyntax token, out SyntaxToken publicToken)\n+        {\n+            foreach (var modifier in token.Modifiers)","path":"src/Microsoft.DotNet.Build.Tasks.Packaging/src/PublicTypesToInternalRewriter.cs","position":53,"original_position":53,"commit_id":"0d2cbc4a2c70f4dc5153293607d1b30477eeda14","original_commit_id":"0d2cbc4a2c70f4dc5153293607d1b30477eeda14","user":{"login":"ahsonkhan","id":6527137,"node_id":"MDQ6VXNlcjY1MjcxMzc=","avatar_url":"https://avatars1.githubusercontent.com/u/6527137?v=4","gravatar_id":"","url":"https://api.github.com/users/ahsonkhan","html_url":"https://github.com/ahsonkhan","followers_url":"https://api.github.com/users/ahsonkhan/followers","following_url":"https://api.github.com/users/ahsonkhan/following{/other_user}","gists_url":"https://api.github.com/users/ahsonkhan/gists{/gist_id}","starred_url":"https://api.github.com/users/ahsonkhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahsonkhan/subscriptions","organizations_url":"https://api.github.com/users/ahsonkhan/orgs","repos_url":"https://api.github.com/users/ahsonkhan/repos","events_url":"https://api.github.com/users/ahsonkhan/events{/privacy}","received_events_url":"https://api.github.com/users/ahsonkhan/received_events","type":"User","site_admin":false},"body":"same nit","created_at":"2018-12-17T22:12:29Z","updated_at":"2018-12-17T22:14:06Z","html_url":"https://github.com/dotnet/arcade/pull/1607#discussion_r242335966","pull_request_url":"https://api.github.com/repos/dotnet/arcade/pulls/1607","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dotnet/arcade/pulls/comments/242335966"},"html":{"href":"https://github.com/dotnet/arcade/pull/1607#discussion_r242335966"},"pull_request":{"href":"https://api.github.com/repos/dotnet/arcade/pulls/1607"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/arcade/pulls/1607","id":239294572,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5Mjk0NTcy","html_url":"https://github.com/dotnet/arcade/pull/1607","diff_url":"https://github.com/dotnet/arcade/pull/1607.diff","patch_url":"https://github.com/dotnet/arcade/pull/1607.patch","issue_url":"https://api.github.com/repos/dotnet/arcade/issues/1607","number":1607,"state":"open","locked":false,"title":"Adding GenerateSourceWithPublicTypesAsInternal task","user":{"login":"joperezr","id":13854455,"node_id":"MDQ6VXNlcjEzODU0NDU1","avatar_url":"https://avatars3.githubusercontent.com/u/13854455?v=4","gravatar_id":"","url":"https://api.github.com/users/joperezr","html_url":"https://github.com/joperezr","followers_url":"https://api.github.com/users/joperezr/followers","following_url":"https://api.github.com/users/joperezr/following{/other_user}","gists_url":"https://api.github.com/users/joperezr/gists{/gist_id}","starred_url":"https://api.github.com/users/joperezr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joperezr/subscriptions","organizations_url":"https://api.github.com/users/joperezr/orgs","repos_url":"https://api.github.com/users/joperezr/repos","events_url":"https://api.github.com/users/joperezr/events{/privacy}","received_events_url":"https://api.github.com/users/joperezr/received_events","type":"User","site_admin":false},"body":"cc: @ericstj @ahsonkhan @safern \r\n\r\nAdding Task that will generate a copy of the specified files while rewriting all public types to internal so that they can be packaged as a source package. We will use this as part of creating our System.Text.Json source package.\r\n\r\nNOTE: This can still be considered as WIP since I need to add the targets that we will call from the build here as well, so that will be part of this PR.","created_at":"2018-12-17T21:48:11Z","updated_at":"2018-12-17T22:14:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df3ef37b613d04d22cee5f38d7b3f8d4527377d0","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ericstj","id":8918108,"node_id":"MDQ6VXNlcjg5MTgxMDg=","avatar_url":"https://avatars3.githubusercontent.com/u/8918108?v=4","gravatar_id":"","url":"https://api.github.com/users/ericstj","html_url":"https://github.com/ericstj","followers_url":"https://api.github.com/users/ericstj/followers","following_url":"https://api.github.com/users/ericstj/following{/other_user}","gists_url":"https://api.github.com/users/ericstj/gists{/gist_id}","starred_url":"https://api.github.com/users/ericstj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericstj/subscriptions","organizations_url":"https://api.github.com/users/ericstj/orgs","repos_url":"https://api.github.com/users/ericstj/repos","events_url":"https://api.github.com/users/ericstj/events{/privacy}","received_events_url":"https://api.github.com/users/ericstj/received_events","type":"User","site_admin":false},{"login":"safern","id":22899328,"node_id":"MDQ6VXNlcjIyODk5MzI4","avatar_url":"https://avatars1.githubusercontent.com/u/22899328?v=4","gravatar_id":"","url":"https://api.github.com/users/safern","html_url":"https://github.com/safern","followers_url":"https://api.github.com/users/safern/followers","following_url":"https://api.github.com/users/safern/following{/other_user}","gists_url":"https://api.github.com/users/safern/gists{/gist_id}","starred_url":"https://api.github.com/users/safern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/safern/subscriptions","organizations_url":"https://api.github.com/users/safern/orgs","repos_url":"https://api.github.com/users/safern/repos","events_url":"https://api.github.com/users/safern/events{/privacy}","received_events_url":"https://api.github.com/users/safern/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/arcade/pulls/1607/commits","review_comments_url":"https://api.github.com/repos/dotnet/arcade/pulls/1607/comments","review_comment_url":"https://api.github.com/repos/dotnet/arcade/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/arcade/issues/1607/comments","statuses_url":"https://api.github.com/repos/dotnet/arcade/statuses/0d2cbc4a2c70f4dc5153293607d1b30477eeda14","head":{"label":"joperezr:AddRewriterTask","ref":"AddRewriterTask","sha":"0d2cbc4a2c70f4dc5153293607d1b30477eeda14","user":{"login":"joperezr","id":13854455,"node_id":"MDQ6VXNlcjEzODU0NDU1","avatar_url":"https://avatars3.githubusercontent.com/u/13854455?v=4","gravatar_id":"","url":"https://api.github.com/users/joperezr","html_url":"https://github.com/joperezr","followers_url":"https://api.github.com/users/joperezr/followers","following_url":"https://api.github.com/users/joperezr/following{/other_user}","gists_url":"https://api.github.com/users/joperezr/gists{/gist_id}","starred_url":"https://api.github.com/users/joperezr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joperezr/subscriptions","organizations_url":"https://api.github.com/users/joperezr/orgs","repos_url":"https://api.github.com/users/joperezr/repos","events_url":"https://api.github.com/users/joperezr/events{/privacy}","received_events_url":"https://api.github.com/users/joperezr/received_events","type":"User","site_admin":false},"repo":{"id":136510506,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY1MTA1MDY=","name":"arcade","full_name":"joperezr/arcade","private":false,"owner":{"login":"joperezr","id":13854455,"node_id":"MDQ6VXNlcjEzODU0NDU1","avatar_url":"https://avatars3.githubusercontent.com/u/13854455?v=4","gravatar_id":"","url":"https://api.github.com/users/joperezr","html_url":"https://github.com/joperezr","followers_url":"https://api.github.com/users/joperezr/followers","following_url":"https://api.github.com/users/joperezr/following{/other_user}","gists_url":"https://api.github.com/users/joperezr/gists{/gist_id}","starred_url":"https://api.github.com/users/joperezr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joperezr/subscriptions","organizations_url":"https://api.github.com/users/joperezr/orgs","repos_url":"https://api.github.com/users/joperezr/repos","events_url":"https://api.github.com/users/joperezr/events{/privacy}","received_events_url":"https://api.github.com/users/joperezr/received_events","type":"User","site_admin":false},"html_url":"https://github.com/joperezr/arcade","description":"Tools that provide common build infrastructure for multiple .NET Foundation projects.","fork":true,"url":"https://api.github.com/repos/joperezr/arcade","forks_url":"https://api.github.com/repos/joperezr/arcade/forks","keys_url":"https://api.github.com/repos/joperezr/arcade/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joperezr/arcade/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joperezr/arcade/teams","hooks_url":"https://api.github.com/repos/joperezr/arcade/hooks","issue_events_url":"https://api.github.com/repos/joperezr/arcade/issues/events{/number}","events_url":"https://api.github.com/repos/joperezr/arcade/events","assignees_url":"https://api.github.com/repos/joperezr/arcade/assignees{/user}","branches_url":"https://api.github.com/repos/joperezr/arcade/branches{/branch}","tags_url":"https://api.github.com/repos/joperezr/arcade/tags","blobs_url":"https://api.github.com/repos/joperezr/arcade/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joperezr/arcade/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joperezr/arcade/git/refs{/sha}","trees_url":"https://api.github.com/repos/joperezr/arcade/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joperezr/arcade/statuses/{sha}","languages_url":"https://api.github.com/repos/joperezr/arcade/languages","stargazers_url":"https://api.github.com/repos/joperezr/arcade/stargazers","contributors_url":"https://api.github.com/repos/joperezr/arcade/contributors","subscribers_url":"https://api.github.com/repos/joperezr/arcade/subscribers","subscription_url":"https://api.github.com/repos/joperezr/arcade/subscription","commits_url":"https://api.github.com/repos/joperezr/arcade/commits{/sha}","git_commits_url":"https://api.github.com/repos/joperezr/arcade/git/commits{/sha}","comments_url":"https://api.github.com/repos/joperezr/arcade/comments{/number}","issue_comment_url":"https://api.github.com/repos/joperezr/arcade/issues/comments{/number}","contents_url":"https://api.github.com/repos/joperezr/arcade/contents/{+path}","compare_url":"https://api.github.com/repos/joperezr/arcade/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joperezr/arcade/merges","archive_url":"https://api.github.com/repos/joperezr/arcade/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joperezr/arcade/downloads","issues_url":"https://api.github.com/repos/joperezr/arcade/issues{/number}","pulls_url":"https://api.github.com/repos/joperezr/arcade/pulls{/number}","milestones_url":"https://api.github.com/repos/joperezr/arcade/milestones{/number}","notifications_url":"https://api.github.com/repos/joperezr/arcade/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joperezr/arcade/labels{/name}","releases_url":"https://api.github.com/repos/joperezr/arcade/releases{/id}","deployments_url":"https://api.github.com/repos/joperezr/arcade/deployments","created_at":"2018-06-07T17:32:28Z","updated_at":"2018-06-13T20:14:59Z","pushed_at":"2018-12-17T21:44:02Z","git_url":"git://github.com/joperezr/arcade.git","ssh_url":"git@github.com:joperezr/arcade.git","clone_url":"https://github.com/joperezr/arcade.git","svn_url":"https://github.com/joperezr/arcade","homepage":"","size":1353,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"10ec5d3f233dbd73174742222c77f9b32a4da6b0","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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":121444325,"node_id":"MDEwOlJlcG9zaXRvcnkxMjE0NDQzMjU=","name":"arcade","full_name":"dotnet/arcade","private":false,"owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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},"html_url":"https://github.com/dotnet/arcade","description":"Tools that provide common build infrastructure for multiple .NET Foundation projects.","fork":false,"url":"https://api.github.com/repos/dotnet/arcade","forks_url":"https://api.github.com/repos/dotnet/arcade/forks","keys_url":"https://api.github.com/repos/dotnet/arcade/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/arcade/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/arcade/teams","hooks_url":"https://api.github.com/repos/dotnet/arcade/hooks","issue_events_url":"https://api.github.com/repos/dotnet/arcade/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/arcade/events","assignees_url":"https://api.github.com/repos/dotnet/arcade/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/arcade/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/arcade/tags","blobs_url":"https://api.github.com/repos/dotnet/arcade/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/arcade/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/arcade/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/arcade/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/arcade/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/arcade/languages","stargazers_url":"https://api.github.com/repos/dotnet/arcade/stargazers","contributors_url":"https://api.github.com/repos/dotnet/arcade/contributors","subscribers_url":"https://api.github.com/repos/dotnet/arcade/subscribers","subscription_url":"https://api.github.com/repos/dotnet/arcade/subscription","commits_url":"https://api.github.com/repos/dotnet/arcade/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/arcade/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/arcade/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/arcade/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/arcade/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/arcade/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/arcade/merges","archive_url":"https://api.github.com/repos/dotnet/arcade/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/arcade/downloads","issues_url":"https://api.github.com/repos/dotnet/arcade/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/arcade/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/arcade/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/arcade/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/arcade/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/arcade/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/arcade/deployments","created_at":"2018-02-13T22:29:54Z","updated_at":"2018-12-17T17:26:20Z","pushed_at":"2018-12-17T21:53:14Z","git_url":"git://github.com/dotnet/arcade.git","ssh_url":"git@github.com:dotnet/arcade.git","clone_url":"https://github.com/dotnet/arcade.git","svn_url":"https://github.com/dotnet/arcade","homepage":"","size":6138,"stargazers_count":42,"watchers_count":42,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"archived":false,"open_issues_count":358,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":52,"open_issues":358,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/arcade/pulls/1607"},"html":{"href":"https://github.com/dotnet/arcade/pull/1607"},"issue":{"href":"https://api.github.com/repos/dotnet/arcade/issues/1607"},"comments":{"href":"https://api.github.com/repos/dotnet/arcade/issues/1607/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/arcade/pulls/1607/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/arcade/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/arcade/pulls/1607/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/arcade/statuses/0d2cbc4a2c70f4dc5153293607d1b30477eeda14"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ahsonkhan"}}