heron_binary(
    name = "heron-without-jass",
    main = "com.twitter.timelines.prediction.common.aggregates.real_time.TypeSafeRunner",
    oss = True,
    platform = "java8",
    runtime_platform = "java8",
    tags = ["bazel-compatible"],
    dependencies = [
        ":real_time",
        "3rdparty/jvm/org/slf4j:slf4j-jdk14",
    ],
)

jvm_app(
    name = "rta_heron",
    binary = ":heron-without-jass",
    bundles = [
        bundle(
            fileset = ["resources/jaas.conf"],
        ),
    ],
    tags = [
        "bazel-compatible",
        "bazel-only",
    ],
)

scala_library(
    sources = ["*.scala"],
    platform = "java8",
    strict_deps = False,
    tags = ["bazel-compatible"],
    dependencies = [
        ":online-configs",
        "3rdparty/src/jvm/com/twitter/summingbird:storm",
        "src/java/com/twitter/heron/util",
        "src/java/com/twitter/ml/api:api-base",
        "src/java/com/twitter/ml/api/constant",
        "src/scala/com/twitter/frigate/data_pipeline/features_aggregated/core:core-features",
        "src/scala/com/twitter/ml/api/util",
        "src/scala/com/twitter/storehaus_internal/memcache",
        "src/scala/com/twitter/storehaus_internal/util",
        "src/scala/com/twitter/summingbird_internal/bijection:bijection-implicits",
        "src/scala/com/twitter/summingbird_internal/runner/store_config",
        "src/scala/com/twitter/summingbird_internal/runner/storm",
        "src/scala/com/twitter/summingbird_internal/sources/storm/remote:ClientEventSourceScrooge2",
        "src/scala/com/twitter/timelines/prediction/adapters/client_log_event",
        "src/scala/com/twitter/timelines/prediction/adapters/client_log_event_mr",
        "src/scala/com/twitter/timelines/prediction/features/client_log_event",
        "src/scala/com/twitter/timelines/prediction/features/common",
        "src/scala/com/twitter/timelines/prediction/features/list_features",
        "src/scala/com/twitter/timelines/prediction/features/recap",
        "src/scala/com/twitter/timelines/prediction/features/user_health",
        "src/thrift/com/twitter/ml/api:data-java",
        "src/thrift/com/twitter/timelines/suggests/common:record-scala",
        "timelinemixer/common/src/main/scala/com/twitter/timelinemixer/clients/served_features_cache",
        "timelines/data_processing/ml_util/aggregation_framework:common_types",
        "timelines/data_processing/ml_util/aggregation_framework/heron",
        "timelines/data_processing/ml_util/aggregation_framework/job",
        "timelines/data_processing/ml_util/aggregation_framework/metrics",
        "timelines/data_processing/ml_util/transforms",
        "timelines/src/main/scala/com/twitter/timelines/clients/memcache_common",
        "util/util-core:scala",
    ],
)

