-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always set JVM 8 target in Scala compiler #1524
Conversation
Generate changelog in
|
041b962
to
cb16c0b
Compare
Scala 2.11 still requires it so either you have to drop it or just set it to 1.8 |
True, it defaults to Java 6 in 2.11.12. |
I went with always setting the target to 8 as I don't find a straight-forward way to get the Scala version and offer a target based on that. Personally, I'd still prefer to not have this here. I don't think we need to support 2.11. And if this happens to fail anyone, they can configure the right target themselves. |
I think setting it to target 1.8 is correct for now and we can remove it once we are sure we don't need scala 2.11 👍 |
Also would appreciate a release. This is blocking source compatibility bumps 🙏 |
Failed to load project - please reach out to #dev-foundry-infra or check Aries to debug |
I think the changelog is malformed. changelog/@unreleased/pr-1524.yml should be changelog/@unreleased/pr-1524.v2.yml |
Contributors can't edit the changelog-app message. |
Will file PR. |
@rshkv you shouldn't have to fork if you're part of the palantir org. then you can edit the msg. |
I'm part of the org but can't push to this repo. |
Before this PR
Projects with gradle-baseline cannot compile Scala code if they set Java targetCompatibility to 11. The error is:
BaselineScalaStyle sets scalac
-target
to match that of javac. However scalac 2.12 only accepts target values up-tojvm-8
(see here). Scala version 2.13 supports higher targets, but 2.12 was released July this year and we still need to support it.After this PR
Edit:
No longer set target version for Scala compiler to match that of Java compiler.==COMMIT_MSG==
Always set target version for Scala compiler to JVM 8.
==COMMIT_MSG==
Possible downsides?
If using scalac 2.13 (which permits
jvm-9+
), this change can result in a lower target version. I don't think that's dangerous but might be overlooking something.jvm-7
and lower are disallowed by 2.12 - they wouldn't have been valid targets before. The last 2.11 version was released in 2016.