{"action":"created","issue":{"url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/563","repository_url":"https://api.github.com/repos/bazelbuild/rules_scala","labels_url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/563/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/563/comments","events_url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/563/events","html_url":"https://github.com/bazelbuild/rules_scala/pull/563","id":342102136,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMDg0Mjgx","number":563,"title":"Make jarcreator compile with older java versions","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},"labels":[{"id":330860803,"node_id":"MDU6TGFiZWwzMzA4NjA4MDM=","url":"https://api.github.com/repos/bazelbuild/rules_scala/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-17T21:51:22Z","updated_at":"2018-07-18T06:15:51Z","closed_at":"2018-07-18T04:57:06Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/bazelbuild/rules_scala/pulls/563","html_url":"https://github.com/bazelbuild/rules_scala/pull/563","diff_url":"https://github.com/bazelbuild/rules_scala/pull/563.diff","patch_url":"https://github.com/bazelbuild/rules_scala/pull/563.patch"},"body":"I was updating a repo that was using an older 2.12 branch to the newest rules_scala and our CI failed with:\r\n```\r\n...\r\nio_bazel_rules_scala/src/java/io/bazel/rulesscala/jar/JarCreator.java:125: error: local variable directory is accessed from within inner class; needs to be declared final\r\n              if (!path.equals(directory)) {\r\n                               ^\r\n``` \r\n\r\n`JarCreator.java` compiles only with java 1.8 (and effectively final), this PR makes it work for older versions as well.\r\n\r\nThe alternative is to add\r\n```\r\n    javacopts = [\r\n        \"-source 1.8\",\r\n        \"-target 1.8\",\r\n    ],\r\n```\r\nto the targets in `src/java/io/bazel/rulesscala/jar/BUILD`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/comments/405821150","html_url":"https://github.com/bazelbuild/rules_scala/pull/563#issuecomment-405821150","issue_url":"https://api.github.com/repos/bazelbuild/rules_scala/issues/563","id":405821150,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTgyMTE1MA==","user":{"login":"ittaiz","id":1378327,"node_id":"MDQ6VXNlcjEzNzgzMjc=","avatar_url":"https://avatars2.githubusercontent.com/u/1378327?v=4","gravatar_id":"","url":"https://api.github.com/users/ittaiz","html_url":"https://github.com/ittaiz","followers_url":"https://api.github.com/users/ittaiz/followers","following_url":"https://api.github.com/users/ittaiz/following{/other_user}","gists_url":"https://api.github.com/users/ittaiz/gists{/gist_id}","starred_url":"https://api.github.com/users/ittaiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ittaiz/subscriptions","organizations_url":"https://api.github.com/users/ittaiz/orgs","repos_url":"https://api.github.com/users/ittaiz/repos","events_url":"https://api.github.com/users/ittaiz/events{/privacy}","received_events_url":"https://api.github.com/users/ittaiz/received_events","type":"User","site_admin":false},"created_at":"2018-07-18T06:15:51Z","updated_at":"2018-07-18T06:15:51Z","author_association":"MEMBER","body":"I think the better approach might be to create a default_java_toolchain\nwhich specifies these since they are global.\nThat’s what we do internally\nOn Wed, 18 Jul 2018 at 7:57 Johan Jern <notifications@github.com> wrote:\n\n> @ittaiz <https://github.com/ittaiz> Looked a bit more into it and\n> realized why we were running java 7 on CI (not intentional) for this\n> specific repo and thus we can close this PR. I'd rather use java 8 than\n> support 6/7, especially if bazel itself already uses that.\n>\n> I'll close this, should I create a PR adding\n>\n>     javacopts = [\n>         \"-source 1.8\",\n>         \"-target 1.8\",\n>     ],\n>\n> to all java rules to force them to use java 8 or is just leaving them as\n> is enough?\n>\n> —\n> You are receiving this because you were mentioned.\n>\n>\n> Reply to this email directly, view it on GitHub\n> <https://github.com/bazelbuild/rules_scala/pull/563#issuecomment-405808933>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ABUIF2AqSJOy6WPZ8ooReQkNgx2XPqkhks5uHsAigaJpZM4VTnqz>\n> .\n>\n"}}
{"actor":{"display_login":"ittaiz"}}