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

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

java_cpp_enum("autofill_generated_enums") {
  sources = [
    "//chrome/browser/android/preferences/autofill/autofill_profile_bridge.h",
    "//chrome/browser/autofill/android/android_autofill_availability_status.h",
  ]
}

android_library("java") {
  sources = [
    "java/src/org/chromium/chrome/browser/autofill/AddressNormalizerFactory.java",
    "java/src/org/chromium/chrome/browser/autofill/AutofillAddress.java",
    "java/src/org/chromium/chrome/browser/autofill/AutofillClientProviderUtils.java",
    "java/src/org/chromium/chrome/browser/autofill/AutofillEditorBase.java",
    "java/src/org/chromium/chrome/browser/autofill/AutofillImageFetcher.java",
    "java/src/org/chromium/chrome/browser/autofill/AutofillProfileBridge.java",
    "java/src/org/chromium/chrome/browser/autofill/AutofillUiUtils.java",
    "java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java",
    "java/src/org/chromium/chrome/browser/autofill/PersonalDataManagerFactory.java",
    "java/src/org/chromium/chrome/browser/autofill/PhoneNumberUtil.java",
    "java/src/org/chromium/chrome/browser/autofill/SubKeyRequesterFactory.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/AddressEditorCoordinator.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/AddressEditorMediator.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/DropdownFieldAdapter.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/DropdownFieldView.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/EditorBase.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/EditorDialogToolbar.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/EditorDialogView.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/EditorDialogViewBinder.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/EditorFieldValidator.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/EditorObserverForTest.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/EditorProperties.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/FieldView.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/HintedDropDownAdapter.java",
    "java/src/org/chromium/chrome/browser/autofill/editors/TextFieldView.java",
    "java/src/org/chromium/chrome/browser/autofill/helpers/FaviconHelper.java",
    "java/src/org/chromium/chrome/browser/autofill/options/AutofillOptionsCoordinator.java",
    "java/src/org/chromium/chrome/browser/autofill/options/AutofillOptionsFragment.java",
    "java/src/org/chromium/chrome/browser/autofill/options/AutofillOptionsMediator.java",
    "java/src/org/chromium/chrome/browser/autofill/options/AutofillOptionsProperties.java",
    "java/src/org/chromium/chrome/browser/autofill/options/AutofillOptionsViewBinder.java",
    "java/src/org/chromium/chrome/browser/autofill/options/RadioButtonGroupThirdPartyPreference.java",
  ]

  resources_package = "org.chromium.chrome.browser.autofill"

  deps = [
    ":java_resources",
    "//base:base_java",
    "//build/android:build_java",
    "//chrome/android:chrome_app_java_resources",
    "//chrome/browser/android/customtabs/branding:java",
    "//chrome/browser/feedback/android:factory_java",
    "//chrome/browser/feedback/android:java",
    "//chrome/browser/feedback/android:java_resources",
    "//chrome/browser/flags:java",
    "//chrome/browser/preferences:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/settings:java",
    "//chrome/browser/signin/services/android:java",
    "//chrome/browser/sync/android:java",
    "//chrome/browser/ui/android/favicon:java",
    "//chrome/browser/util:java",
    "//components/autofill/android:autofill_features_java",
    "//components/autofill/android:autofill_java",
    "//components/autofill/android:autofill_java_resources",
    "//components/autofill/android:autofill_payments_java_resources",
    "//components/autofill/android:main_autofill_java",
    "//components/browser_ui/settings/android:java",
    "//components/browser_ui/styles/android:java",
    "//components/browser_ui/styles/android:java_resources",
    "//components/browser_ui/util/android:java",
    "//components/browser_ui/widget/android:java",
    "//components/browser_ui/widget/android:java_resources",
    "//components/embedder_support/android:simple_factory_key_java",
    "//components/favicon/android:java",
    "//components/image_fetcher:java",
    "//components/payments/mojom:mojom_java",
    "//components/prefs/android:java",
    "//components/signin/public/android:java",
    "//components/sync/android:sync_java",
    "//components/user_prefs/android:java",
    "//content/public/android:content_full_java",
    "//third_party/android_deps:material_design_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_annotation_annotation_jvm_java",
    "//third_party/androidx:androidx_appcompat_appcompat_java",
    "//third_party/androidx:androidx_appcompat_appcompat_resources_java",
    "//third_party/androidx:androidx_appcompat_appcompat_resources_java",
    "//third_party/androidx:androidx_core_core_java",
    "//third_party/androidx:androidx_core_core_java",
    "//third_party/androidx:androidx_fragment_fragment_java",
    "//third_party/androidx:androidx_interpolator_interpolator_java",
    "//third_party/androidx:androidx_lifecycle_lifecycle_common_java",
    "//third_party/androidx:androidx_lifecycle_lifecycle_livedata_core_java",
    "//third_party/androidx:androidx_preference_preference_java",
    "//third_party/androidx:androidx_vectordrawable_vectordrawable_java",
    "//third_party/jni_zero:jni_zero_java",
    "//ui/android:ui_no_recycler_view_java",
    "//ui/android:ui_utils_java",
    "//url:gurl_java",
  ]

  public_deps = [ "//components/autofill/android:autofill_java" ]

  srcjar_deps = [
    ":autofill_generated_enums",
    ":jni_headers",
  ]
}

