-
Notifications
You must be signed in to change notification settings - Fork 165
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 kt_jvm_proto_helper as individual rule. #396
Conversation
This allows the BUILD file to have separate java proto and kt proto rules in case there is a mix of java and proto projects in the same repo, and there are stricter requirement to the output (e.g. leaner dependency chains, smaller binaries for pure-java outputs etc.). This also bypasses an issue in the other rules where the kt_jvm_*_library would compile the whole dependency chain to kotlin, and if the bazel repo is large with many proto dependencies, an can easily end up caching all of these when containing the same classes. If only some of these are refreshed / synced on changes you can easily end up with an IDE claiming your new fields still dont' exist, or removed classes are still there etc.
I agree with the basic premise of this change - it should be possible to pass a proto's That said, I'm not sure I agree with the approach in this pull request. The Instead of creating a new rule the existing rule could be amended to gain this additional functionality. For example, a new attribute Let me know what you think! |
I decided to not update the existing rule for the reason you mention there, that it's tricky to update the rule without breaking anything. It should have supported this from the start, though overloading the rule to behave differently based on arguments sounds also fishy to me. Options:
Personally I would prefer no.2 (less work for me) :-p . |
Different code generation and argument handling. Ignore comment... |
For updating the |
Which makes btth kr_proto and kt_grpc helper functions.
I renamed the rule to add _library to it, and I added kt_jvm_grpc-*. I'm starting to be pretty certain not to change the existing rules:
PS: Note that I'm just going on vacation, so response times may be varying, though I will check in once in a while with the progress of this PR. |
NOTE: If I don't get feedback on this before I'm back from christmas vacation (early/mid January), I will close this PR assuming it's not wanted. No point in keeping it open forever. |
Apologies for the huge delay here, this fell off my radar. I'm still not a fan of the |
@steineldar WDYT? |
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.
LGTM: 👍🏻 I'm fine with going for this. Not super happy with the naming, but I'll go with this if you don't like my "helper" naming.
AFAICS the parameter naming between kt_jvm_proto_library
and kt_jvm_grpc_no_java_library
seems consistent enough, which is the important part here IMO.
So are we good with this as-is or does it need more before we merge? |
This allows the BUILD file to have separate java proto and kt proto rules in case there is a mix of java and proto projects in the same repo, and there are stricter requirement to the output (e.g. leaner dependency chains, smaller binaries for pure-java outputs etc.).
This also bypasses an issue in the other rules where the kt_jvm_*_library would compile the whole dependency chain to kotlin, and if the bazel repo is large with many proto dependencies, an can easily end up caching all of these when containing the same classes. If only some of these are refreshed / synced on changes you can easily end up with an IDE claiming your new fields still dont' exist, or removed classes are still there etc.