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

Move microgenerator invocations to Bazel rules #14448

Open
coryan opened this issue Jul 9, 2024 · 0 comments
Open

Move microgenerator invocations to Bazel rules #14448

coryan opened this issue Jul 9, 2024 · 0 comments
Labels
type: cleanup An internal cleanup or hygiene concern.

Comments

@coryan
Copy link
Contributor

coryan commented Jul 9, 2024

We use scripts to invoke the microgenerator via Bazel, for example:

bazel run --action_env=GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes \
//generator:google-cloud-cpp-codegen -- \
--protobuf_proto_path="${bazel_output_base}/external/protobuf~/src" \
--googleapis_proto_path="${bazel_output_base}/external/googleapis~" \
--golden_proto_path="${PWD}" \
--output_path="${PWD}" \
--update_ci=false \
--config_file="${PWD}/generator/integration_tests/golden_config.textproto"

It seems that kind of code really belongs in some kind of genrule() or a custom rule. There are many hard-coded magic strings in that call that can be converted to Label(). That returns a Label object with all kinds of goodies: https://bazel.build/rules/lib/builtins/Label.html

@coryan coryan added the type: cleanup An internal cleanup or hygiene concern. label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

No branches or pull requests

1 participant