chromium/components/stylus_handwriting/android/BUILD.gn

# Copyright 2022 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")

android_aidl("direct_writing_service_aidl") {
  interface_file =
      "java/src/android/widget/directwriting/directwriting_common.aidl"
  sources = [
    "java/src/android/widget/directwriting/IDirectWritingService.aidl",
    "java/src/android/widget/directwriting/IDirectWritingServiceCallback.aidl",
  ]
}

static_library("android") {
  sources = [
    "//components/stylus_handwriting/android/stylus_handwriting_feature_map.cc",
    "//components/stylus_handwriting/android/stylus_handwriting_feature_map.h",
  ]

  deps = [
    ":feature_list_jni",
    "//base",
  ]
}

generate_jni("feature_list_jni") {
  sources = [ "java/src/org/chromium/components/stylus_handwriting/StylusHandwritingFeatureMap.java" ]
}

android_library("feature_list_java") {
  srcjar_deps = [ ":feature_list_jni" ]
  sources = [ "java/src/org/chromium/components/stylus_handwriting/StylusHandwritingFeatureMap.java" ]
  deps = [
    "//base:base_java",
    "//third_party/jni_zero:jni_zero_java",
  ]
}

android_library("java") {
  deps = [
    ":feature_list_java",
    "//base:base_java",
    "//content/public/android:content_full_java",
    "//mojo/public/mojom/base:base_java",
    "//third_party/androidx:androidx_annotation_annotation_experimental_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_core_core_java",
    "//third_party/blink/public/common:common_java",
    "//third_party/blink/public/mojom:mojom_platform_java",
    "//ui/android:ui_no_recycler_view_java",
    "//ui/gfx/geometry/mojom:mojom_java",
  ]
  srcjar_deps = [ ":direct_writing_service_aidl" ]
  sources = [
    "java/src/org/chromium/components/stylus_handwriting/AndroidStylusWritingHandler.java",
    "java/src/org/chromium/components/stylus_handwriting/DirectWritingBundleUtil.java",
    "java/src/org/chromium/components/stylus_handwriting/DirectWritingConstants.java",
    "java/src/org/chromium/components/stylus_handwriting/DirectWritingServiceBinder.java",
    "java/src/org/chromium/components/stylus_handwriting/DirectWritingServiceCallback.java",
    "java/src/org/chromium/components/stylus_handwriting/DirectWritingServiceConfiguration.java",
    "java/src/org/chromium/components/stylus_handwriting/DirectWritingSettingsHelper.java",
    "java/src/org/chromium/components/stylus_handwriting/DirectWritingTrigger.java",
    "java/src/org/chromium/components/stylus_handwriting/DisabledStylusWritingHandler.java",
    "java/src/org/chromium/components/stylus_handwriting/StylusApiOption.java",
    "java/src/org/chromium/components/stylus_handwriting/StylusHandwritingInitiator.java",
    "java/src/org/chromium/components/stylus_handwriting/StylusWritingController.java",
  ]
}

robolectric_library("junit_test_support") {
  sources = [
    "junit/src/org/chromium/components/stylus_handwriting/test_support/ShadowDirectWritingSettingsHelper.java",
    "junit/src/org/chromium/components/stylus_handwriting/test_support/ShadowGlobalSettings.java",
    "junit/src/org/chromium/components/stylus_handwriting/test_support/ShadowSecureSettings.java",
  ]
  deps = [ ":java" ]
}

robolectric_library("stylus_handwriting_junit_tests") {
  sources = [
    "junit/src/org/chromium/components/stylus_handwriting/AndroidStylusWritingHandlerTest.java",
    "junit/src/org/chromium/components/stylus_handwriting/DirectWritingServiceBinderTest.java",
    "junit/src/org/chromium/components/stylus_handwriting/DirectWritingServiceCallbackTest.java",
    "junit/src/org/chromium/components/stylus_handwriting/DirectWritingTriggerTest.java",
    "junit/src/org/chromium/components/stylus_handwriting/StylusHandwritingInitiatorTest.java",
    "junit/src/org/chromium/components/stylus_handwriting/StylusWritingControllerTest.java",
  ]
  deps = [
    ":java",
    ":junit_test_support",
    "//base:base_java",
    "//base:base_java_test_support",
    "//base:base_junit_test_support",
    "//content/public/android:content_full_java",
    "//mojo/public/mojom/base:base_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_test_monitor_java",
    "//third_party/blink/public:blink_headers_java",
    "//third_party/blink/public/mojom:mojom_platform_java",
    "//third_party/junit:junit",
    "//third_party/mockito:mockito_java",
    "//ui/android:ui_no_recycler_view_java",
    "//ui/gfx/geometry/mojom:mojom_java",
  ]
}