/*
 * Copyright (C) 2023 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.
 */

package {
    default_team: "trendy_team_virtualization",
    default_applicable_licenses: ["Android-Apache-2.0"],
}

rust_library {
    name: "libsecretkeeper_test",
    crate_name: "secretkeeper_test",
    srcs: ["lib.rs"],
    rustlibs: [
        "libciborium",
        "libcoset",
        "libdiced_open_dice",
        "libexplicitkeydice",
        "libhex",
        "liblog_rust",
        "libsecretkeeper_client",
    ],
}

rust_test {
    name: "VtsSecretkeeperTargetTest",
    srcs: ["secretkeeper_test_client.rs"],
    defaults: [
        "rdroidtest.defaults",
        "secretkeeper_use_latest_hal_aidl_rust",
    ],
    test_suites: [
        "general-tests",
        "vts",
    ],
    test_config: "AndroidTest.xml",
    rustlibs: [
        "libauthgraph_boringssl",
        "libauthgraph_core",
        "libauthgraph_wire",
        "libauthgraph_vts_test",
        "libbinder_rs",
        "libciborium",
        "libcoset",
        "libdice_policy_builder",
        "libexplicitkeydice",
        "liblog_rust",
        "libsecretkeeper_client",
        "libsecretkeeper_comm",
        "libsecretkeeper_core",
        "libsecretkeeper_test",
    ],
    require_root: true,
}

rust_binary {
    name: "secretkeeper_cli",
    srcs: ["secretkeeper_cli.rs"],
    defaults: ["secretkeeper_use_latest_hal_aidl_rust"],
    lints: "android",
    prefer_rlib: true,
    rustlibs: [
        "libanyhow",
        "libauthgraph_boringssl",
        "libauthgraph_core",
        "libbinder_rs",
        "libclap",
        "libcoset",
        "libdice_policy_builder",
        "libexplicitkeydice",
        "libhex",
        "liblog_rust",
        "libsecretkeeper_client",
        "libsecretkeeper_comm",
        "libsecretkeeper_test",
    ],
}
