aboutsummaryrefslogtreecommitdiff
path: root/rules/gensrcs.bzl
diff options
context:
space:
mode:
authorVinh Tran <vinhdaitran@google.com>2022-05-27 20:11:17 -0400
committerVinh Tran <vinhdaitran@google.com>2022-05-31 19:36:30 -0400
commitc5183c2a688f3aa1fe9375e790a138b68ea8fc43 (patch)
treea20c736f409ab5631ef7bd1cad7feab36d4e0ff6 /rules/gensrcs.bzl
parente4b89c93b37a215316d7bbdc537934873e505ea2 (diff)
downloadbazel-c5183c2a688f3aa1fe9375e790a138b68ea8fc43.tar.gz
Expand $(GENDIR) to ctx.var['GENDIR']
Because all gensrcs modules that use $(genDir) have unconverted deps, the modules in examples/gensrcs are allowlisted in aosp/2108333 and used to prove the correctness of the conversion Test: b build //build/bazel/examples/gensrcs/... Test: cd build/bazel/examples/gensrcs && USE_BAZEL_ANALYSIS=1 mma Bug: 179452413 Change-Id: I65b48a8440e1aa0dd6592483a231e561de2822e1
Diffstat (limited to 'rules/gensrcs.bzl')
-rw-r--r--rules/gensrcs.bzl4
1 files changed, 4 insertions, 0 deletions
diff --git a/rules/gensrcs.bzl b/rules/gensrcs.bzl
index 9812f49e..6ae55738 100644
--- a/rules/gensrcs.bzl
+++ b/rules/gensrcs.bzl
@@ -25,6 +25,10 @@ def _gensrcs_impl(ctx):
tool[DefaultInfo].files_to_run
for tool in ctx.attr.tools
]
+ command = command.replace(
+ "$(GENDIR)",
+ ctx.var["GENDIR"]
+ )
out_files = []
for in_file in ctx.files.srcs: