// Copyright 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.

package {
    default_team: "trendy_team_android_hardware_backed_security",
    default_applicable_licenses: ["system_authgraph_license"],
}

rust_library {
    name: "libauthgraph_core",
    crate_name: "authgraph_core",
    srcs: ["src/lib.rs"],
    host_supported: true,
    vendor_available: true,
    rustlibs: [
        "libauthgraph_wire",
        "libcoset",
        "liblog_rust",
        "libzeroize",
    ],
}

rust_library_rlib {
    name: "libauthgraph_core_nostd",
    crate_name: "authgraph_core",
    srcs: ["src/lib.rs"],
    vendor_available: true,
    prefer_rlib: true,
    no_stdlibs: true,
    rustlibs: [
        "libauthgraph_wire_nostd",
        "libcoset_nostd",
        "liblog_rust_nostd",
        "libzeroize_nostd",
    ],
    stdlibs: [
        "liballoc.rust_sysroot",
        "libcompiler_builtins.rust_sysroot",
        "libcore.rust_sysroot",
    ],
}

rust_test {
    name: "libauthgraph_core_unit_test",
    crate_name: "authgraph_core_unit_test",
    srcs: ["tests/lib.rs"],
    host_supported: true,
    rustlibs: [
        "libauthgraph_boringssl",
        "libauthgraph_core",
        "libauthgraph_core_test",
        "libauthgraph_wire",
        "libcoset",
        "libhex",
        "liblog_rust",
        "libzeroize",
    ],
    test_suites: ["general-tests"],
}
