From 15088e45a9acfa6d01e0748d667c697caf9928cb Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Fri, 12 Aug 2022 16:37:40 -0400 Subject: [PATCH] Move bp2build progress proto to soong. This allows us to reuse existing infra to export to internal. Test: b build //build/bazel/scripts/bp2build-progress:bp2build-progress Change-Id: If4888f8f59d56ddf4e98bdb8456ca69ff7f78a49 --- android/allowlists/allowlists.go | 1 + .../BUILD.bazel | 27 ++++++++++ .../bp2build.proto | 51 +++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 ui/metrics/bp2build_progress_metrics_proto/BUILD.bazel create mode 100644 ui/metrics/bp2build_progress_metrics_proto/bp2build.proto diff --git a/android/allowlists/allowlists.go b/android/allowlists/allowlists.go index a5799a54e..1f6ecb5cd 100644 --- a/android/allowlists/allowlists.go +++ b/android/allowlists/allowlists.go @@ -262,6 +262,7 @@ var ( // build/make/tools/signapk BUILD file is generated, so build/make/tools is not recursive. "build/make/tools":/* recursive = */ false, "build/pesto":/* recursive = */ true, + "build/soong/ui/metrics/bp2build_progress_metrics_proto":/* recursive = */ true, // external/bazelbuild-rules_android/... is needed by mixed builds, otherwise mixed builds analysis fails // e.g. ERROR: Analysis of target '@soong_injection//mixed_builds:buildroot' failed diff --git a/ui/metrics/bp2build_progress_metrics_proto/BUILD.bazel b/ui/metrics/bp2build_progress_metrics_proto/BUILD.bazel new file mode 100644 index 000000000..356b18854 --- /dev/null +++ b/ui/metrics/bp2build_progress_metrics_proto/BUILD.bazel @@ -0,0 +1,27 @@ +# Copyright (C) 2022 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("//build/bazel/rules/python:py_proto.bzl", "py_proto_library") + +proto_library( + name = "bp2build_proto", + srcs = ["bp2build.proto"], + strip_import_prefix = "", +) + +py_proto_library( + name = "bp2build_py_proto", + deps = [":bp2build_proto"], + visibility = ["//build/bazel/scripts/bp2build-progress:__pkg__"], +) diff --git a/ui/metrics/bp2build_progress_metrics_proto/bp2build.proto b/ui/metrics/bp2build_progress_metrics_proto/bp2build.proto new file mode 100644 index 000000000..4aee88b68 --- /dev/null +++ b/ui/metrics/bp2build_progress_metrics_proto/bp2build.proto @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +syntax = "proto3"; + +package bp2build_proto; + + +// Conversion progress report for root_modules . +message Bp2buildConversionProgress { + + // Soong module identifying information. + message Module { + // Name of the Soong module. + string name = 1; + + // Directory that the Soong module is in. + string directory = 2; + + // Module type of this module. + string type = 3; + + // All unconverted transitive dependencies. + repeated string unconverted_deps = 4; + + // Total number of transitive dependencies. + int32 num_deps = 5; + } + + // Modules that the transitive dependencies were identified for. + repeated string root_modules = 1; + + // Names of all dependencies of the root_modules. + int32 num_deps = 2; + + // Module with all its unconverted transitive dependencies. + repeated Module unconverted = 3; +}