-
-
Notifications
You must be signed in to change notification settings - Fork 287
Use a public java_compile_toolchain attr instead of _java_toolchain #1389
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
Conversation
…chain Co-authored-by: Shane Delmore <[email protected]>
wisechengyi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Shane and Win!
| scala_junit_test( | ||
| name = "CheckBytecodeMajorVersion", | ||
| srcs = ["CheckBytecodeMajorVersionTest.scala"], | ||
| suffixes = ["Test"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for my learning, is suffixes significant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is necessary for scala_junit_test to discover test classes. Specifically one of prefixes or suffixes is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh ok thanks! not blocking, but if there's a default pattern to follow, then this declaration can be further simplified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there isn't a default so we must manually specify 😞
|
|
||
| Assert.assertTrue( | ||
| s"Expected java 8 (major version 52) but got major version $expectJava8", | ||
| majorVersionToJdkVersion(expectJava8) == 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: here and below using assertEquals is more idiomatic in junit. Eg.:
assertEquals(
"Must be Java 8 (major version 52) bytecode",
8,
majorVersionToJdkVersion(expectJava8)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed, thanks!
|
Thanks, @wiwa! |
Description
Allow per-target selection of Java compilation toolchain.
Note: This change doesn't add similar functionality to
thrift_library.Motivation
Helps with JDK migrations by allowing targets to incrementally update.
Also allows targets to opt into newer Java syntax.
Co-authored-by: Shane Delmore [email protected]