Classes | |
class | ExternalProtoLibrary |
Variables | |
list | _BAZEL_DEPS_QUERIES |
dictionary | _BUILD_EXTRA_METADATA |
dictionary | all_extra_metadata = {} |
BuildDict | all_targets_dict = _generate_build_metadata(all_extra_metadata, bazel_rules) |
dictionary | bazel_rules = {} |
BuildYaml | build_yaml_like = _convert_to_build_yaml_like(all_targets_dict) |
build_yaml_string | |
BuildDict = Dict[str, BuildMetadata] | |
BuildMetadata = Dict[str, Any] | |
BuildYaml = Dict[str, Any] | |
dictionary | EXTERNAL_PROTO_LIBRARIES |
List[str] | tests = _exclude_unwanted_cc_tests(_extract_cc_tests(bazel_rules)) |
|
private |
Get xml output of bazel query invocation, parsed as XML tree
Definition at line 105 of file extract_metadata_from_bazel_xml.py.
|
private |
Computes the final build metadata for Bazel target with rule_name. The dependencies that will appear on the deps list are: * Public build targets including binaries and tests; * External targets, like absl, re2. All other intermediate dependencies will be merged, which means their source file, headers, etc. will be collected into one build target. This step of processing will greatly reduce the complexity of the generated build specifications for other build systems, like CMake, Make, setuptools. The final build metadata are: * _TRANSITIVE_DEPS: all the transitive dependencies including intermediate targets; * _COLLAPSED_DEPS: dependencies that fits our requirement above, and it will remove duplicated items and produce the shortest possible dependency list in alphabetical order; * _COLLAPSED_SRCS: the merged source files; * _COLLAPSED_PUBLIC_HEADERS: the merged public headers; * _COLLAPSED_HEADERS: the merged non-public headers; * _EXCLUDE_DEPS: intermediate targets to exclude when performing collapsing of sources and dependencies. For the collapsed_deps, the algorithm improved cases like: The result in the past: end2end_tests -> [grpc_test_util, grpc, gpr, address_sorting, upb] grpc_test_util -> [grpc, gpr, address_sorting, upb, ...] grpc -> [gpr, address_sorting, upb, ...] The result of the algorithm: end2end_tests -> [grpc_test_util] grpc_test_util -> [grpc] grpc -> [gpr, address_sorting, upb, ...]
Definition at line 289 of file extract_metadata_from_bazel_xml.py.
|
private |
Definition at line 578 of file extract_metadata_from_bazel_xml.py.
|
private |
Create build.yaml-like target definition from bazel metadata
Definition at line 247 of file extract_metadata_from_bazel_xml.py.
|
private |
Try detecting some unusual situations and warn about them.
Definition at line 849 of file extract_metadata_from_bazel_xml.py.
|
private |
Filters out bazel tests that we don't want to run with other build systems or we cannot build them reasonably
Definition at line 639 of file extract_metadata_from_bazel_xml.py.
|
private |
Definition at line 485 of file extract_metadata_from_bazel_xml.py.
|
private |
Returns name of dependency if external bazel dependency is provided or None
Definition at line 270 of file extract_metadata_from_bazel_xml.py.
|
private |
Gets list of cc_test tests from bazel rules
Definition at line 627 of file extract_metadata_from_bazel_xml.py.
|
private |
Gets list of deps from from a bazel rule
Definition at line 232 of file extract_metadata_from_bazel_xml.py.
|
private |
Gets list of non-public headers from a bazel rule
Definition at line 198 of file extract_metadata_from_bazel_xml.py.
|
private |
Gets list of public headers from a bazel rule
Definition at line 189 of file extract_metadata_from_bazel_xml.py.
|
private |
Extract bazel rules from an XML tree node obtained from "bazel query --output xml" command.
Definition at line 144 of file extract_metadata_from_bazel_xml.py.
|
private |
Gets relative path to source file from bazel deps listing
Definition at line 177 of file extract_metadata_from_bazel_xml.py.
|
private |
Gets list of source files from a bazel rule
Definition at line 208 of file extract_metadata_from_bazel_xml.py.
|
private |
For given tests, generate the "extra metadata" that we need for our "build.yaml"-like output. The extra metadata is generated from the bazel rule metadata by using a bunch of heuristics.
Definition at line 714 of file extract_metadata_from_bazel_xml.py.
|
private |
Generate build metadata in build.yaml-like format bazel build metadata and build.yaml-specific "extra metadata".
Definition at line 537 of file extract_metadata_from_bazel_xml.py.
|
private |
Generates the build metadata for external proto libraries
Definition at line 841 of file extract_metadata_from_bazel_xml.py.
|
private |
Definition at line 168 of file extract_metadata_from_bazel_xml.py.
|
private |
Definition at line 465 of file extract_metadata_from_bazel_xml.py.
|
private |
Definition at line 98 of file extract_metadata_from_bazel_xml.py.
|
private |
Parse Bazel http_archive rule into ExternalProtoLibrary objects.
Definition at line 807 of file extract_metadata_from_bazel_xml.py.
|
private |
Add 'transitive_deps' field for each of the rules
Definition at line 430 of file extract_metadata_from_bazel_xml.py.
|
private |
Converts XML node representing a rule (obtained from "bazel query --output xml") to a dictionary that contains all the metadata we will need.
Definition at line 112 of file extract_metadata_from_bazel_xml.py.
None extract_metadata_from_bazel_xml.update_test_metadata_with_transitive_metadata | ( | BuildDict | all_extra_metadata, |
BuildDict | bazel_rules | ||
) |
Patches test build metadata with transitive metadata.
Definition at line 446 of file extract_metadata_from_bazel_xml.py.
|
private |
Definition at line 1078 of file extract_metadata_from_bazel_xml.py.
|
private |
Definition at line 863 of file extract_metadata_from_bazel_xml.py.
dictionary extract_metadata_from_bazel_xml.all_extra_metadata = {} |
Definition at line 1158 of file extract_metadata_from_bazel_xml.py.
BuildDict extract_metadata_from_bazel_xml.all_targets_dict = _generate_build_metadata(all_extra_metadata, bazel_rules) |
Definition at line 1209 of file extract_metadata_from_bazel_xml.py.
dictionary extract_metadata_from_bazel_xml.bazel_rules = {} |
Definition at line 1099 of file extract_metadata_from_bazel_xml.py.
BuildYaml extract_metadata_from_bazel_xml.build_yaml_like = _convert_to_build_yaml_like(all_targets_dict) |
Definition at line 1223 of file extract_metadata_from_bazel_xml.py.
extract_metadata_from_bazel_xml.build_yaml_string |
Definition at line 1243 of file extract_metadata_from_bazel_xml.py.
extract_metadata_from_bazel_xml.BuildDict = Dict[str, BuildMetadata] |
Definition at line 42 of file extract_metadata_from_bazel_xml.py.
extract_metadata_from_bazel_xml.BuildMetadata = Dict[str, Any] |
Definition at line 41 of file extract_metadata_from_bazel_xml.py.
extract_metadata_from_bazel_xml.BuildYaml = Dict[str, Any] |
Definition at line 43 of file extract_metadata_from_bazel_xml.py.
dictionary extract_metadata_from_bazel_xml.EXTERNAL_PROTO_LIBRARIES |
Definition at line 82 of file extract_metadata_from_bazel_xml.py.
List[str] extract_metadata_from_bazel_xml.tests = _exclude_unwanted_cc_tests(_extract_cc_tests(bazel_rules)) |
Definition at line 1129 of file extract_metadata_from_bazel_xml.py.