chromium/chrome/browser/segmentation_platform/BUILD.gn

# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

if (is_android) {
  import("//build/config/android/config.gni")
  import("//build/config/android/rules.gni")
  import("//third_party/jni_zero/jni_zero.gni")
}

if (is_android) {
  android_library("factory_java") {
    srcjar_deps = [ ":jni_headers" ]
    sources = [ "android/java/src/org/chromium/chrome/browser/segmentation_platform/SegmentationPlatformServiceFactory.java" ]

    deps = [
      "//base:base_java",
      "//build/android:build_java",
      "//chrome/browser/profiles/android:java",
      "//components/segmentation_platform/public:public_java",
      "//third_party/androidx:androidx_annotation_annotation_java",
      "//third_party/jni_zero:jni_zero_java",
    ]
  }

  android_library("javatests") {
    testonly = true

    sources = [ "android/javatests/src/org/chromium/chrome/browser/segmentation_platform/SegmentationPlatformServiceFactoryTest.java" ]
    deps = [
      "//base:base_java",
      "//base:base_java_test_support",
      "//chrome/browser/flags:java",
      "//chrome/browser/profiles/android:java",
      "//chrome/browser/segmentation_platform:factory_java",
      "//chrome/test/android:chrome_java_integration_test_support",
      "//components/segmentation_platform/public:public_java",
      "//third_party/androidx:androidx_test_runner_java",
      "//third_party/hamcrest:hamcrest_core_java",
      "//third_party/hamcrest:hamcrest_library_java",
      "//third_party/junit:junit",
      "//url:gurl_java",
    ]
  }

  generate_jni("jni_headers") {
    sources = [ "android/java/src/org/chromium/chrome/browser/segmentation_platform/SegmentationPlatformServiceFactory.java" ]
  }
}

static_library("test_utils") {
  testonly = true
  sources = [
    "ukm_data_manager_test_utils.cc",
    "ukm_data_manager_test_utils.h",
  ]
  deps = [
    "//base/test:test_support",
    "//chrome/browser",
    "//components/segmentation_platform/embedder",
    "//components/segmentation_platform/embedder/default_model:default_model_test_base",
    "//components/segmentation_platform/internal",
    "//components/segmentation_platform/internal:test_support",
    "//components/segmentation_platform/internal/proto",
    "//components/segmentation_platform/public",
    "//components/ukm:test_support",
    "//services/metrics/public/cpp:ukm_builders",
    "//testing/gmock",
  ]
}