Commit 0f539b8c authored by Weilun Shi's avatar Weilun Shi Committed by Commit Bot

Remove BUILD dependencies for merge_xml action

Remove BUILD dependencies for merge_xml action and list all xmls that
need to be merged in merge_xml.py instead because listing them in the
sources is too verbose as we split up smaller xmls.

Bug: 1116096
Change-Id: I1ba1e09feece3442a673d4ba41868f36e1135298
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359231
Auto-Submit: Weilun Shi <sweilun@chromium.org>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798647}
parent b6a4fb5c
......@@ -4,23 +4,9 @@
action("histograms_xml") {
script = "histograms/merge_xml.py"
sources = [
"histograms/enums.xml",
"histograms/histograms.xml",
"histograms/histograms_xml/Fingerprint/histograms.xml",
"histograms/histograms_xml/UMA/histograms.xml",
"histograms/histograms_xml/histogram_suffixes.xml",
"histograms/histograms_xml/obsolete_histograms.xml",
"ukm/ukm.xml",
]
output = "$root_out_dir/histograms.xml"
outputs = [ output ]
# TODO(crbug/1116096): Automatically list all histograms paths in the
# sources.
args = rebase_path(sources, root_build_dir) + [
"--output",
rebase_path(output, root_build_dir),
]
args = ["--output", rebase_path(output, root_build_dir)]
}
copy("actions_xml") {
......
......@@ -39,6 +39,7 @@ ALL_XMLS_RELATIVE = [ENUMS_XML_RELATIVE, OBSOLETE_XML_RELATIVE
] + HISTOGRAMS_XMLS_RELATIVE
ENUMS_XML = path_util.GetInputFile(ENUMS_XML_RELATIVE)
UKM_XML = path_util.GetInputFile('tools/metrics/ukm/ukm.xml')
HISTOGRAMS_XMLS = [path_util.GetInputFile(f) for f in HISTOGRAMS_XMLS_RELATIVE]
OBSOLETE_XML = path_util.GetInputFile(OBSOLETE_XML_RELATIVE)
ALL_XMLS = [ENUMS_XML, OBSOLETE_XML] + HISTOGRAMS_XMLS
......
......@@ -13,6 +13,7 @@ import xml.dom.minidom
import expand_owners
import extract_histograms
import histogram_configuration_model
import histogram_paths
import populate_enums
......@@ -160,11 +161,16 @@ def PrettyPrintMergedFiles(filenames=[], files=[]):
def main():
parser = argparse.ArgumentParser()
parser.add_argument('inputs', nargs="+")
parser.add_argument('--output', required=True)
args = parser.parse_args()
with open(args.output, 'w') as f:
f.write(PrettyPrintMergedFiles(args.inputs))
# This is run by
# https://source.chromium.org/chromium/chromium/src/+/master:tools/metrics/BUILD.gn;drc=573e48309695102dec2da1e8f806c18c3200d414;l=5
# to send the merged histograms.xml to the server side. Providing |UKM_XML|
# here is not to merge ukm.xml but to populate `UkmEventNameHash` enum
# values.
f.write(PrettyPrintMergedFiles(
histogram_paths.ALL_XMLS + [histogram_paths.UKM_XML]))
if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment