-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Adding 'Options'? #54
Comments
There used to be a similar option in the original rules_proto, but it was removed when moving to aspect based compilation. It's been a while since I looked at exactly why, but IIRC it is to do with aspects only being able to see string arguments. So it would have to become one of the following two options:
The second would be nicer, as users wouldn't need to know how to merge the options. The current 'recommendation' (which I agree sucks) is to copy and update the plugin definition to your local workspace and then also copy the relevant |
Second option would be nicer indeed. The problem is that unlike If I'm following the |
Ahh, that’s the bit I was forgetting and the reason the option was dropped. In which case, there’s not a lot we can do to improve the situation until aspects are allowed more freedom with arguments. See bazelbuild/bazel#8494 You may be able to put the attr on the target, but again there may be issues with that route the I’m not remembering. |
It's a problem only with public attributes. I can easily set
What do you mean by that? the
It's a bit more complex than that if I understand correctly? the rule is being referenced in the build file like so:
It means that I have to own a copy of EDIT: I ended up modifying the Thanks! :-) |
Added as part of upcoming 3.0.0: #106 You can now do: python_proto_compile(
name = "person_python_proto",
protos = ["@rules_proto_grpc//example/proto:person_proto"],
options = {
"@rules_proto_grpc//python:python_plugin": ["some_opt"], # <- Applies to specific plugin
}
) or python_proto_compile(
name = "person_python_proto",
protos = ["@rules_proto_grpc//example/proto:person_proto"],
options = {
"*": ["some_opt"], # <- Applied to all plugins in rule
}
) |
Is there a way to add 'Options' to a plug-in without modifying the project's BUILD file? Passing it as argument when defining the rule? was thinking about something like that:
We need to use
java_conversions
here, but I'm not completely OK with adding it to the scala BUILD file, as while it's very popular, not all user will want to use it.Thanks.
The text was updated successfully, but these errors were encountered: