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

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

cf_cc_library(
    name = "error_type",
    srcs = ["error_type.cc"],
    hdrs = ["error_type.h"],
    deps = [
        "//libbase",
        "@abseil-cpp//absl/log",
        "@fmt",
    ],
)

cf_cc_library(
    name = "expect",
    hdrs = ["expect.h"],
    deps = [
        "//cuttlefish/result:error_type",
        "//cuttlefish/result:result_type",
        "//libbase",
        "@abseil-cpp//absl/log",
        "@fmt",
    ],
)

cf_cc_library(
    name = "result",
    hdrs = ["result.h"],
    deps = [
        "//cuttlefish/result:expect",
        "//cuttlefish/result:result_type",
    ],
)

cf_cc_test(
    name = "result_test",
    srcs = ["result_test.cpp"],
    deps = [
        "//cuttlefish/result",
        "//cuttlefish/result:result_matchers",
        "//libbase",
    ],
)

cf_cc_library(
    name = "result_type",
    hdrs = ["result_type.h"],
    deps = [
        "//cuttlefish/result:error_type",
        "//libbase",
        "@fmt",
    ],
)

cf_cc_library(
    name = "result_matchers",
    testonly = 1,
    hdrs = ["result_matchers.h"],
    deps = [
        "//cuttlefish/result",
        "//libbase",
        "@googletest//:gtest",
    ],
)
