chromium/components/browser_ui/contacts_picker/android/BUILD.gn

# Copyright 2020 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")

source_set("android") {
  sources = [
    "contacts_picker_feature_map.cc",
    "features.cc",
    "features.h",
  ]
  deps = [
    ":contacts_picker_jni_headers",
    "//base",
  ]
}

android_library("java") {
  sources = [
    "java/src/org/chromium/components/browser_ui/contacts_picker/CompressContactIconsWorkerTask.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/ContactDetails.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/ContactView.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/ContactViewHolder.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/ContactsFetcherWorkerTask.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerDialog.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureList.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureMap.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerToolbar.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/FetchIconWorkerTask.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/PickerAdapter.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/PickerCategoryView.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/TopView.java",
  ]

  resources_package = "org.chromium.components.browser_ui.contacts_picker"
  deps = [
    ":java_resources",
    "//base:base_java",
    "//build/android:build_java",
    "//components/browser_ui/util/android:java",
    "//components/browser_ui/widget/android:java",
    "//components/payments/mojom:mojom_java",
    "//content/public/android:content_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_appcompat_appcompat_java",
    "//third_party/androidx:androidx_core_core_java",
    "//third_party/androidx:androidx_recyclerview_recyclerview_java",
    "//third_party/blink/public/mojom:android_mojo_bindings_java",
    "//third_party/jni_zero:jni_zero_java",
    "//ui/android:ui_java",
  ]
  srcjar_deps = [
    ":contacts_picker_jni_headers",
    "//content/public/browser:contacts_picker_properties_javagen",
  ]
}

generate_jni("contacts_picker_jni_headers") {
  sources = [ "java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureMap.java" ]
}

android_resources("java_resources") {
  sources = [
    "java/res/drawable/address.xml",
    "java/res/drawable/email.xml",
    "java/res/drawable/face.xml",
    "java/res/drawable/names.xml",
    "java/res/drawable/telephone.xml",
    "java/res/layout/checkbox_layout.xml",
    "java/res/layout/contact_view.xml",
    "java/res/layout/contacts_list_item_view.xml",
    "java/res/layout/contacts_picker_dialog.xml",
    "java/res/layout/contacts_picker_toolbar.xml",
    "java/res/layout/top_view.xml",
    "java/res/values/dimens.xml",
    "java/res/values/styles.xml",
  ]
  deps = [
    "//components/browser_ui/strings/android:browser_ui_strings_grd",
    "//components/browser_ui/styles/android:java_resources",
    "//components/browser_ui/widget/android:java_resources",
    "//ui/android:ui_java_resources",
  ]
}

android_library("unit_device_javatests") {
  testonly = true

  sources = [
    "java/src/org/chromium/components/browser_ui/contacts_picker/ContactDetailsTest.java",
    "java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerDialogTest.java",
  ]
  deps = [
    ":java",
    ":java_resources",
    "//base:base_java",
    "//base:base_java_test_support",
    "//chrome/test/android:chrome_java_unit_test_support",
    "//components/browser_ui/widget/android:java",
    "//components/browser_ui/widget/android:test_support_java",
    "//components/payments/mojom:mojom_java",
    "//content/public/android:content_java",
    "//content/public/test/android:content_java_test_support",
    "//third_party/androidx:androidx_appcompat_appcompat_java",
    "//third_party/androidx:androidx_appcompat_appcompat_resources_java",
    "//third_party/androidx:androidx_core_core_java",
    "//third_party/androidx:androidx_recyclerview_recyclerview_java",
    "//third_party/androidx:androidx_test_monitor_java",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/blink/public/mojom:android_mojo_bindings_java",
    "//third_party/junit",
    "//third_party/mockito:mockito_java",
    "//ui/android:ui_java",
    "//ui/android:ui_java_test_support",
  ]
  resources_package = "org.chromium.components.browser_ui.contacts_picker.test"
}