{"action":"created","comment":{"url":"https://api.github.com/repos/btc-ag/service-idl/pulls/comments/180008255","pull_request_review_id":110352456,"id":180008255,"diff_hunk":"@@ -98,59 +101,63 @@ class JavaGenerator\n       // iterate module by module and generate included content\r\n       for (module : idl.modules)\r\n       {\r\n-         processModule(module)\r\n+         processModule(module, projectTypes)\r\n       }\r\n    }\r\n \r\n-   def private void processModule(ModuleDeclaration module)\r\n+   def private void processModule(ModuleDeclaration module, Set<ProjectType> projectTypes)\r\n    {\r\n       param_bundle = ParameterBundle.createBuilder(Util.getModuleStack(module))\r\n       param_bundle.reset(ArtifactNature.JAVA)\r\n       \r\n       if (!module.virtual)\r\n       {\r\n          // generate common data types and exceptions, if available\r\n-         if ( module.containsTypes )\r\n-            generateModuleContents(module)\r\n+         if (module.containsTypes )\r\n+            generateModuleContents(module, projectTypes)\r\n \r\n          // generate proxy/dispatcher projects for all contained interfaces\r\n          if (module.containsInterfaces)\r\n-            generateInterfaceProjects(module)\r\n+            generateInterfaceProjects(module, projectTypes)\r\n       }\r\n       \r\n       // process nested modules\r\n       for (nested_module : module.nestedModules)\r\n-         processModule(nested_module)\r\n+         processModule(nested_module, projectTypes)\r\n    }\r\n \r\n-   def private void generateModuleContents(ModuleDeclaration module)\r\n+   def private void generateModuleContents(ModuleDeclaration module, Set<ProjectType> projectTypes)\r\n    {\r\n       reinitializeAll\r\n       param_bundle.reset(Util.getModuleStack(module))\r\n       \r\n-      generateCommon(makeProjectSourcePath(module, ProjectType.COMMON, MavenArtifactType.MAIN_JAVA, PathType.FULL), module)\r\n-      generateProtobuf(makeProjectSourcePath(module, ProjectType.PROTOBUF, MavenArtifactType.MAIN_JAVA, PathType.FULL), module)\r\n+      if (projectTypes.contains(ProjectType.COMMON))\r\n+        generateCommon(makeProjectSourcePath(module, ProjectType.COMMON, MavenArtifactType.MAIN_JAVA, PathType.FULL), module)\r\n+        \r\n+      if (projectTypes.contains(ProjectType.PROTOBUF))\r\n+        generateProtobuf(makeProjectSourcePath(module, ProjectType.PROTOBUF, MavenArtifactType.MAIN_JAVA, PathType.FULL), module)\r\n       \r\n       generatePOM(module)\r\n    }\r\n \r\n-   def private void generateInterfaceProjects(ModuleDeclaration module)\r\n+   def private void generateInterfaceProjects(ModuleDeclaration module, Set<ProjectType> projectTypes)\r\n    {\r\n       for (interface_declaration : module.moduleComponents.filter(InterfaceDeclaration))\r\n       {\r\n          reinitializeAll\r\n          param_bundle.reset(Util.getModuleStack(interface_declaration))\r\n \r\n-         generateProject(ProjectType.SERVICE_API, interface_declaration)\r\n-         generateProject(ProjectType.IMPL, interface_declaration)\r\n-         generateProject(ProjectType.PROTOBUF, interface_declaration)\r\n-         generateProject(ProjectType.PROXY, interface_declaration)\r\n-         generateProject(ProjectType.DISPATCHER, interface_declaration)\r\n-         generateProject(ProjectType.TEST, interface_declaration)\r\n-         generateProject(ProjectType.SERVER_RUNNER, interface_declaration)\r\n-         generateProject(ProjectType.CLIENT_CONSOLE, interface_declaration)\r\n-         \r\n-         generatePOM(interface_declaration)\r\n+         val activeProjectTypes = Sets.intersection(projectTypes, \r\n+\t\t\tnew HashSet<ProjectType>(Arrays.asList(ProjectType.SERVICE_API, ProjectType.IMPL, ProjectType.PROTOBUF, ProjectType.PROXY,\r\n+\t\t\t\tProjectType.DISPATCHER, ProjectType.TEST, ProjectType.SERVER_RUNNER, ProjectType.CLIENT_CONSOLE  \r\n+\t\t\t)))\r\n+\t\t for (projectType : activeProjectTypes)\r","path":"com.btc.serviceidl/src/com/btc/serviceidl/generator/java/JavaGenerator.xtend","position":93,"original_position":93,"commit_id":"1d60f94826fd47f233858adfde48c28fa6fc6eb8","original_commit_id":"1d60f94826fd47f233858adfde48c28fa6fc6eb8","user":{"login":"huttenlocher","id":38097507,"avatar_url":"https://avatars0.githubusercontent.com/u/38097507?v=4","gravatar_id":"","url":"https://api.github.com/users/huttenlocher","html_url":"https://github.com/huttenlocher","followers_url":"https://api.github.com/users/huttenlocher/followers","following_url":"https://api.github.com/users/huttenlocher/following{/other_user}","gists_url":"https://api.github.com/users/huttenlocher/gists{/gist_id}","starred_url":"https://api.github.com/users/huttenlocher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huttenlocher/subscriptions","organizations_url":"https://api.github.com/users/huttenlocher/orgs","repos_url":"https://api.github.com/users/huttenlocher/repos","events_url":"https://api.github.com/users/huttenlocher/events{/privacy}","received_events_url":"https://api.github.com/users/huttenlocher/received_events","type":"User","site_admin":false},"body":"Maybe this loop (lines 154-157) as one single-line statement:\r\n`activeProjectTypes.forEach[ generateProject(it, interface_declaration) ]`","created_at":"2018-04-09T07:32:03Z","updated_at":"2018-04-09T07:32:04Z","html_url":"https://github.com/btc-ag/service-idl/pull/4#discussion_r180008255","pull_request_url":"https://api.github.com/repos/btc-ag/service-idl/pulls/4","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/btc-ag/service-idl/pulls/comments/180008255"},"html":{"href":"https://github.com/btc-ag/service-idl/pull/4#discussion_r180008255"},"pull_request":{"href":"https://api.github.com/repos/btc-ag/service-idl/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/btc-ag/service-idl/pulls/4","id":179687254,"html_url":"https://github.com/btc-ag/service-idl/pull/4","diff_url":"https://github.com/btc-ag/service-idl/pull/4.diff","patch_url":"https://github.com/btc-ag/service-idl/pull/4.patch","issue_url":"https://api.github.com/repos/btc-ag/service-idl/issues/4","number":4,"state":"open","locked":false,"title":"Added some tests for IdlGenerator","user":{"login":"sigiesec","id":16757805,"avatar_url":"https://avatars0.githubusercontent.com/u/16757805?v=4","gravatar_id":"","url":"https://api.github.com/users/sigiesec","html_url":"https://github.com/sigiesec","followers_url":"https://api.github.com/users/sigiesec/followers","following_url":"https://api.github.com/users/sigiesec/following{/other_user}","gists_url":"https://api.github.com/users/sigiesec/gists{/gist_id}","starred_url":"https://api.github.com/users/sigiesec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigiesec/subscriptions","organizations_url":"https://api.github.com/users/sigiesec/orgs","repos_url":"https://api.github.com/users/sigiesec/repos","events_url":"https://api.github.com/users/sigiesec/events{/privacy}","received_events_url":"https://api.github.com/users/sigiesec/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-05T14:06:21Z","updated_at":"2018-04-09T07:32:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b76a2e2fb7f3800cb85edd1c748f7dc206ff6eb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/btc-ag/service-idl/pulls/4/commits","review_comments_url":"https://api.github.com/repos/btc-ag/service-idl/pulls/4/comments","review_comment_url":"https://api.github.com/repos/btc-ag/service-idl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/btc-ag/service-idl/issues/4/comments","statuses_url":"https://api.github.com/repos/btc-ag/service-idl/statuses/1d60f94826fd47f233858adfde48c28fa6fc6eb8","head":{"label":"sigiesec:add-some-tests-2","ref":"add-some-tests-2","sha":"1d60f94826fd47f233858adfde48c28fa6fc6eb8","user":{"login":"sigiesec","id":16757805,"avatar_url":"https://avatars0.githubusercontent.com/u/16757805?v=4","gravatar_id":"","url":"https://api.github.com/users/sigiesec","html_url":"https://github.com/sigiesec","followers_url":"https://api.github.com/users/sigiesec/followers","following_url":"https://api.github.com/users/sigiesec/following{/other_user}","gists_url":"https://api.github.com/users/sigiesec/gists{/gist_id}","starred_url":"https://api.github.com/users/sigiesec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigiesec/subscriptions","organizations_url":"https://api.github.com/users/sigiesec/orgs","repos_url":"https://api.github.com/users/sigiesec/repos","events_url":"https://api.github.com/users/sigiesec/events{/privacy}","received_events_url":"https://api.github.com/users/sigiesec/received_events","type":"User","site_admin":false},"repo":{"id":127883677,"name":"service-idl","full_name":"sigiesec/service-idl","owner":{"login":"sigiesec","id":16757805,"avatar_url":"https://avatars0.githubusercontent.com/u/16757805?v=4","gravatar_id":"","url":"https://api.github.com/users/sigiesec","html_url":"https://github.com/sigiesec","followers_url":"https://api.github.com/users/sigiesec/followers","following_url":"https://api.github.com/users/sigiesec/following{/other_user}","gists_url":"https://api.github.com/users/sigiesec/gists{/gist_id}","starred_url":"https://api.github.com/users/sigiesec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigiesec/subscriptions","organizations_url":"https://api.github.com/users/sigiesec/orgs","repos_url":"https://api.github.com/users/sigiesec/repos","events_url":"https://api.github.com/users/sigiesec/events{/privacy}","received_events_url":"https://api.github.com/users/sigiesec/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sigiesec/service-idl","description":"Xtext-based Service IDL (Interface Definition Language) and Code Generators for Protobuf, C++, Java and .NET","fork":true,"url":"https://api.github.com/repos/sigiesec/service-idl","forks_url":"https://api.github.com/repos/sigiesec/service-idl/forks","keys_url":"https://api.github.com/repos/sigiesec/service-idl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sigiesec/service-idl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sigiesec/service-idl/teams","hooks_url":"https://api.github.com/repos/sigiesec/service-idl/hooks","issue_events_url":"https://api.github.com/repos/sigiesec/service-idl/issues/events{/number}","events_url":"https://api.github.com/repos/sigiesec/service-idl/events","assignees_url":"https://api.github.com/repos/sigiesec/service-idl/assignees{/user}","branches_url":"https://api.github.com/repos/sigiesec/service-idl/branches{/branch}","tags_url":"https://api.github.com/repos/sigiesec/service-idl/tags","blobs_url":"https://api.github.com/repos/sigiesec/service-idl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sigiesec/service-idl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sigiesec/service-idl/git/refs{/sha}","trees_url":"https://api.github.com/repos/sigiesec/service-idl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sigiesec/service-idl/statuses/{sha}","languages_url":"https://api.github.com/repos/sigiesec/service-idl/languages","stargazers_url":"https://api.github.com/repos/sigiesec/service-idl/stargazers","contributors_url":"https://api.github.com/repos/sigiesec/service-idl/contributors","subscribers_url":"https://api.github.com/repos/sigiesec/service-idl/subscribers","subscription_url":"https://api.github.com/repos/sigiesec/service-idl/subscription","commits_url":"https://api.github.com/repos/sigiesec/service-idl/commits{/sha}","git_commits_url":"https://api.github.com/repos/sigiesec/service-idl/git/commits{/sha}","comments_url":"https://api.github.com/repos/sigiesec/service-idl/comments{/number}","issue_comment_url":"https://api.github.com/repos/sigiesec/service-idl/issues/comments{/number}","contents_url":"https://api.github.com/repos/sigiesec/service-idl/contents/{+path}","compare_url":"https://api.github.com/repos/sigiesec/service-idl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sigiesec/service-idl/merges","archive_url":"https://api.github.com/repos/sigiesec/service-idl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sigiesec/service-idl/downloads","issues_url":"https://api.github.com/repos/sigiesec/service-idl/issues{/number}","pulls_url":"https://api.github.com/repos/sigiesec/service-idl/pulls{/number}","milestones_url":"https://api.github.com/repos/sigiesec/service-idl/milestones{/number}","notifications_url":"https://api.github.com/repos/sigiesec/service-idl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sigiesec/service-idl/labels{/name}","releases_url":"https://api.github.com/repos/sigiesec/service-idl/releases{/id}","deployments_url":"https://api.github.com/repos/sigiesec/service-idl/deployments","created_at":"2018-04-03T09:24:42Z","updated_at":"2018-04-03T09:24:44Z","pushed_at":"2018-04-05T14:05:48Z","git_url":"git://github.com/sigiesec/service-idl.git","ssh_url":"git@github.com:sigiesec/service-idl.git","clone_url":"https://github.com/sigiesec/service-idl.git","svn_url":"https://github.com/sigiesec/service-idl","homepage":null,"size":893,"stargazers_count":0,"watchers_count":0,"language":null,"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":"epl-2.0","name":"Eclipse Public License 2.0","spdx_id":"EPL-2.0","url":"https://api.github.com/licenses/epl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"btc-ag:master","ref":"master","sha":"da31433cc97d43f7d231157f6a6c376b1655e81b","user":{"login":"btc-ag","id":29117712,"avatar_url":"https://avatars1.githubusercontent.com/u/29117712?v=4","gravatar_id":"","url":"https://api.github.com/users/btc-ag","html_url":"https://github.com/btc-ag","followers_url":"https://api.github.com/users/btc-ag/followers","following_url":"https://api.github.com/users/btc-ag/following{/other_user}","gists_url":"https://api.github.com/users/btc-ag/gists{/gist_id}","starred_url":"https://api.github.com/users/btc-ag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btc-ag/subscriptions","organizations_url":"https://api.github.com/users/btc-ag/orgs","repos_url":"https://api.github.com/users/btc-ag/repos","events_url":"https://api.github.com/users/btc-ag/events{/privacy}","received_events_url":"https://api.github.com/users/btc-ag/received_events","type":"Organization","site_admin":false},"repo":{"id":127272401,"name":"service-idl","full_name":"btc-ag/service-idl","owner":{"login":"btc-ag","id":29117712,"avatar_url":"https://avatars1.githubusercontent.com/u/29117712?v=4","gravatar_id":"","url":"https://api.github.com/users/btc-ag","html_url":"https://github.com/btc-ag","followers_url":"https://api.github.com/users/btc-ag/followers","following_url":"https://api.github.com/users/btc-ag/following{/other_user}","gists_url":"https://api.github.com/users/btc-ag/gists{/gist_id}","starred_url":"https://api.github.com/users/btc-ag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btc-ag/subscriptions","organizations_url":"https://api.github.com/users/btc-ag/orgs","repos_url":"https://api.github.com/users/btc-ag/repos","events_url":"https://api.github.com/users/btc-ag/events{/privacy}","received_events_url":"https://api.github.com/users/btc-ag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/btc-ag/service-idl","description":"Xtext-based Service IDL (Interface Definition Language) and Code Generators for Protobuf, C++, Java and .NET","fork":false,"url":"https://api.github.com/repos/btc-ag/service-idl","forks_url":"https://api.github.com/repos/btc-ag/service-idl/forks","keys_url":"https://api.github.com/repos/btc-ag/service-idl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/btc-ag/service-idl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/btc-ag/service-idl/teams","hooks_url":"https://api.github.com/repos/btc-ag/service-idl/hooks","issue_events_url":"https://api.github.com/repos/btc-ag/service-idl/issues/events{/number}","events_url":"https://api.github.com/repos/btc-ag/service-idl/events","assignees_url":"https://api.github.com/repos/btc-ag/service-idl/assignees{/user}","branches_url":"https://api.github.com/repos/btc-ag/service-idl/branches{/branch}","tags_url":"https://api.github.com/repos/btc-ag/service-idl/tags","blobs_url":"https://api.github.com/repos/btc-ag/service-idl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/btc-ag/service-idl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/btc-ag/service-idl/git/refs{/sha}","trees_url":"https://api.github.com/repos/btc-ag/service-idl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/btc-ag/service-idl/statuses/{sha}","languages_url":"https://api.github.com/repos/btc-ag/service-idl/languages","stargazers_url":"https://api.github.com/repos/btc-ag/service-idl/stargazers","contributors_url":"https://api.github.com/repos/btc-ag/service-idl/contributors","subscribers_url":"https://api.github.com/repos/btc-ag/service-idl/subscribers","subscription_url":"https://api.github.com/repos/btc-ag/service-idl/subscription","commits_url":"https://api.github.com/repos/btc-ag/service-idl/commits{/sha}","git_commits_url":"https://api.github.com/repos/btc-ag/service-idl/git/commits{/sha}","comments_url":"https://api.github.com/repos/btc-ag/service-idl/comments{/number}","issue_comment_url":"https://api.github.com/repos/btc-ag/service-idl/issues/comments{/number}","contents_url":"https://api.github.com/repos/btc-ag/service-idl/contents/{+path}","compare_url":"https://api.github.com/repos/btc-ag/service-idl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/btc-ag/service-idl/merges","archive_url":"https://api.github.com/repos/btc-ag/service-idl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/btc-ag/service-idl/downloads","issues_url":"https://api.github.com/repos/btc-ag/service-idl/issues{/number}","pulls_url":"https://api.github.com/repos/btc-ag/service-idl/pulls{/number}","milestones_url":"https://api.github.com/repos/btc-ag/service-idl/milestones{/number}","notifications_url":"https://api.github.com/repos/btc-ag/service-idl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/btc-ag/service-idl/labels{/name}","releases_url":"https://api.github.com/repos/btc-ag/service-idl/releases{/id}","deployments_url":"https://api.github.com/repos/btc-ag/service-idl/deployments","created_at":"2018-03-29T09:56:31Z","updated_at":"2018-04-06T09:52:07Z","pushed_at":"2018-04-05T14:06:22Z","git_url":"git://github.com/btc-ag/service-idl.git","ssh_url":"git@github.com:btc-ag/service-idl.git","clone_url":"https://github.com/btc-ag/service-idl.git","svn_url":"https://github.com/btc-ag/service-idl","homepage":null,"size":313,"stargazers_count":2,"watchers_count":2,"language":"Xtend","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"epl-2.0","name":"Eclipse Public License 2.0","spdx_id":"EPL-2.0","url":"https://api.github.com/licenses/epl-2.0"},"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/btc-ag/service-idl/pulls/4"},"html":{"href":"https://github.com/btc-ag/service-idl/pull/4"},"issue":{"href":"https://api.github.com/repos/btc-ag/service-idl/issues/4"},"comments":{"href":"https://api.github.com/repos/btc-ag/service-idl/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/btc-ag/service-idl/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/btc-ag/service-idl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/btc-ag/service-idl/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/btc-ag/service-idl/statuses/1d60f94826fd47f233858adfde48c28fa6fc6eb8"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"huttenlocher"}}