chromium/components/installedapp/android/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("//third_party/jni_zero/jni_zero.gni")

source_set("android") {
  sources = [ "installed_app_verifier.cc" ]
  deps = [
    "//base",
    "//components/content_relationship_verification",
    "//content/public/browser",
  ]
  public_deps = [ ":jni_headers" ]
}

android_library("java") {
  srcjar_deps = [ ":jni_headers" ]
  sources = [
    "java/src/org/chromium/components/installedapp/InstalledAppProviderImpl.java",
    "java/src/org/chromium/components/installedapp/PackageHash.java",
    "java/src/org/chromium/components/installedapp/PackageManagerDelegate.java",
  ]

  deps = [
    "//base:base_java",
    "//build/android:build_java",
    "//components/webapk/android/libs/client:java",
    "//content/public/android:content_java",
    "//mojo/public/java:system_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/blink/public/mojom:android_mojo_bindings_java",
    "//third_party/jni_zero:jni_zero_java",
    "//url:gurl_java",
    "//url/mojom:url_mojom_gurl_java",
  ]
}

generate_jni("jni_headers") {
  sources = [
    "java/src/org/chromium/components/installedapp/InstalledAppProviderImpl.java",
    "java/src/org/chromium/components/installedapp/PackageHash.java",
  ]
}

android_library("unit_device_javatests") {
  testonly = true

  sources = [ "java/src/org/chromium/components/installedapp/InstalledAppProviderTest.java" ]
  deps = [
    ":java",
    "//base:base_java",
    "//base:base_java_test_support",
    "//content/public/android:content_java",
    "//content/public/test/android:content_java_test_support",
    "//third_party/androidx:androidx_test_rules_java",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/blink/public/mojom:android_mojo_bindings_java",
    "//third_party/jni_zero:jni_zero_java",
    "//third_party/junit",
    "//third_party/mockito:mockito_java",
    "//url:gurl_java",
    "//url/mojom:url_mojom_gurl_java",
  ]
}

robolectric_library("junit") {
  sources =
      [ "java/src/org/chromium/components/installedapp/PackageHashTest.java" ]
  deps = [
    ":java",
    "//base:base_java_test_support",
    "//base:base_junit_test_support",
    "//base/test:test_support_java",
    "//content/public/android:content_full_java",
    "//third_party/junit",
  ]
}