scala_library(
    name = "online-configs",
    sources = [
        "AuthorFeaturesAdapter.scala",
        "Event.scala",
        "FeatureStoreUtils.scala",
        "StormAggregateSourceUtils.scala",
        "TimelinesOnlineAggregationConfig.scala",
        "TimelinesOnlineAggregationConfigBase.scala",
        "TimelinesOnlineAggregationSources.scala",
        "TimelinesStormAggregateSource.scala",
        "TweetFeaturesReadableStore.scala",
        "UserFeaturesAdapter.scala",
        "UserFeaturesReadableStore.scala",
    ],
    platform = "java8",
    strict_deps = True,
    tags = ["bazel-compatible"],
    dependencies = [
        ":base-config",
        "3rdparty/src/jvm/com/twitter/scalding:db",
        "3rdparty/src/jvm/com/twitter/storehaus:core",
        "3rdparty/src/jvm/com/twitter/summingbird:core",
        "3rdparty/src/jvm/com/twitter/summingbird:online",
        "3rdparty/src/jvm/com/twitter/summingbird:storm",
        "abuse/detection/src/main/thrift/com/twitter/abuse/detection/mention_interactions:thrift-scala",
        "snowflake/src/main/scala/com/twitter/snowflake/id",
        "snowflake/src/main/thrift:thrift-scala",
        "src/java/com/twitter/ml/api:api-base",
        "src/java/com/twitter/ml/api/constant",
        "src/scala/com/twitter/frigate/data_pipeline/features_aggregated/core:core-features",
        "src/scala/com/twitter/ml/api/util:datarecord",
        "src/scala/com/twitter/ml/featurestore/catalog/datasets/geo:geo-user-location",
        "src/scala/com/twitter/ml/featurestore/catalog/datasets/magicrecs:user-features",
        "src/scala/com/twitter/ml/featurestore/catalog/entities/core",
        "src/scala/com/twitter/ml/featurestore/catalog/features/core:user",
        "src/scala/com/twitter/ml/featurestore/catalog/features/geo",
        "src/scala/com/twitter/ml/featurestore/catalog/features/magicrecs:user-activity",
        "src/scala/com/twitter/ml/featurestore/catalog/features/magicrecs:user-info",
        "src/scala/com/twitter/ml/featurestore/catalog/features/trends:tweet_trends_scores",
        "src/scala/com/twitter/ml/featurestore/lib/data",
        "src/scala/com/twitter/ml/featurestore/lib/dataset/offline",
        "src/scala/com/twitter/ml/featurestore/lib/export/strato:app-names",
        "src/scala/com/twitter/ml/featurestore/lib/feature",
        "src/scala/com/twitter/ml/featurestore/lib/online",
        "src/scala/com/twitter/ml/featurestore/lib/params",
        "src/scala/com/twitter/storehaus_internal/util",
        "src/scala/com/twitter/summingbird_internal/bijection:bijection-implicits",
        "src/scala/com/twitter/summingbird_internal/runner/store_config",
        "src/scala/com/twitter/summingbird_internal/runner/storm",
        "src/scala/com/twitter/summingbird_internal/sources/common",
        "src/scala/com/twitter/summingbird_internal/sources/common/remote:ClientEventSourceScrooge",
        "src/scala/com/twitter/summingbird_internal/sources/storm/remote:ClientEventSourceScrooge2",
        "src/scala/com/twitter/timelines/prediction/adapters/client_log_event",
        "src/scala/com/twitter/timelines/prediction/adapters/client_log_event_mr",
        "src/scala/com/twitter/timelines/prediction/common/adapters:base",
        "src/scala/com/twitter/timelines/prediction/common/adapters:engagement-converter",
        "src/scala/com/twitter/timelines/prediction/common/aggregates",
        "src/scala/com/twitter/timelines/prediction/features/client_log_event",
        "src/scala/com/twitter/timelines/prediction/features/common",
        "src/scala/com/twitter/timelines/prediction/features/list_features",
        "src/scala/com/twitter/timelines/prediction/features/recap",
        "src/scala/com/twitter/timelines/prediction/features/user_health",
        "src/thrift/com/twitter/clientapp/gen:clientapp-scala",
        "src/thrift/com/twitter/dal/personal_data:personal_data-java",
        "src/thrift/com/twitter/ml/api:data-java",
        "src/thrift/com/twitter/timelines/suggests/common:engagement-java",
        "src/thrift/com/twitter/timelines/suggests/common:engagement-scala",
        "src/thrift/com/twitter/timelines/suggests/common:record-scala",
        "src/thrift/com/twitter/timelineservice/injection:thrift-scala",
        "src/thrift/com/twitter/timelineservice/server/suggests/logging:thrift-scala",
        "strato/src/main/scala/com/twitter/strato/client",
        "timelinemixer/common/src/main/scala/com/twitter/timelinemixer/clients/served_features_cache",
        "timelines/data_processing/ad_hoc/suggests/common:raw_training_data_creator",
        "timelines/data_processing/ml_util/aggregation_framework:common_types",
        "timelines/data_processing/ml_util/aggregation_framework/heron:configs",
        "timelines/data_processing/ml_util/aggregation_framework/metrics",
        "timelines/data_processing/ml_util/transforms",
        "timelines/data_processing/util:rich-request",
        "tweetsource/common/src/main/thrift:thrift-scala",
        "twitter-server-internal/src/main/scala",
        "unified_user_actions/client/src/main/scala/com/twitter/unified_user_actions/client/config",
        "unified_user_actions/client/src/main/scala/com/twitter/unified_user_actions/client/summingbird",
        "unified_user_actions/thrift/src/main/thrift/com/twitter/unified_user_actions:unified_user_actions-scala",
        "util/util-core:scala",
        "util/util-stats/src/main/scala/com/twitter/finagle/stats",
    ],
)

scala_library(
    name = "base-config",
    sources = [
        "AuthorFeaturesAdapter.scala",
        "TimelinesOnlineAggregationConfigBase.scala",
        "TweetFeaturesAdapter.scala",
        "UserFeaturesAdapter.scala",
    ],
    platform = "java8",
    strict_deps = True,
    tags = ["bazel-compatible"],
    dependencies = [
        "src/java/com/twitter/ml/api:api-base",
        "src/java/com/twitter/ml/api/constant",
        "src/resources/com/twitter/timelines/prediction/common/aggregates/real_time",
        "src/scala/com/twitter/ml/api/util:datarecord",
        "src/scala/com/twitter/ml/featurestore/catalog/datasets/magicrecs:user-features",
        "src/scala/com/twitter/ml/featurestore/catalog/entities/core",
        "src/scala/com/twitter/ml/featurestore/catalog/features/core:user",
        "src/scala/com/twitter/ml/featurestore/catalog/features/geo",
        "src/scala/com/twitter/ml/featurestore/catalog/features/magicrecs:user-activity",
        "src/scala/com/twitter/ml/featurestore/catalog/features/magicrecs:user-info",
        "src/scala/com/twitter/ml/featurestore/catalog/features/trends:tweet_trends_scores",
        "src/scala/com/twitter/ml/featurestore/lib/data",
        "src/scala/com/twitter/ml/featurestore/lib/feature",
        "src/scala/com/twitter/timelines/prediction/common/adapters:base",
        "src/scala/com/twitter/timelines/prediction/common/adapters:engagement-converter",
        "src/scala/com/twitter/timelines/prediction/common/aggregates",
        "src/scala/com/twitter/timelines/prediction/features/client_log_event",
        "src/scala/com/twitter/timelines/prediction/features/common",
        "src/scala/com/twitter/timelines/prediction/features/list_features",
        "src/scala/com/twitter/timelines/prediction/features/recap",
        "src/scala/com/twitter/timelines/prediction/features/user_health",
        "src/thrift/com/twitter/dal/personal_data:personal_data-java",
        "src/thrift/com/twitter/ml/api:feature_context-java",
        "src/thrift/com/twitter/timelines/suggests/common:engagement-scala",
        "timelines/data_processing/ml_util/aggregation_framework:common_types",
        "timelines/data_processing/ml_util/aggregation_framework/heron:base-config",
        "timelines/data_processing/ml_util/aggregation_framework/metrics",
        "timelines/data_processing/ml_util/transforms",
        "util/util-core:scala",
        "util/util-core:util-core-util",
    ],
)
