summaryrefslogtreecommitdiff
path: root/scripts/gen-kotlin-build-file.py
diff options
context:
space:
mode:
author Vinh Tran <vinhdaitran@google.com> 2022-09-21 17:01:49 -0400
committer Vinh Tran <vinhdaitran@google.com> 2022-09-22 08:57:14 -0400
commitf19b65880367c4c283299704eaf135db6aaf1515 (patch)
tree4ebd8dfcae720348f13085b5e8096f9830b18f77 /scripts/gen-kotlin-build-file.py
parent94a0373f1ef92d590312cbfa2d3551d04c886c06 (diff)
bp2build to convert $(genDir) to $(RULEDIR) in genrule's cmd
`statslog.cpp` with cmd `"$(location stats-log-api-gen) --cpp $(genDir)/statslog.cpp"` produces `out/.intermediates/frameworks/proto_logging/stats/stats_log_api_gen/statslog.cpp/gen/statslog.cpp`. Hence, $(genDir) is equivalent to `<package-dir>/<module-name>/gen`. Currently, bp2buld converts `$(genDir)` to `$(GENDIR)`. In Bazel, `$(GENDIR)` is only the base of the generated code (e.g. `bazel-bin`). ``` genrule( name = "statslog.cpp", cmd = "$(location :stats-log-api-gen) --cpp $(GENDIR)/statslog.cpp", outs = ["statslog.cpp"], tools = [":stats-log-api-gen"], ) ``` produces `bazel-bin/statslog.cpp` but expects to have `bazel-bin/frameworks/proto_logging/stats/stats_log_api_gen/statslog.cpp`. By converting to `$(RULEDIR)` which is `bazel-bin/frameworks/proto_logging/stats/stats_log_api_gen`. There had not been any genrule module allowlisted with genDir yet. So this should not cause any issue with modules converted before this CL. Bug: 247536535 Test: go tests Test: presubmit builds and tests Change-Id: I65c6aafadab6b180b7ef700427e041547ae7e98a
Diffstat (limited to 'scripts/gen-kotlin-build-file.py')
0 files changed, 0 insertions, 0 deletions