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

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

prebuilt_etc {
    name: "tradeinmode.rc",
    src: "tradeinmode.rc",
    sub_dir: "init",
}

java_binary {
    name: "tradeinmode",
    srcs: ["src/**/Commands.kt"],
    main_class: "com.android.devicediagnostics.commands.Commands",
    required: ["tradeinmode.rc"],
    dex_preopt: {
        enabled: false,
    },
}

java_library {
    name: "tradeinmode_attestation_lib",
    srcs: [
        "src/com/android/devicediagnostics/AttestationHelpers.kt",
    ],
    libs: [
        "android-key-attestation",
    ],
    host_supported: true,
}

java_binary_host {
    name: "parse_tim_attestation",
    srcs: ["src/**/AttestationCli.kt"],
    main_class: "com.android.devicediagnostics.commands.AttestationCli",
    static_libs: [
        "android-key-attestation",
        "gson",
        "guava",
        "json-prebuilt",
        "tradeinmode_attestation_lib",
    ],
}
