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

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

cf_cc_library(
    name = "creation_analyzer",
    srcs = ["creation_analyzer.cpp"],
    hdrs = ["creation_analyzer.h"],
    deps = [
        "//cuttlefish/common/libs/utils:contains",
        "//cuttlefish/common/libs/utils:files",
        "//cuttlefish/common/libs/utils:users",
        "//cuttlefish/host/commands/cvd/cli/selector:selector_common_parser",
        "//cuttlefish/host/commands/cvd/instances",
        "//cuttlefish/host/commands/cvd/instances:cvd_persistent_data",
        "//cuttlefish/host/commands/cvd/instances:instance_manager",
        "//cuttlefish/host/commands/cvd/instances/lock",
        "//cuttlefish/host/commands/cvd/utils:common",
        "//cuttlefish/result",
        "//libbase",
        "@abseil-cpp//absl/log",
        "@abseil-cpp//absl/strings",
    ],
)

cf_cc_test(
    name = "host_tool_target_test",
    srcs = ["host_tool_target_test.cpp"],
    deps = [
        "//cuttlefish/common/libs/utils:environment",
        "//cuttlefish/host/commands/cvd/cli/commands:host_tool_target",
        "//cuttlefish/result:result_matchers",
    ],
)

cf_cc_library(
    name = "num_instances_parser",
    srcs = ["num_instances_parser.cpp"],
    hdrs = ["num_instances_parser.h"],
    deps = [
        ":selector_common_parser",
        "//cuttlefish/flag_parser",
        "//cuttlefish/result",
    ],
)

cf_cc_test(
    name = "num_instances_parser_test",
    srcs = ["num_instances_parser_test.cpp"],
    deps = [
        ":num_instances_parser",
        ":selector_common_parser",
        "//cuttlefish/flag_parser",
        "//cuttlefish/host/commands/cvd/cli:types",
        "//cuttlefish/result",
        "//cuttlefish/result:result_matchers",
    ],
)

cf_cc_library(
    name = "selector",
    srcs = ["selector.cpp"],
    hdrs = ["selector.h"],
    deps = [
        "//cuttlefish/common/libs/utils:users",
        "//cuttlefish/host/commands/cvd/cli:command_request",
        "//cuttlefish/host/commands/cvd/cli:interruptible_terminal",
        "//cuttlefish/host/commands/cvd/cli:utils",
        "//cuttlefish/host/commands/cvd/instances",
        "//cuttlefish/host/commands/cvd/instances:instance_manager",
        "//cuttlefish/result",
        "//libbase",
        "@abseil-cpp//absl/strings",
    ],
)

cf_cc_library(
    name = "selector_common_parser",
    srcs = ["selector_common_parser.cpp"],
    hdrs = ["selector_common_parser.h"],
    deps = [
        "//cuttlefish/common/libs/utils:contains",
        "//cuttlefish/flag_parser",
        "//cuttlefish/host/commands/cvd/cli:types",
        "//cuttlefish/host/commands/cvd/cli/selector:selector_constants",
        "//cuttlefish/host/commands/cvd/instances:device_name",
        "//cuttlefish/result",
        "//libbase",
    ],
)

cf_cc_library(
    name = "selector_constants",
    hdrs = ["selector_constants.h"],
)
