chromium/components/browser_ui/share/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 = [
    "intent_helper.cc",
    "intent_helper.h",
  ]
  deps = [
    ":jni_headers",
    "//base",
  ]
}

generate_jni("jni_headers") {
  sources =
      [ "java/src/org/chromium/components/browser_ui/share/IntentHelper.java" ]
}

# Constants only target without dependencies to allow embedders to only include relevant code.
android_library("constants_java") {
  sources = [
    "java/src/org/chromium/components/browser_ui/share/ClipboardConstants.java",
  ]
}

android_library("java") {
  sources = [
    "java/src/org/chromium/components/browser_ui/share/ClipboardImageFileProvider.java",
    "java/src/org/chromium/components/browser_ui/share/IntentHelper.java",
    "java/src/org/chromium/components/browser_ui/share/ShareDialogAdapter.java",
    "java/src/org/chromium/components/browser_ui/share/ShareHelper.java",
    "java/src/org/chromium/components/browser_ui/share/ShareImageFileUtils.java",
    "java/src/org/chromium/components/browser_ui/share/ShareParams.java",
  ]
  deps = [
    ":constants_java",
    ":java_resources",
    "//base:base_java",
    "//components/browser_ui/util/android:java",
    "//components/browser_ui/widget/android:java_resources",
    "//components/dom_distiller/core/android:dom_distiller_core_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/jni_zero:jni_zero_java",
    "//ui/android:ui_java",
    "//url:gurl_java",
  ]
  resources_package = "org.chromium.components.browser_ui.share"
}

android_resources("java_resources") {
  sources = [ "java/res/layout/share_dialog_item.xml" ]
  deps = [
    "//components/browser_ui/strings/android:browser_ui_strings_grd",
    "//components/browser_ui/styles/android:java_resources",
  ]
}

android_library("javatests") {
  testonly = true

  sources = [
    "java/src/org/chromium/components/browser_ui/share/ClipboardImageFileProviderUnitTest.java",
    "java/src/org/chromium/components/browser_ui/share/ShareImageFileUtilsTest.java",
  ]
  deps = [
    ":constants_java",
    ":java",
    "//base:base_java",
    "//base:base_java_test_support",
    "//chrome/android:chrome_java",
    "//content/public/test/android:content_java_test_support",
    "//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_test_runner_java",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/junit",
    "//third_party/mockito:mockito_java",
    "//ui/android:ui_java",
    "//ui/android:ui_java_test_support",
  ]
}