chore(build): allow overriding extract_kzip tool path
@@ -26,7 +26,8 @@ def kzip_extractor(
exclude = "",
sources = "",
source_args = "",
- scoped = True):
+ scoped = True,
+ extractor = "//kythe/go/extractors/cmd/bazel:extract_kzip"):
"""This macro creates extra_action and action_listener for extract_kzip.
This macro expands to an extra action listener that invokes extract_kzip
@@ -45,6 +46,7 @@ def kzip_extractor(
source_args: optional RE2 matching arguments to consider source files in
kzip extractor
scoped: optional boolean whether to match source paths only in target pkg
+ extractor: optional label of the extract_kzip tool to use
"""
if not mnemonics:
@@ -55,7 +57,6 @@ def kzip_extractor(
fail("The 'corpus' attribute must be non-empty")
xa_name = name + "_extra_action"
- xa_tool = "//kythe/go/extractors/cmd/bazel:extract_kzip"
xa_output = "$(ACTION_ID).%s.kzip" % language
xa_args = {
"corpus": corpus,
@@ -79,9 +80,9 @@ def kzip_extractor(
name = xa_name,
data = [rules] if rules else [],
out_templates = [xa_output],
- tools = [xa_tool],
+ tools = [extractor],
cmd = (
- "$(location %s) " % xa_tool + " ".join(sorted([
+ "$(location %s) " % extractor + " ".join(sorted([
"--%s=%s" % (key, value)
for key, value in xa_args.items()
]))
