chromium/components/javascript_dialogs/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("//build/config/locales.gni")
import("//third_party/jni_zero/jni_zero.gni")
import("//tools/grit/grit_rule.gni")

android_library("java") {
  srcjar_deps = [ ":jni_headers" ]
  sources = [
    "java/src/org/chromium/components/javascript_dialogs/JavascriptAppModalDialog.java",
    "java/src/org/chromium/components/javascript_dialogs/JavascriptDialogCustomView.java",
    "java/src/org/chromium/components/javascript_dialogs/JavascriptModalDialog.java",
    "java/src/org/chromium/components/javascript_dialogs/JavascriptTabModalDialog.java",
  ]

  resources_package = "org.chromium.components.javascript_dialogs"

  deps = [
    ":java_resources",
    "//base:base_java",
    "//build/android:build_java",
    "//components/browser_ui/styles/android:java",
    "//components/browser_ui/widget/android:java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/jni_zero:jni_zero_java",
    "//ui/android:ui_java",
  ]
}

android_resources("java_resources") {
  sources = [ "java/res/layout/js_modal_dialog.xml" ]

  deps = [
    ":javascript_dialogs_strings_grd",
    "//components/browser_ui/strings/android:browser_ui_strings_grd",
    "//components/browser_ui/styles/android:java_resources",
  ]
}

generate_jni("jni_headers") {
  sources = [
    "java/src/org/chromium/components/javascript_dialogs/JavascriptAppModalDialog.java",
    "java/src/org/chromium/components/javascript_dialogs/JavascriptTabModalDialog.java",
  ]
}

java_strings_grd("javascript_dialogs_strings_grd") {
  grd_file = "javascript_dialogs_android_strings.grd"
  outputs = [ "values/javascript_dialogs_android_strings.xml" ] + process_file_template(
                android_bundle_locales_as_resources,
                [ "values-{{source_name_part}}/javascript_dialogs_android_strings.xml" ])
}