bazel-contrib / rules_jvm_external

Bazel rules to resolve, fetch and export Maven artifacts
Apache License 2.0
336 stars 256 forks source link

Make our extension implementation and tag classes public #1235

Closed shs96c closed 2 months ago

shs96c commented 2 months ago

This allows other people to extend them as necessary, which is useful for meta-rulesets that aggregate other rulesets.

jin commented 2 months ago

Can you provide a bit more context? Are these rulesets re-exporting rules_jvm_external functionality?

shs96c commented 2 months ago

This is useful for users who want to set different default values for attributes of tag classes. The obvious example is that corporate users may want to set install's repositories field to point to their private maven repo and not the public one. The only way to do this right now is to write a new extension, create a custom tag class with the same attributes as upstream, and have users use that.

There may be alternative approaches, such as offering a defaults tag class and populating values from that. In the use case for my employer, we'd do this in a federating ruleset, so the defaults would not be set in the root module, which would complicate things.

jin commented 2 months ago

Thanks for the additional context! Do you think it will be helpful to provide documentation on how users can do that in the README, or even better, code examples that we can put into CI? Not necessary to do so in this change.