chromium/chrome/browser/ui/android/webid/internal/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.

import("//build/config/android/rules.gni")
import("//build/config/locales.gni")
import("//chrome/common/features.gni")
import("//third_party/jni_zero/jni_zero.gni")
import("//tools/grit/grit_rule.gni")

generate_jni("jni") {
  sources = [ "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionBridge.java" ]
}

android_library("java") {
  deps = [
    ":java_resources",
    "//base:base_java",
    "//build/android:build_java",
    "//chrome/android:chrome_java",
    "//chrome/browser/flags:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/tab:java",
    "//chrome/browser/tabmodel:java",
    "//chrome/browser/ui/android/favicon:java",
    "//chrome/browser/ui/android/signin:java",
    "//chrome/browser/ui/android/webid:public_java",
    "//chrome/browser/util:java",
    "//components/browser_ui/bottomsheet/android:java",
    "//components/browser_ui/util/android:java",
    "//components/browser_ui/widget/android:java",
    "//components/embedder_support/android:simple_factory_key_java",
    "//components/embedder_support/android:util_java",
    "//components/favicon/android:java",
    "//components/image_fetcher:java",
    "//components/url_formatter/android:url_formatter_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_resources_java",
    "//third_party/androidx:androidx_browser_browser_java",
    "//third_party/androidx:androidx_recyclerview_recyclerview_java",
    "//third_party/blink/public/mojom:mojom_platform_java",
    "//third_party/jni_zero:jni_zero_java",
    "//ui/android:ui_java",
    "//url:gurl_java",
  ]

  srcjar_deps = [ ":jni" ]
  sources = [
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionBottomSheetContent.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionBridge.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionCoordinator.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionMediator.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionProperties.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionViewBinder.java",
  ]

  resources_package = "org.chromium.chrome.browser.ui.android.webid"
}

android_resources("java_resources") {
  deps = [
    "//chrome/browser/ui/android/strings:ui_strings_grd",
    "//components/browser_ui/widget/android:java_resources",
    "//ui/android:ui_java_resources",
  ]
  sources = [
    "java/res/drawable/arrow_range.xml",
    "java/res/layout/account_selection_account_item.xml",
    "java/res/layout/account_selection_add_account_button.xml",
    "java/res/layout/account_selection_add_account_row_item.xml",
    "java/res/layout/account_selection_button_mode_account_chip.xml",
    "java/res/layout/account_selection_button_mode_account_item.xml",
    "java/res/layout/account_selection_button_mode_continue_button.xml",
    "java/res/layout/account_selection_button_mode_data_sharing_consent_item.xml",
    "java/res/layout/account_selection_button_mode_header_item.xml",
    "java/res/layout/account_selection_button_mode_sheet.xml",
    "java/res/layout/account_selection_continue_button.xml",
    "java/res/layout/account_selection_data_sharing_consent_item.xml",
    "java/res/layout/account_selection_header_item.xml",
    "java/res/layout/account_selection_sheet.xml",
    "java/res/layout/error_description_text_item.xml",
    "java/res/layout/error_summary_text_item.xml",
    "java/res/layout/idp_signin_text_item.xml",
    "java/res/values/dimens.xml",
  ]
}

robolectric_library("junit") {
  resources_package = "org.chromium.chrome.browser.ui.android.webid"
  sources = [
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionButtonModeControllerTest.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionButtonModeViewTest.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionControllerTest.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionJUnitTestBase.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionViewTest.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionWidgetModeControllerTest.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionWidgetModeViewTest.java",
  ]

  deps = [
    ":java",
    ":java_resources",
    "//base:base_java",
    "//base:base_java_test_support",
    "//base:base_junit_test_support",
    "//chrome/browser/tab:java",
    "//chrome/browser/ui/android/favicon:java",
    "//chrome/browser/ui/android/signin:java",
    "//chrome/browser/ui/android/webid:public_java",
    "//chrome/browser/ui/android/webid/internal:java",
    "//components/browser_ui/bottomsheet/android:java",
    "//components/favicon/android:java",
    "//components/image_fetcher:java",
    "//components/url_formatter/android:url_formatter_java",
    "//content/public/android:content_java",
    "//third_party/androidx:androidx_annotation_annotation_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/blink/public/mojom:mojom_platform_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",
    "//url:gurl_java",
    "//url:gurl_junit_test_support",
  ]
}

android_library("javatests") {
  testonly = true
  resources_package = "org.chromium.chrome.browser.ui.android.webid"

  sources = [
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionButtonModeIntegrationTest.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionIntegrationTest.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionIntegrationTestBase.java",
    "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionWidgetModeIntegrationTest.java",
  ]

  deps = [
    ":java",
    ":java_resources",
    "//base:base_java",
    "//base:base_java_test_support",

    # TODO(majidvp): Remove this dependency after test clean up. https://crbug.com/1214820
    "//chrome/android:chrome_java",
    "//chrome/android:chrome_test_java",
    "//chrome/browser/flags:java",
    "//chrome/browser/tab:java",
    "//chrome/browser/tabmodel:java",
    "//chrome/browser/ui/android/webid:public_java",
    "//chrome/browser/webid:java",
    "//chrome/test/android:chrome_java_integration_test_support",
    "//components/browser_ui/bottomsheet/android:java",
    "//components/browser_ui/bottomsheet/android/test:java",
    "//components/image_fetcher:java",
    "//content/public/android:content_java",
    "//content/public/test/android:content_java_test_support",
    "//net/android:net_java_test_support",
    "//third_party/android_deps:espresso_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:mojom_platform_java",
    "//third_party/hamcrest:hamcrest_core_java",
    "//third_party/hamcrest:hamcrest_library_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",
    "//url:gurl_java",
    "//url:gurl_junit_test_support",
  ]
}