| // Copyright 2024, 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. | |
| rust_defaults { | |
| name: "libomapi_defaults", | |
| crate_name: "omapi", | |
| srcs: ["src/lib.rs"], | |
| rustlibs: [ | |
| "android.hardware.secure_element-V1-rust", | |
| "android.se.omapi-V2-rust", | |
| "libandroid_logger", | |
| "libanyhow", | |
| "libbinder_rs", | |
| "libbssl_crypto", | |
| "libhex", | |
| "libitertools", | |
| "liblog_rust", | |
| "libmockall", | |
| "librustutils", | |
| "libserde_xml_rs", | |
| "libserde", | |
| "libstrum", | |
| "libthiserror", | |
| "libzeroize", | |
| "packagemanager_aidl-rust", | |
| ], | |
| proc_macros: ["libstrum_macros"], | |
| // The "log_sensitive_data" feature enables detailed debug tracing. This is useful but | |
| // verbose and may log sensitive data, so enable it only for developer builds. | |
| // features: ["log_sensitive_data"], | |
| } | |
| rust_library { | |
| name: "libomapi", | |
| defaults: ["libomapi_defaults"], | |
| } | |
| rust_test { | |
| name: "libomapi_test", | |
| defaults: ["libomapi_defaults"], | |
| test_suites: ["general-tests"], | |
| auto_gen_config: true, | |
| rustlibs: [ | |
| "libgoogletest_rust", | |
| ], | |
| proc_macros: ["libmockall_derive"], | |
| require_root: true, | |
| } | |
| rust_test { | |
| name: "libomapi_test_disallow_unknown_tags", | |
| defaults: ["libomapi_defaults"], | |
| test_suites: ["general-tests"], | |
| auto_gen_config: true, | |
| rustlibs: [ | |
| "libgoogletest_rust", | |
| ], | |
| features: ["disallow_unknown_ara_tags"], | |
| } | |
| rust_binary { | |
| name: "omapi", | |
| init_rc: ["omapi.rc"], | |
| vintf_fragment_modules: [ | |
| "omapi.xml", | |
| ], | |
| srcs: ["src/omapi_main.rs"], | |
| rustlibs: [ | |
| "libandroid_logger", | |
| "libbinder_rs", | |
| "liblog_rust", | |
| "libomapi", | |
| ], | |
| } | |
| vintf_fragment { | |
| name: "omapi.xml", | |
| src: "omapi.xml", | |
| } |