{"action":"created","comment":{"url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/comments/61265972","id":61265972,"diff_hunk":"@@ -0,0 +1,269 @@\n+_jar_filetype = FileType([\".jar\"])\n+\n+load(\"//scala:scala.bzl\",\n+  \"scala_mvn_artifact\",\n+  \"scala_library\",\n+  \"write_manifest\",\n+  \"implicit_deps\",\n+  \"collect_srcjars\")\n+\n+def twitter_scrooge():\n+  native.maven_jar(\n+    name = \"libthrift\",\n+    artifact = \"org.apache.thrift:libthrift:0.8.0\",\n+    sha1 = \"2203b4df04943f4d52c53b9608cef60c08786ef2\",\n+  )\n+  native.maven_jar(\n+    name = \"scrooge_core\",\n+    artifact = scala_mvn_artifact(\"com.twitter:scrooge-core:4.6.0\"),\n+    sha1 = \"84b86c2e082aba6e0c780b3c76281703b891a2c8\",\n+  )\n+\n+  #scrooge-generator related dependencies\n+  native.maven_jar(\n+    name = \"scrooge_generator\",\n+    artifact = scala_mvn_artifact(\"com.twitter:scrooge-generator:4.6.0\"),\n+    sha1 = \"cacf72eedeb5309ca02b2d8325c587198ecaac82\",\n+  )\n+  native.maven_jar(\n+    name = \"scopt\",\n+    artifact = scala_mvn_artifact(\"com.github.scopt:scopt:3.3.0\"),\n+    sha1 = \"9e6fb062b2f12a7945b9f38ee54784aee7edde20\",\n+  )\n+  native.maven_jar(\n+    name = \"util_core\",\n+    artifact = scala_mvn_artifact(\"com.twitter:util-core:6.33.0\"),\n+    sha1 = \"bb49fa66a3ca9b7db8cd764d0b26ce498bbccc83\",\n+  )\n+  native.maven_jar(\n+    name = \"util_logging\",\n+    artifact = scala_mvn_artifact(\"com.twitter:util-logging:6.33.0\"),\n+    sha1 = \"3d28e46f8ee3b7ad1b98a51b98089fc01c9755dd\",\n+  )\n+\n+def _collect_transitive_srcs(targets):\n+  r = set()\n+  for target in targets:\n+    if hasattr(target, \"thrift\"):\n+      r += target.thrift.transitive_srcs\n+  return r\n+\n+def _collect_owned_srcs(targets):\n+  r = set()\n+  for _target in targets:\n+    if hasattr(_target, \"extra_information\"):\n+      for target in _target.extra_information:\n+        if hasattr(target, \"scrooge_srcjar\"):\n+          r += target.scrooge_srcjar.transitive_owned_srcs\n+  return r\n+\n+def collect_extra_srcjars(targets):\n+  srcjars = set()\n+  for target in targets:\n+    if hasattr(target, \"extra_information\"):\n+      for _target in target.extra_information:\n+        srcjars += [_target.srcjars.srcjar]\n+        srcjars += _target.srcjars.transitive_srcjars\n+  return srcjars\n+\n+def _collect_immediate_srcs(targets):\n+  r = set()\n+  for target in targets:\n+    if hasattr(target, \"thrift\"):\n+      r += [target.thrift.srcs]\n+  return r\n+\n+def _assert_set_is_subset(left, right):\n+  missing = set()\n+  for l in left:\n+    if l not in right:\n+      missing += [l]\n+  if len(missing) > 0:\n+    fail('scrooge_srcjar target must depend on scrooge_srcjar targets sufficient to ' +\n+         'cover the transitive graph of thrift files. Uncovered sources: ' + missing)\n+\n+def _content_newline(data):","path":"twitter_scrooge/twitter_scrooge.bzl","position":85,"original_position":85,"commit_id":"e294aea83a22e988a3318bac4f05220ac89a2f67","original_commit_id":"e294aea83a22e988a3318bac4f05220ac89a2f67","user":{"login":"jcoveney","id":830087,"avatar_url":"https://avatars.githubusercontent.com/u/830087?v=3","gravatar_id":"","url":"https://api.github.com/users/jcoveney","html_url":"https://github.com/jcoveney","followers_url":"https://api.github.com/users/jcoveney/followers","following_url":"https://api.github.com/users/jcoveney/following{/other_user}","gists_url":"https://api.github.com/users/jcoveney/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoveney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoveney/subscriptions","organizations_url":"https://api.github.com/users/jcoveney/orgs","repos_url":"https://api.github.com/users/jcoveney/repos","events_url":"https://api.github.com/users/jcoveney/events{/privacy}","received_events_url":"https://api.github.com/users/jcoveney/received_events","type":"User","site_admin":false},"body":"#namingthingsishard","created_at":"2016-04-27T14:24:40Z","updated_at":"2016-04-27T14:24:40Z","html_url":"https://github.com/bazelbuild/rules_scala/pull/29#discussion_r61265972","pull_request_url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/comments/61265972"},"html":{"href":"https://github.com/bazelbuild/rules_scala/pull/29#discussion_r61265972"},"pull_request":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/29","id":66252254,"html_url":"https://github.com/bazelbuild/rules_scala/pull/29","diff_url":"https://github.com/bazelbuild/rules_scala/pull/29.diff","patch_url":"https://github.com/bazelbuild/rules_scala/pull/29.patch","issue_url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/29","number":29,"state":"open","locked":false,"title":"Add scrooge support","user":{"login":"jcoveney","id":830087,"avatar_url":"https://avatars.githubusercontent.com/u/830087?v=3","gravatar_id":"","url":"https://api.github.com/users/jcoveney","html_url":"https://github.com/jcoveney","followers_url":"https://api.github.com/users/jcoveney/followers","following_url":"https://api.github.com/users/jcoveney/following{/other_user}","gists_url":"https://api.github.com/users/jcoveney/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoveney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoveney/subscriptions","organizations_url":"https://api.github.com/users/jcoveney/orgs","repos_url":"https://api.github.com/users/jcoveney/repos","events_url":"https://api.github.com/users/jcoveney/events{/privacy}","received_events_url":"https://api.github.com/users/jcoveney/received_events","type":"User","site_admin":false},"body":"Ok, there is a LOT to be desired here... there are a ton of TODOS\r\n\r\nBUT IT WORKS\r\n\r\nI currently have a project which has two thrift files which depend on each other, BUILDS for them, and then a scala_library which depends on that and the thrifts...it builds. My guess is right now transitive stuff will not work.\r\n\r\nSo my immediate first goal is to make a test directory with some thrifts and some stuff that depends on them, to make sure that transitive stuff works properly.\r\n\r\nAfter that is just...making it less crazy. I really, really need the guidance of people who have done this... I will put a microscope to everything I did, but I'm finding the \"throw structs around with attributes! oh some attributes are missing!\" to really resist abstraction and promote hacks...\r\n\r\nBut it works :) so I will do the above, hopefully refactor with guidance and time, and then will try it on one of our internal repositories.\r\n\r\nOne thing that I would like to put off, though, is moving it into different files etc. Right now I want to just make sure that we get the flow of everything down properly.","created_at":"2016-04-13T01:07:10Z","updated_at":"2016-04-27T14:24:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9b099239df5873f6bc4c877b9a032ebed09d3b2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/29/commits","review_comments_url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/29/comments","review_comment_url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/29/comments","statuses_url":"https://api.github.com/repos/bazelbuild/rules_scala/statuses/e294aea83a22e988a3318bac4f05220ac89a2f67","head":{"label":"jcoveney:jco/scrooge","ref":"jco/scrooge","sha":"e294aea83a22e988a3318bac4f05220ac89a2f67","user":{"login":"jcoveney","id":830087,"avatar_url":"https://avatars.githubusercontent.com/u/830087?v=3","gravatar_id":"","url":"https://api.github.com/users/jcoveney","html_url":"https://github.com/jcoveney","followers_url":"https://api.github.com/users/jcoveney/followers","following_url":"https://api.github.com/users/jcoveney/following{/other_user}","gists_url":"https://api.github.com/users/jcoveney/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoveney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoveney/subscriptions","organizations_url":"https://api.github.com/users/jcoveney/orgs","repos_url":"https://api.github.com/users/jcoveney/repos","events_url":"https://api.github.com/users/jcoveney/events{/privacy}","received_events_url":"https://api.github.com/users/jcoveney/received_events","type":"User","site_admin":false},"repo":{"id":56096867,"name":"rules_scala","full_name":"jcoveney/rules_scala","owner":{"login":"jcoveney","id":830087,"avatar_url":"https://avatars.githubusercontent.com/u/830087?v=3","gravatar_id":"","url":"https://api.github.com/users/jcoveney","html_url":"https://github.com/jcoveney","followers_url":"https://api.github.com/users/jcoveney/followers","following_url":"https://api.github.com/users/jcoveney/following{/other_user}","gists_url":"https://api.github.com/users/jcoveney/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoveney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoveney/subscriptions","organizations_url":"https://api.github.com/users/jcoveney/orgs","repos_url":"https://api.github.com/users/jcoveney/repos","events_url":"https://api.github.com/users/jcoveney/events{/privacy}","received_events_url":"https://api.github.com/users/jcoveney/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jcoveney/rules_scala","description":"Scala rules for Bazel","fork":true,"url":"https://api.github.com/repos/jcoveney/rules_scala","forks_url":"https://api.github.com/repos/jcoveney/rules_scala/forks","keys_url":"https://api.github.com/repos/jcoveney/rules_scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcoveney/rules_scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcoveney/rules_scala/teams","hooks_url":"https://api.github.com/repos/jcoveney/rules_scala/hooks","issue_events_url":"https://api.github.com/repos/jcoveney/rules_scala/issues/events{/number}","events_url":"https://api.github.com/repos/jcoveney/rules_scala/events","assignees_url":"https://api.github.com/repos/jcoveney/rules_scala/assignees{/user}","branches_url":"https://api.github.com/repos/jcoveney/rules_scala/branches{/branch}","tags_url":"https://api.github.com/repos/jcoveney/rules_scala/tags","blobs_url":"https://api.github.com/repos/jcoveney/rules_scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcoveney/rules_scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcoveney/rules_scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcoveney/rules_scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcoveney/rules_scala/statuses/{sha}","languages_url":"https://api.github.com/repos/jcoveney/rules_scala/languages","stargazers_url":"https://api.github.com/repos/jcoveney/rules_scala/stargazers","contributors_url":"https://api.github.com/repos/jcoveney/rules_scala/contributors","subscribers_url":"https://api.github.com/repos/jcoveney/rules_scala/subscribers","subscription_url":"https://api.github.com/repos/jcoveney/rules_scala/subscription","commits_url":"https://api.github.com/repos/jcoveney/rules_scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcoveney/rules_scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcoveney/rules_scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcoveney/rules_scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcoveney/rules_scala/contents/{+path}","compare_url":"https://api.github.com/repos/jcoveney/rules_scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcoveney/rules_scala/merges","archive_url":"https://api.github.com/repos/jcoveney/rules_scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcoveney/rules_scala/downloads","issues_url":"https://api.github.com/repos/jcoveney/rules_scala/issues{/number}","pulls_url":"https://api.github.com/repos/jcoveney/rules_scala/pulls{/number}","milestones_url":"https://api.github.com/repos/jcoveney/rules_scala/milestones{/number}","notifications_url":"https://api.github.com/repos/jcoveney/rules_scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcoveney/rules_scala/labels{/name}","releases_url":"https://api.github.com/repos/jcoveney/rules_scala/releases{/id}","deployments_url":"https://api.github.com/repos/jcoveney/rules_scala/deployments","created_at":"2016-04-12T20:51:15Z","updated_at":"2016-04-12T20:51:17Z","pushed_at":"2016-04-26T20:31:55Z","git_url":"git://github.com/jcoveney/rules_scala.git","ssh_url":"git@github.com:jcoveney/rules_scala.git","clone_url":"https://github.com/jcoveney/rules_scala.git","svn_url":"https://github.com/jcoveney/rules_scala","homepage":null,"size":130,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"bazelbuild:master","ref":"master","sha":"3a087688fd121e523c65a12efc6cc755491aa7b2","user":{"login":"bazelbuild","id":11684617,"avatar_url":"https://avatars.githubusercontent.com/u/11684617?v=3","gravatar_id":"","url":"https://api.github.com/users/bazelbuild","html_url":"https://github.com/bazelbuild","followers_url":"https://api.github.com/users/bazelbuild/followers","following_url":"https://api.github.com/users/bazelbuild/following{/other_user}","gists_url":"https://api.github.com/users/bazelbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/bazelbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazelbuild/subscriptions","organizations_url":"https://api.github.com/users/bazelbuild/orgs","repos_url":"https://api.github.com/users/bazelbuild/repos","events_url":"https://api.github.com/users/bazelbuild/events{/privacy}","received_events_url":"https://api.github.com/users/bazelbuild/received_events","type":"Organization","site_admin":false},"repo":{"id":51930379,"name":"rules_scala","full_name":"bazelbuild/rules_scala","owner":{"login":"bazelbuild","id":11684617,"avatar_url":"https://avatars.githubusercontent.com/u/11684617?v=3","gravatar_id":"","url":"https://api.github.com/users/bazelbuild","html_url":"https://github.com/bazelbuild","followers_url":"https://api.github.com/users/bazelbuild/followers","following_url":"https://api.github.com/users/bazelbuild/following{/other_user}","gists_url":"https://api.github.com/users/bazelbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/bazelbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazelbuild/subscriptions","organizations_url":"https://api.github.com/users/bazelbuild/orgs","repos_url":"https://api.github.com/users/bazelbuild/repos","events_url":"https://api.github.com/users/bazelbuild/events{/privacy}","received_events_url":"https://api.github.com/users/bazelbuild/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bazelbuild/rules_scala","description":"Scala rules for Bazel","fork":false,"url":"https://api.github.com/repos/bazelbuild/rules_scala","forks_url":"https://api.github.com/repos/bazelbuild/rules_scala/forks","keys_url":"https://api.github.com/repos/bazelbuild/rules_scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bazelbuild/rules_scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bazelbuild/rules_scala/teams","hooks_url":"https://api.github.com/repos/bazelbuild/rules_scala/hooks","issue_events_url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/events{/number}","events_url":"https://api.github.com/repos/bazelbuild/rules_scala/events","assignees_url":"https://api.github.com/repos/bazelbuild/rules_scala/assignees{/user}","branches_url":"https://api.github.com/repos/bazelbuild/rules_scala/branches{/branch}","tags_url":"https://api.github.com/repos/bazelbuild/rules_scala/tags","blobs_url":"https://api.github.com/repos/bazelbuild/rules_scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bazelbuild/rules_scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bazelbuild/rules_scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/bazelbuild/rules_scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bazelbuild/rules_scala/statuses/{sha}","languages_url":"https://api.github.com/repos/bazelbuild/rules_scala/languages","stargazers_url":"https://api.github.com/repos/bazelbuild/rules_scala/stargazers","contributors_url":"https://api.github.com/repos/bazelbuild/rules_scala/contributors","subscribers_url":"https://api.github.com/repos/bazelbuild/rules_scala/subscribers","subscription_url":"https://api.github.com/repos/bazelbuild/rules_scala/subscription","commits_url":"https://api.github.com/repos/bazelbuild/rules_scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/bazelbuild/rules_scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/bazelbuild/rules_scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/bazelbuild/rules_scala/contents/{+path}","compare_url":"https://api.github.com/repos/bazelbuild/rules_scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bazelbuild/rules_scala/merges","archive_url":"https://api.github.com/repos/bazelbuild/rules_scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bazelbuild/rules_scala/downloads","issues_url":"https://api.github.com/repos/bazelbuild/rules_scala/issues{/number}","pulls_url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls{/number}","milestones_url":"https://api.github.com/repos/bazelbuild/rules_scala/milestones{/number}","notifications_url":"https://api.github.com/repos/bazelbuild/rules_scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bazelbuild/rules_scala/labels{/name}","releases_url":"https://api.github.com/repos/bazelbuild/rules_scala/releases{/id}","deployments_url":"https://api.github.com/repos/bazelbuild/rules_scala/deployments","created_at":"2016-02-17T14:57:24Z","updated_at":"2016-04-26T14:45:12Z","pushed_at":"2016-04-27T01:54:00Z","git_url":"git://github.com/bazelbuild/rules_scala.git","ssh_url":"git@github.com:bazelbuild/rules_scala.git","clone_url":"https://github.com/bazelbuild/rules_scala.git","svn_url":"https://github.com/bazelbuild/rules_scala","homepage":null,"size":122,"stargazers_count":26,"watchers_count":26,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":16,"forks":10,"open_issues":16,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/29"},"html":{"href":"https://github.com/bazelbuild/rules_scala/pull/29"},"issue":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/issues/29"},"comments":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/statuses/e294aea83a22e988a3318bac4f05220ac89a2f67"}}}}