chromium/chrome/browser/profiles/android/BUILD.gn

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

import("//build/config/android/rules.gni")
import("//third_party/jni_zero/jni_zero.gni")

# Keep profiles and cookies in the same target due to bi-directional dependency
# between Profile and CookiesFetcher.
android_library("java") {
  deps = [
    "//base:base_java",
    "//build/android:build_java",
    "//chrome/browser/android/crypto:java",
    "//chrome/browser/preferences:java",
    "//components/embedder_support/android:browser_context_java",
    "//components/embedder_support/android:simple_factory_key_java",
    "//components/profile_metrics:browser_profile_type_enum_java",
    "//content/public/android:content_full_java",
    "//content/public/android:content_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/jni_zero:jni_zero_java",
  ]

  srcjar_deps = [ ":jni_headers" ]
  sources = [
    "java/src/org/chromium/chrome/browser/cookies/CanonicalCookie.java",
    "java/src/org/chromium/chrome/browser/cookies/CookiesFetcher.java",
    "java/src/org/chromium/chrome/browser/profiles/OTRProfileID.java",
    "java/src/org/chromium/chrome/browser/profiles/OriginalProfileSupplier.java",
    "java/src/org/chromium/chrome/browser/profiles/Profile.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileKey.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileKeyUtil.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileKeyedMap.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileManager.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileManagerUtils.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileProvider.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileResolver.java",
  ]
}

generate_jni("jni_headers") {
  sources = [
    "java/src/org/chromium/chrome/browser/cookies/CookiesFetcher.java",
    "java/src/org/chromium/chrome/browser/profiles/OTRProfileID.java",
    "java/src/org/chromium/chrome/browser/profiles/Profile.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileKey.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileKeyUtil.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileManager.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileManagerUtils.java",
    "java/src/org/chromium/chrome/browser/profiles/ProfileResolver.java",
  ]
}

robolectric_library("junit") {
  sources = [
    "java/src/org/chromium/chrome/browser/profiles/ProfileKeyedMapTest.java",
  ]

  deps = [
    ":java",
    "//base:base_java",
    "//base:base_junit_test_support",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/junit",
    "//third_party/mockito:mockito_java",
  ]
}