android_library("bottom_sheet_utils_java") {
  sources = [ "java/src/org/chromium/chrome/browser/autofill/bottom_sheet_utils/DetailScreenScrollListener.java" ]

  deps = [
    "//base:base_java",
    "//components/browser_ui/bottomsheet/android:java",
    "//third_party/androidx:androidx_annotation_annotation_jvm_java",
    "//third_party/androidx:androidx_recyclerview_recyclerview_java",
  ]
}

generate_jni("jni_headers") {
  sources = [
    "java/src/org/chromium/chrome/browser/autofill/AddressNormalizerFactory.java",
    "java/src/org/chromium/chrome/browser/autofill/AutofillClientProviderUtils.java",
    "java/src/org/chromium/chrome/browser/autofill/AutofillImageFetcher.java",
    "java/src/org/chromium/chrome/browser/autofill/AutofillProfileBridge.java",
    "java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java",
    "java/src/org/chromium/chrome/browser/autofill/PhoneNumberUtil.java",
    "java/src/org/chromium/chrome/browser/autofill/SubKeyRequesterFactory.java",
  ]
}

android_resources("java_resources") {
  deps = [ "//components/strings:components_strings_grd" ]
  sources = [
    "java/res/drawable/store_locally_tooltip_background.xml",
    "java/res/layout/autofill_editor_base.xml",
    "java/res/layout/autofill_editor_base_buttons.xml",
    "java/res/layout/autofill_local_card_editor.xml",
    "java/res/layout/autofill_local_iban_editor.xml",
    "java/res/layout/editable_option_editor_footer.xml",
    "java/res/layout/payment_request_editor.xml",
    "java/res/layout/payment_request_editor_dropdown.xml",
    "java/res/layout/payments_request_editor_textview.xml",
    "java/res/layout/radio_button_group_third_party_preference.xml",
    "java/res/menu/prefeditor_editor_menu.xml",
    "java/res/values/dimens.xml",
    "java/res/xml/autofill_options_preferences.xml",
  ]
}

android_library("test_java") {
  testonly = true
  resources_package = "org.chromium.chrome.browser.autofill"

  sources = [
    "javatest/src/org/chromium/chrome/browser/autofill/editors/AddressEditorRenderTest.java",
    "javatest/src/org/chromium/chrome/browser/autofill/editors/DropdownFieldViewTest.java",
  ]

  deps = [
    ":java",
    "//base:base_java",
    "//base:base_java_test_support",
    "//chrome/android:chrome_java",
    "//chrome/android:chrome_test_java",
    "//chrome/android:chrome_test_util_java",
    "//chrome/browser/feedback/android:java",
    "//chrome/browser/flags:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/signin/services/android:java",
    "//chrome/browser/sync/android:java",
    "//chrome/browser/ui/android/night_mode:night_mode_java_test_support",
    "//chrome/browser/util:java",
    "//chrome/test/android:chrome_java_integration_test_support",
    "//components/autofill/android:autofill_features_java",
    "//components/autofill/android:main_autofill_java",
    "//components/signin/public/android:java",
    "//components/sync/android:sync_java",
    "//content/public/test/android:content_java_test_support",
    "//third_party/android_deps:material_design_java",
    "//third_party/androidx:androidx_test_rules_java",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/jni_zero:jni_zero_java",
    "//third_party/junit",
    "//third_party/mockito:mockito_java",
    "//ui/android:ui_full_java",
    "//ui/android:ui_java_test_support",
    "//ui/android:ui_utils_java",
  ]
}

robolectric_library("junit") {
  resources_package = "org.chromium.chrome.browser.autofill"

  sources = [
    "junit/src/org/chromium/chrome/browser/autofill/editors/AddressEditorTest.java",
    "junit/src/org/chromium/chrome/browser/autofill/editors/DropdownFieldViewUnitTest.java",
    "junit/src/org/chromium/chrome/browser/autofill/editors/TextFieldViewUnitTest.java",
    "junit/src/org/chromium/chrome/browser/autofill/options/AutofillOptionsTest.java",
  ]

  deps = [
    ":java",
    ":java_resources",
    "//base:base_java",
    "//base:base_java_test_support",
    "//base:base_junit_test_support",
    "//chrome/browser/feedback/android:factory_java",
    "//chrome/browser/feedback/android:java",
    "//chrome/browser/flags:java",
    "//chrome/browser/preferences:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/signin/services/android:java",
    "//chrome/browser/sync/android:java",
    "//chrome/test/android:chrome_java_unit_test_support",
    "//components/autofill/android:autofill_features_java",
    "//components/autofill/android:main_autofill_java",
    "//components/browser_ui/settings/android:java",
    "//components/browser_ui/widget/android:java",
    "//components/prefs/android:java",
    "//components/signin/public/android:java",
    "//components/sync/android:sync_java",
    "//components/user_prefs/android:java",
    "//content/public/android:content_full_java",
    "//third_party/android_deps:material_design_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_fragment_fragment_java",
    "//third_party/androidx:androidx_fragment_fragment_testing_java",
    "//third_party/androidx:androidx_lifecycle_lifecycle_common_java",
    "//third_party/androidx:androidx_lifecycle_lifecycle_runtime_java",
    "//third_party/androidx:androidx_recyclerview_recyclerview_java",
    "//third_party/androidx:androidx_test_core_java",
    "//third_party/androidx:androidx_test_ext_junit_java",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/jni_zero:jni_zero_java",
    "//third_party/junit",
    "//third_party/mockito:mockito_java",
    "//ui/android:ui_full_java",
    "//ui/android:ui_java_test_support",
  ]
}