chromium/components/browser_ui/modaldialog/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")

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

android_library("java") {
  sources = [
    "java/src/org/chromium/components/browser_ui/modaldialog/AppModalPresenter.java",
    "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogFeatureList.java",
    "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogFeatureMap.java",
    "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogView.java",
    "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewBinder.java",
    "java/src/org/chromium/components/browser_ui/modaldialog/TabModalPresenter.java",
  ]

  deps = [
    ":java_resources",
    "//base:base_java",
    "//build/android:build_java",
    "//components/browser_ui/styles/android:java",
    "//components/browser_ui/widget/android:java",
    "//content/public/android:content_java",
    "//third_party/androidx:androidx_activity_activity_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_appcompat_appcompat_resources_java",
    "//third_party/androidx:androidx_core_core_java",
    "//third_party/androidx:androidx_interpolator_interpolator_java",
    "//third_party/androidx:androidx_vectordrawable_vectordrawable_animated_java",
    "//third_party/jni_zero:jni_zero_java",
    "//ui/android:ui_java",
  ]

  srcjar_deps = [ ":modaldialog_jni_headers" ]

  resources_package = "org.chromium.components.browser_ui.modaldialog"
}

generate_jni("modaldialog_jni_headers") {
  sources = [ "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogFeatureMap.java" ]
}

android_resources("java_resources") {
  sources = [
    "java/res/layout/modal_dialog_container.xml",
    "java/res/layout/modal_dialog_title.xml",
    "java/res/layout/modal_dialog_view.xml",
    "java/res/values-large/themes.xml",
    "java/res/values/dimens.xml",
    "java/res/values/ids.xml",
    "java/res/values/styles.xml",
    "java/res/values/themes.xml",
  ]

  deps = [
    "//components/browser_ui/styles/android:java_resources",
    "//components/browser_ui/widget/android:java_resources",
    "//ui/android:ui_java_resources",
  ]
}

android_library("test_support_java") {
  testonly = true

  sources = [ "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogTestUtils.java" ]

  deps = [
    ":java",
    ":java_test_resources",
    "//base:tasks_java",
    "//content/public/test/android:content_java_test_support",
    "//third_party/android_deps:espresso_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/junit:junit",
    "//ui/android:ui_java_test_support",
    "//ui/android:ui_no_recycler_view_java",
  ]

  resources_package = "org.chromium.components.browser_ui.modaldialog.test"
}

android_library("unit_device_javatests") {
  testonly = true
  resources_package = "org.chromium.components.browser_ui.modaldialog.test"

  sources = [
    "java/src/org/chromium/components/browser_ui/modaldialog/AppModalPresenterTest.java",
    "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewTest.java",
  ]

  deps = [
    ":java",
    ":java_resources",
    ":java_test_resources",
    ":test_support_java",
    "//base:base_java",
    "//base:base_java_test_support",
    "//base:base_java_test_support_uncommon",
    "//content/public/test/android:content_java_test_support",
    "//third_party/android_deps:espresso_java",
    "//third_party/androidx:androidx_activity_activity_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/junit:junit",
    "//ui/android:ui_java",
    "//ui/android:ui_java_test_support",
  ]
}

android_resources("java_test_resources") {
  testonly = true

  sources = [ "test/java/res/values/ids.xml" ]
  deps = [
    ":java_resources",
    "//components/browser_ui/strings/android:browser_ui_strings_grd",
    "//ui/android:ui_java_resources",
  ]
}