java_library(
    name = "segment_builder_lib",
    sources = ["**/*.java"],
    platform = "java8",
    tags = [
        "bazel-compatible",
        "bazel-only",
    ],
    dependencies = [
        "3rdparty/jvm/com/google/guava",
        "3rdparty/jvm/com/google/inject:guice",
        "3rdparty/jvm/org/apache/bookkeeper:bookkeeper-server",
        "3rdparty/jvm/org/apache/bookkeeper:bookkeeper-twitter-science-provider",
        "3rdparty/jvm/org/apache/hadoop:hadoop-client-default",
        "3rdparty/jvm/org/apache/thrift:libthrift",
        "3rdparty/jvm/org/apache/zookeeper:zookeeper-client",
        "3rdparty/jvm/org/slf4j:slf4j-api",
        "decider/src/main/scala",
        "finatra/inject/inject-core/src/main/scala",
        "finatra/inject/inject-server/src/main/scala/com/twitter/inject/server",
        "src/java/com/twitter/common/base",
        "src/java/com/twitter/common/quantity",
        "src/java/com/twitter/common/util:system-mocks",
        "src/java/com/twitter/common_internal/text/version",
        "src/java/com/twitter/search/common/config",
        "src/java/com/twitter/search/common/database",
        "src/java/com/twitter/search/common/metrics",
        "src/java/com/twitter/search/common/partitioning/base",
        "src/java/com/twitter/search/common/partitioning/zookeeper",
        "src/java/com/twitter/search/common/schema",
        "src/java/com/twitter/search/common/schema/base",
        "src/java/com/twitter/search/common/util:closeresourceutil",
        "src/java/com/twitter/search/common/util:gcutil",
        "src/java/com/twitter/search/common/util:kerberos",
        "src/java/com/twitter/search/common/util/date",
        "src/java/com/twitter/search/common/util/io:flushable",
        "src/java/com/twitter/search/common/util/zktrylock",
        "src/java/com/twitter/search/common/util/zookeeper",
        "src/java/com/twitter/search/earlybird:earlybird-lib",
        "src/java/com/twitter/search/earlybird/common",
        "src/java/com/twitter/search/earlybird/common/config",
        "src/java/com/twitter/search/earlybird/common/userupdates",
        "util/util-core:scala",
    ],
)

# Using hadoop_binary target can automatically exclude hadoop related jars in the built jar
# and load in the right jars based on hadoop config.
hadoop_binary(
    name = "segment_builder_binary",
    basename = "segment_builder",
    main = "com.twitter.search.earlybird.archive.segmentbuilder.SegmentBuilderMain",
    platform = "java8",
    runtime_platform = "java8",
    tags = [
        "bazel-compatible",
        "bazel-compatible:migrated",
        "bazel-only",
    ],
    dependencies = [
        ":segment_builder_lib",
        "src/java/com/twitter/search/common/logging:search-log4j",
    ],
)
