Runs bazel query on given package file and returns all cc rules.
(package)
| 97 | |
| 98 | |
| 99 | def read_build(package): |
| 100 | """Runs bazel query on given package file and returns all cc rules.""" |
| 101 | result = subprocess.check_output( |
| 102 | ["bazel", "query", package + ":all", "--output", "xml"]) |
| 103 | root = xml.etree.ElementTree.fromstring(result) |
| 104 | return [ |
| 105 | parse_rule(elem, package) |
| 106 | for elem in root |
| 107 | if elem.tag == "rule" and elem.attrib["class"].startswith("cc_") |
| 108 | ] |
| 109 | |
| 110 | |
| 111 | def collect_rules(root_path): |
no test coverage detected