avb: move Rust bindgen to libavb
Moves the avb bindgen rules into libavb, only visible to
//packages/modules/Virtualization for now.
Future CLs will move the higher-level Rust API wrappers to libavb as
well, making them more widely discoverable, at which point
Virtualization can be adjusted to use those instead of the raw bindgen.
Bug: 290110273
Test: presubmit
Change-Id: I4033dc591122d13cebee25e8ce66fc5a27b218c2
diff --git a/libs/avb/Android.bp b/libs/avb/Android.bp
deleted file mode 100644
index a2d9e1a..0000000
--- a/libs/avb/Android.bp
+++ /dev/null
@@ -1,55 +0,0 @@
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-rust_defaults {
- name: "libavb_bindgen.defaults",
- wrapper_src: "bindgen/avb.h",
- crate_name: "avb_bindgen",
- edition: "2021",
- visibility: ["//packages/modules/Virtualization:__subpackages__"],
- source_stem: "bindings",
- bindgen_flags: [
- "--constified-enum-module AvbDescriptorTag",
- "--default-enum-style rust",
- "--allowlist-type=AvbDescriptorTag",
- "--allowlist-function=.*",
- "--allowlist-var=AVB.*",
- "--use-core",
- "--raw-line=#![no_std]",
- "--ctypes-prefix=core::ffi",
- ],
- cflags: ["-DBORINGSSL_NO_CXX"],
-}
-
-rust_bindgen {
- name: "libavb_bindgen",
- defaults: ["libavb_bindgen.defaults"],
- host_supported: true,
- static_libs: [
- "libavb",
- ],
- shared_libs: [
- "libcrypto",
- ],
-}
-
-rust_bindgen {
- name: "libavb_bindgen_nostd",
- defaults: ["libavb_bindgen.defaults"],
- static_libs: [
- "libavb_baremetal",
- "libcrypto_baremetal",
- ],
-}
-
-rust_test {
- name: "libavb_bindgen_test",
- srcs: [":libavb_bindgen"],
- crate_name: "avb_bindgen_test",
- edition: "2021",
- test_suites: ["general-tests"],
- auto_gen_config: true,
- clippy_lints: "none",
- lints: "none",
-}
diff --git a/libs/avb/TEST_MAPPING b/libs/avb/TEST_MAPPING
deleted file mode 100644
index 57de6b3..0000000
--- a/libs/avb/TEST_MAPPING
+++ /dev/null
@@ -1,9 +0,0 @@
-// When adding or removing tests here, don't forget to amend _all_modules list in
-// wireless/android/busytown/ath_config/configs/prod/avf/tests.gcl
-{
- "avf-presubmit" : [
- {
- "name" : "libavb_bindgen_test"
- }
- ]
-}
diff --git a/libs/avb/bindgen/avb.h b/libs/avb/bindgen/avb.h
deleted file mode 100644
index b3d5385..0000000
--- a/libs/avb/bindgen/avb.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2021 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.
- */
-
-#pragma once
-
-#include <libavb/libavb.h>