# Copyright 2020 The Chromium Authors. All rights reserved. # 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("//chrome/android/features/android_library_factory_tmpl.gni") # TODO(sinansahin): Decide which classes should stay in the public target, and # probably move MessageBanner* classes to internal/. android_library("java") { sources = [ "java/src/org/chromium/components/messages/MessageAutoDismissTimer.java", "java/src/org/chromium/components/messages/MessageBannerCoordinator.java", "java/src/org/chromium/components/messages/MessageBannerMediator.java", "java/src/org/chromium/components/messages/MessageBannerProperties.java", "java/src/org/chromium/components/messages/MessageBannerView.java", "java/src/org/chromium/components/messages/MessageBannerViewBinder.java", "java/src/org/chromium/components/messages/MessageContainer.java", "java/src/org/chromium/components/messages/MessageDispatcher.java", "java/src/org/chromium/components/messages/MessageDispatcherBridge.java", "java/src/org/chromium/components/messages/MessageDispatcherProvider.java", "java/src/org/chromium/components/messages/MessageStateHandler.java", "java/src/org/chromium/components/messages/MessageUtils.java", "java/src/org/chromium/components/messages/MessageUtilsBridge.java", "java/src/org/chromium/components/messages/MessageWrapper.java", "java/src/org/chromium/components/messages/SingleActionMessage.java", ] resources_package = "org.chromium.components.messages" annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] deps = [ ":java_resources", "//base:base_java", "//base:jni_java", "//components/browser_ui/banners/android:java", "//components/browser_ui/widget/android:java", "//content/public/android:content_java", "//third_party/android_deps:androidx_annotation_annotation_java", "//third_party/android_deps:androidx_appcompat_appcompat_resources_java", "//ui/android:ui_java", ] } android_resources("java_resources") { sources = [ "java/res/drawable/message_bg_tinted.xml", "java/res/layout/message_banner_view.xml", "java/res/values/dimens.xml", ] deps = [ "//components/browser_ui/strings/android:browser_ui_strings_grd", "//components/browser_ui/styles/android:java_resources", "//ui/android:ui_java_resources", ] } generate_jni("jni_headers") { sources = [ "java/src/org/chromium/components/messages/MessageDispatcherBridge.java", "java/src/org/chromium/components/messages/MessageUtilsBridge.java", "java/src/org/chromium/components/messages/MessageWrapper.java", ] } static_library("android") { sources = [ "message_dispatcher_bridge.cc", "message_dispatcher_bridge.h", "message_utils_bridge.cc", "message_utils_bridge.h", "message_wrapper.cc", "message_wrapper.h", ] deps = [ ":jni_headers", "//base", "//content/public/browser", ] } # Build target for Messages manager code, that owns and initializes # MessageDispatcher. android_library("manager_java") { sources = [ "java/src/org/chromium/components/messages/ManagedMessageDispatcher.java", "java/src/org/chromium/components/messages/MessageQueueDelegate.java", ] deps = [ ":java" ] } android_library_factory("factory_java") { sources = [ "internal/java/src/org/chromium/components/messages/MessagesFactory.java", ] deps = [ ":java", ":manager_java", "//ui/android:ui_full_java", ] } static_library("feature_flags") { sources = [ "messages_feature.cc", "messages_feature.h", ] deps = [ ":android", "//base", ] } android_library("javatests") { testonly = true sources = [ "java/src/org/chromium/components/messages/MessageBannerRenderTest.java", "java/src/org/chromium/components/messages/MessageBannerViewTest.java", "java/src/org/chromium/components/messages/SingleActionMessageTest.java", ] resources_package = "org.chromium.components.messages" deps = [ ":java", ":java_resources", "//base:base_java", "//base:base_java_test_support", "//content/public/test/android:content_java_test_support", "//third_party/android_deps:androidx_annotation_annotation_java", "//third_party/android_deps:androidx_appcompat_appcompat_java", "//third_party/android_deps:androidx_appcompat_appcompat_resources_java", "//third_party/android_deps:androidx_core_core_java", "//third_party/android_deps:androidx_test_runner_java", "//third_party/android_deps:espresso_java", "//third_party/android_support_test_runner:rules_java", "//third_party/android_support_test_runner:runner_java", "//third_party/junit", "//third_party/mockito:mockito_java", "//ui/android:ui_java", "//ui/android:ui_java_test_support", ] } java_library("junit") { # Skip platform checks since Robolectric depends on requires_android targets. bypass_platform_checks = true testonly = true sources = [ "java/src/org/chromium/components/messages/MessageAutoDismissTimerTest.java", "java/src/org/chromium/components/messages/MessageWrapperTest.java", ] deps = [ ":java", "//base:base_java_test_support", "//base:base_junit_test_support", "//third_party/android_deps:androidx_test_runner_java", "//third_party/android_deps:robolectric_all_java", "//third_party/junit", "//third_party/mockito:mockito_java", "//ui/android:ui_java", ] }