{"action":"created","comment":{"url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/comments/198357660","pull_request_review_id":132274459,"id":198357660,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODM1NzY2MA==","diff_hunk":"@@ -32,85 +35,105 @@ def scala_proto_repositories():\n       actual = '@scala_proto_rules_protoc_jar//jar')\n \n   native.maven_jar(\n-      name = \"scala_proto_rules_scalapb_plugin\",\n-      artifact = scala_mvn_artifact(\n-          \"com.trueaccord.scalapb:compilerplugin:0.6.5\"),\n-      sha1 = \"290094c632c95b36b6f66d7dbfdc15242b9a247f\",\n-      server = \"scala_proto_deps_maven_server\",\n+      name = \"scala_proto_rules_scalapb_plugin_2_11\",\n+      artifact = \"com.trueaccord.scalapb:compilerplugin_2.11:0.6.5\",\n+      #server = \"scala_proto_deps_maven_server\",\n+  )\n+  native.maven_jar(\n+      name = \"scala_proto_rules_scalapb_plugin_2_12\",\n+      artifact = \"com.trueaccord.scalapb:compilerplugin_2.12:0.6.5\",\n+      #server = \"scala_proto_deps_maven_server\",\n   )\n \n   native.bind(\n       name = 'io_bazel_rules_scala/dependency/proto/scalapb_plugin',\n-      actual = '@scala_proto_rules_scalapb_plugin//jar')\n+      actual = '@scala_proto_rules_scalapb_plugin_{}//jar'.format(major_version_underscore))\n \n   native.maven_jar(\n-      name = \"scala_proto_rules_protoc_bridge\",\n-      artifact = scala_mvn_artifact(\n-          \"com.trueaccord.scalapb:protoc-bridge:0.3.0-M1\"),\n-      sha1 = \"73d38f045ea8f09cc1264991d1064add6eac9e00\",\n-      server = \"scala_proto_deps_maven_server\",\n+      name = \"scala_proto_rules_protoc_bridge_2_11\",\n+      artifact = \"com.trueaccord.scalapb:protoc-bridge_2.11:0.3.0-M1\",\n+      #server = \"scala_proto_deps_maven_server\",\n+  )\n+  native.maven_jar(\n+      name = \"scala_proto_rules_protoc_bridge_2_12\",\n+      artifact = \"com.trueaccord.scalapb:protoc-bridge_2.12:0.3.0-M1\",\n+      #server = \"scala_proto_deps_maven_server\",","path":"scala_proto/scala_proto.bzl","position":49,"original_position":49,"commit_id":"f9f0cccc28f9e9c84fb0ec419fee88aa56435145","original_commit_id":"f9f0cccc28f9e9c84fb0ec419fee88aa56435145","user":{"login":"johnynek","id":67958,"node_id":"MDQ6VXNlcjY3OTU4","avatar_url":"https://avatars0.githubusercontent.com/u/67958?v=4","gravatar_id":"","url":"https://api.github.com/users/johnynek","html_url":"https://github.com/johnynek","followers_url":"https://api.github.com/users/johnynek/followers","following_url":"https://api.github.com/users/johnynek/following{/other_user}","gists_url":"https://api.github.com/users/johnynek/gists{/gist_id}","starred_url":"https://api.github.com/users/johnynek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnynek/subscriptions","organizations_url":"https://api.github.com/users/johnynek/orgs","repos_url":"https://api.github.com/users/johnynek/repos","events_url":"https://api.github.com/users/johnynek/events{/privacy}","received_events_url":"https://api.github.com/users/johnynek/received_events","type":"User","site_admin":false},"body":"let's just remove it entirely vs comment.","created_at":"2018-06-27T03:33:01Z","updated_at":"2018-06-27T03:36:24Z","html_url":"https://github.com/bazelbuild/rules_scala/pull/544#discussion_r198357660","pull_request_url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/544","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/comments/198357660"},"html":{"href":"https://github.com/bazelbuild/rules_scala/pull/544#discussion_r198357660"},"pull_request":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/544"}}},"pull_request":{"url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/544","id":197577539,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3NTc3NTM5","html_url":"https://github.com/bazelbuild/rules_scala/pull/544","diff_url":"https://github.com/bazelbuild/rules_scala/pull/544.diff","patch_url":"https://github.com/bazelbuild/rules_scala/pull/544.patch","issue_url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/544","number":544,"state":"open","locked":false,"title":"[WIP] Support for selecting scala version","user":{"login":"jhnj","id":18480119,"node_id":"MDQ6VXNlcjE4NDgwMTE5","avatar_url":"https://avatars0.githubusercontent.com/u/18480119?v=4","gravatar_id":"","url":"https://api.github.com/users/jhnj","html_url":"https://github.com/jhnj","followers_url":"https://api.github.com/users/jhnj/followers","following_url":"https://api.github.com/users/jhnj/following{/other_user}","gists_url":"https://api.github.com/users/jhnj/gists{/gist_id}","starred_url":"https://api.github.com/users/jhnj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhnj/subscriptions","organizations_url":"https://api.github.com/users/jhnj/orgs","repos_url":"https://api.github.com/users/jhnj/repos","events_url":"https://api.github.com/users/jhnj/events{/privacy}","received_events_url":"https://api.github.com/users/jhnj/received_events","type":"User","site_admin":false},"body":"Currently the scala version used is hardcoded and e.g. using rules_scala to build 2.12 requires pointing to a \"2.12\" branch. This PR aims to allow users of rules_scala to use any 2.11/2.12 version.\r\n\r\nThe original goal was to allow the user to specify specifc scala versions for specific targets but as\r\nthat would have required more structural changes we decided to focus on a single global Scala version. Due to this I might have made some decisions that don't make sense when just using 1 version.\r\n\r\nThis is tested with some internal Stripe repos.\r\n\r\n### Changes:\r\n\r\n- All deps related to a specific Scala version are passed around in a provider: `ScalacProvider`.\r\nThis could be a toolchain as in https://github.com/bazelbuild/rules_scala/pull/530, provider was\r\nchosen due to \"multiple versions, same workspace\" legacy\r\n\r\n- New scala versions are added using `new_scala_repository`. This will download scala, create a build file for the scalac worker and add all of this to a provider. The build file could be declared statically as well (done dynamically to allow for multiple versions in the future).\r\n\r\n- Both 2.11 and 2.12 versions of libraries (scalatest, scrooge, specs2...) are specified and the correct version is selected using `native.bind`. The versions of Scrooge and scalatest are also bumped as the current ones don't support 2.12.\r\n\r\n- Currently I've only tested it manually for 2.12 on a different branch, to test both 2.11/2.12 requires a new workspace for testing. I've got a partly working wip version of that as well.\r\n\r\n\r\n### Potential problems:\r\nThis PR renames the labels for some scala libraries, e.g. `@scala//:scala-xml` -> `@scala_xml_2_12//jar` which\r\nmight infere with e.g. replacements when using bazel-deps.\r\n```\r\nreplacements:\r\n  org.scala-lang:\r\n    scala-compiler:\r\n      lang: scala/unmangled\r\n      target: \"@scala//:scala-compiler\"\r\n```\r\n\r\n### TODO (maybe):\r\n- Add the ability to select e.g. the typelevel compiler + specify where you want to download scala from\r\n- Multiple scala versions in the same workspace? Create multiple `ScalacProvider`s and override the default to use different versions. Would also require changing some rules to macros\r\n\r\n@johnynek @andyscott @travisbrown ","created_at":"2018-06-26T23:19:20Z","updated_at":"2018-06-27T03:36:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":330860825,"node_id":"MDU6TGFiZWwzMzA4NjA4MjU=","url":"https://api.github.com/repos/bazelbuild/rules_scala/labels/cla:%20no","name":"cla: no","color":"e11d21","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/544/commits","review_comments_url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/544/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/544/comments","statuses_url":"https://api.github.com/repos/bazelbuild/rules_scala/statuses/f9f0cccc28f9e9c84fb0ec419fee88aa56435145","head":{"label":"jhnj:johan/single-scala-version-selectable","ref":"johan/single-scala-version-selectable","sha":"f9f0cccc28f9e9c84fb0ec419fee88aa56435145","user":{"login":"jhnj","id":18480119,"node_id":"MDQ6VXNlcjE4NDgwMTE5","avatar_url":"https://avatars0.githubusercontent.com/u/18480119?v=4","gravatar_id":"","url":"https://api.github.com/users/jhnj","html_url":"https://github.com/jhnj","followers_url":"https://api.github.com/users/jhnj/followers","following_url":"https://api.github.com/users/jhnj/following{/other_user}","gists_url":"https://api.github.com/users/jhnj/gists{/gist_id}","starred_url":"https://api.github.com/users/jhnj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhnj/subscriptions","organizations_url":"https://api.github.com/users/jhnj/orgs","repos_url":"https://api.github.com/users/jhnj/repos","events_url":"https://api.github.com/users/jhnj/events{/privacy}","received_events_url":"https://api.github.com/users/jhnj/received_events","type":"User","site_admin":false},"repo":{"id":138633865,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg2MzM4NjU=","name":"rules_scala","full_name":"jhnj/rules_scala","owner":{"login":"jhnj","id":18480119,"node_id":"MDQ6VXNlcjE4NDgwMTE5","avatar_url":"https://avatars0.githubusercontent.com/u/18480119?v=4","gravatar_id":"","url":"https://api.github.com/users/jhnj","html_url":"https://github.com/jhnj","followers_url":"https://api.github.com/users/jhnj/followers","following_url":"https://api.github.com/users/jhnj/following{/other_user}","gists_url":"https://api.github.com/users/jhnj/gists{/gist_id}","starred_url":"https://api.github.com/users/jhnj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhnj/subscriptions","organizations_url":"https://api.github.com/users/jhnj/orgs","repos_url":"https://api.github.com/users/jhnj/repos","events_url":"https://api.github.com/users/jhnj/events{/privacy}","received_events_url":"https://api.github.com/users/jhnj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhnj/rules_scala","description":"Scala rules for Bazel","fork":true,"url":"https://api.github.com/repos/jhnj/rules_scala","forks_url":"https://api.github.com/repos/jhnj/rules_scala/forks","keys_url":"https://api.github.com/repos/jhnj/rules_scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhnj/rules_scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhnj/rules_scala/teams","hooks_url":"https://api.github.com/repos/jhnj/rules_scala/hooks","issue_events_url":"https://api.github.com/repos/jhnj/rules_scala/issues/events{/number}","events_url":"https://api.github.com/repos/jhnj/rules_scala/events","assignees_url":"https://api.github.com/repos/jhnj/rules_scala/assignees{/user}","branches_url":"https://api.github.com/repos/jhnj/rules_scala/branches{/branch}","tags_url":"https://api.github.com/repos/jhnj/rules_scala/tags","blobs_url":"https://api.github.com/repos/jhnj/rules_scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhnj/rules_scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhnj/rules_scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhnj/rules_scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhnj/rules_scala/statuses/{sha}","languages_url":"https://api.github.com/repos/jhnj/rules_scala/languages","stargazers_url":"https://api.github.com/repos/jhnj/rules_scala/stargazers","contributors_url":"https://api.github.com/repos/jhnj/rules_scala/contributors","subscribers_url":"https://api.github.com/repos/jhnj/rules_scala/subscribers","subscription_url":"https://api.github.com/repos/jhnj/rules_scala/subscription","commits_url":"https://api.github.com/repos/jhnj/rules_scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhnj/rules_scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhnj/rules_scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhnj/rules_scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhnj/rules_scala/contents/{+path}","compare_url":"https://api.github.com/repos/jhnj/rules_scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhnj/rules_scala/merges","archive_url":"https://api.github.com/repos/jhnj/rules_scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhnj/rules_scala/downloads","issues_url":"https://api.github.com/repos/jhnj/rules_scala/issues{/number}","pulls_url":"https://api.github.com/repos/jhnj/rules_scala/pulls{/number}","milestones_url":"https://api.github.com/repos/jhnj/rules_scala/milestones{/number}","notifications_url":"https://api.github.com/repos/jhnj/rules_scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhnj/rules_scala/labels{/name}","releases_url":"https://api.github.com/repos/jhnj/rules_scala/releases{/id}","deployments_url":"https://api.github.com/repos/jhnj/rules_scala/deployments","created_at":"2018-06-25T18:21:57Z","updated_at":"2018-06-25T18:21:59Z","pushed_at":"2018-06-26T18:45:00Z","git_url":"git://github.com/jhnj/rules_scala.git","ssh_url":"git@github.com:jhnj/rules_scala.git","clone_url":"https://github.com/jhnj/rules_scala.git","svn_url":"https://github.com/jhnj/rules_scala","homepage":null,"size":1350,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bazelbuild:master","ref":"master","sha":"3c987b6ae8a453886759b132f1572c0efca2eca2","user":{"login":"bazelbuild","id":11684617,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNjg0NjE3","avatar_url":"https://avatars1.githubusercontent.com/u/11684617?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk1MTkzMDM3OQ==","name":"rules_scala","full_name":"bazelbuild/rules_scala","owner":{"login":"bazelbuild","id":11684617,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNjg0NjE3","avatar_url":"https://avatars1.githubusercontent.com/u/11684617?v=4","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":"2018-06-26T22:44:27Z","pushed_at":"2018-06-26T23:19:21Z","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":1298,"stargazers_count":130,"watchers_count":130,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"archived":false,"open_issues_count":121,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":94,"open_issues":121,"watchers":130,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/544"},"html":{"href":"https://github.com/bazelbuild/rules_scala/pull/544"},"issue":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/issues/544"},"comments":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/issues/544/comments"},"review_comments":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/544/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/544/commits"},"statuses":{"href":"https://api.github.com/repos/bazelbuild/rules_scala/statuses/f9f0cccc28f9e9c84fb0ec419fee88aa56435145"}},"author_association":"NONE"}}
{"actor":{"display_login":"johnynek"}}