load("//cuttlefish/bazel:rules.bzl", "cf_cc_library", "cf_cc_test")

package(
    default_visibility = ["//:android_cuttlefish"],
)

cf_cc_library(
    name = "cas_downloader",
    srcs = ["cas_downloader.cpp"],
    hdrs = ["cas_downloader.h"],
    clang_format_enabled = False,
    deps = [
        "//cuttlefish/common/libs/fs",
        "//cuttlefish/common/libs/utils:environment",
        "//cuttlefish/common/libs/utils:files",
        "//cuttlefish/common/libs/utils:json",
        "//cuttlefish/common/libs/utils:subprocess",
        "//cuttlefish/common/libs/utils:subprocess_managed_stdio",
        "//cuttlefish/host/libs/web:android_build",
        "//cuttlefish/host/libs/web/cas:cas_flags",
        "//cuttlefish/result",
        "//libbase",
        "@abseil-cpp//absl/log",
        "@abseil-cpp//absl/strings",
        "@jsoncpp",
    ],
)

cf_cc_test(
    name = "cas_downloader_test",
    srcs = ["cas_downloader_test.cpp"],
    deps = [
        "//cuttlefish/common/libs/utils:files",
        "//cuttlefish/flag_parser",
        "//cuttlefish/host/libs/web:android_build",
        "//cuttlefish/host/libs/web/cas:cas_downloader",
        "//cuttlefish/host/libs/web/cas:cas_flags",
        "//cuttlefish/result",
        "//cuttlefish/result:result_matchers",
        "//libbase",
        "@fmt",
    ],
)

cf_cc_test(
    name = "cas_flags_test",
    srcs = ["cas_flags_test.cpp"],
    deps = [
        "//cuttlefish/common/libs/utils:files",
        "//cuttlefish/host/libs/web/cas:cas_flags",
        "//libbase",
    ],
)

cf_cc_library(
    name = "cas_flags",
    srcs = ["cas_flags.cc"],
    hdrs = ["cas_flags.h"],
    clang_format_enabled = False,
    deps = [
        "//cuttlefish/common/libs/utils:files",
        "//cuttlefish/flag_parser",
        "//cuttlefish/result",
        "//libbase",
        "@abseil-cpp//absl/strings",
        "@fmt",
    ],
)
