load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "orchestrator",
    srcs = [
        "controller.go",
        "createcvdaction.go",
        "createcvdbugreportaction.go",
        "createsnapshotaction.go",
        "displayaddaction.go",
        "displaylistaction.go",
        "displayremoveaction.go",
        "displayscreenshotaction.go",
        "execcvdcommandaction.go",
        "getscreenrecordingaction.go",
        "imagedirectories.go",
        "instancemanager.go",
        "listcvdsaction.go",
        "listscreenrecordingsaction.go",
        "operation.go",
        "resetcvdaction.go",
        "startcvdaction.go",
        "userartifacts.go",
        "validation.go",
    ],
    importpath = "github.com/google/android-cuttlefish/frontend/src/host_orchestrator/orchestrator",
    visibility = ["//visibility:public"],
    deps = [
        "//src/host_orchestrator/api/v1:api",
        "//src/host_orchestrator/orchestrator/cvd",
        "//src/host_orchestrator/orchestrator/cvd/output",
        "//src/host_orchestrator/orchestrator/debug",
        "//src/host_orchestrator/orchestrator/exec",
        "//src/liboperator/operator",
        "@com_github_google_btree//:btree",
        "@com_github_google_uuid//:uuid",
        "@com_github_gorilla_mux//:mux",
    ],
)

go_test(
    name = "orchestrator_test",
    srcs = [
        "controller_test.go",
        "imagedirectories_test.go",
        "listcvdsaction_test.go",
        "operation_test.go",
        "userartifacts_test.go",
        "validation_test.go",
    ],
    embed = [":orchestrator"],
    deps = [
        "//src/host_orchestrator/api/v1:api",
        "//src/host_orchestrator/orchestrator/debug",
        "//src/host_orchestrator/orchestrator/testing",
        "@com_github_google_btree//:btree",
        "@com_github_google_go_cmp//cmp",
        "@com_github_gorilla_mux//:mux",
    ],
)
