Skip to content
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

Add javaOutputVersion to ScalacOptions for scala >= 3.1.2 #122

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

channingwalton
Copy link

@channingwalton channingwalton commented May 9, 2024

Scala 3.1.2 renamed -release to -java-output-version. See blog.

I'm not very confident that this PR is right but, WDYT?

/** Compile for a specific version of the Java platform. Supported targets: 8, 9, ..., 17, 18.
*
* The release flag is supported only on JDK 9 and above, since it relies on the functionality
* provided in [[http://openjdk.java.net/jeps/247 JEP-247: Compile for Older Platform Versions]].
*/
@deprecated("Use javaOutputVersion instead", "3.1.2")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This need to be removed and instead the line below:

version => JavaMajorVersion.javaMajorVersion >= 9 && version >= V2_12_5

needs to be changed to:

version => JavaMajorVersion.javaMajorVersion >= 9 && version >= V2_12_5 && version < V3_1_2

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe not since there is an alias for backcompat?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I've made those changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@satorg No rush but maybe we could look into this before cutting a release?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it should be:

version => JavaMajorVersion.javaMajorVersion >= 9 && version.between(V2_12_5, V3_1_2)

But again not sure if we should disable it yet because that flag is still working. Any opinion @TonioGela @satorg @armanbilge?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok fixed, but I take your point about disabling or not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if We disable this for scala > 3.1.2, it may cause some suprise for users as it takes no effect. So, I think We should not disable it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, let's keep it then. People will get the warning if there is one and we can remove it once the compiler removes it.

lenguyenthanh
lenguyenthanh previously approved these changes Sep 14, 2024
Copy link
Member

@lenguyenthanh lenguyenthanh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good improvement, thanks!

@lenguyenthanh lenguyenthanh dismissed their stale review September 14, 2024 17:04

I didn't see the discussion :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants