blob: 4dcbaa97d8a2b4ca0d4e5ef04731f93a27958431 [file] [log] [blame]
# Copyright 2019 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")
# Minimal Java library for the DownloadFileProvider which will be included in
# the base module.
android_library("file_provider_java") {
sources = [
"java/src/org/chromium/chrome/browser/download/DirectoryOption.java",
"java/src/org/chromium/chrome/browser/download/DownloadDirectoryProvider.java",
"java/src/org/chromium/chrome/browser/download/DownloadFileProvider.java",
]
deps = [
"//base:base_java",
"//components/embedder_support/android:util_java",
"//content/public/android:content_main_dex_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//third_party/androidx:androidx_core_core_java",
]
}
android_library("java") {
sources = [
"java/src/org/chromium/chrome/browser/download/DownloadConstants.java",
"java/src/org/chromium/chrome/browser/download/DownloadDelegateImpl.java",
"java/src/org/chromium/chrome/browser/download/DownloadDialogBridge.java",
"java/src/org/chromium/chrome/browser/download/DownloadFilter.java",
"java/src/org/chromium/chrome/browser/download/DownloadInfo.java",
"java/src/org/chromium/chrome/browser/download/DownloadLaterMetrics.java",
"java/src/org/chromium/chrome/browser/download/DownloadLocationDialogMetrics.java",
"java/src/org/chromium/chrome/browser/download/DownloadManagerBridge.java",
"java/src/org/chromium/chrome/browser/download/DownloadStartupUtils.java",
"java/src/org/chromium/chrome/browser/download/DownloadStatus.java",
"java/src/org/chromium/chrome/browser/download/MediaStoreHelper.java",
"java/src/org/chromium/chrome/browser/download/MimeUtils.java",
"java/src/org/chromium/chrome/browser/download/StringUtils.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadDateTimePickerDialog.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadDateTimePickerDialogImpl.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadDateTimePickerDialogProperties.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadDialogUtils.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogChoice.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogController.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogCoordinator.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogHelper.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogProperties.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogView.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogController.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadTimePickerDialog.java",
"java/src/org/chromium/chrome/browser/download/home/DownloadManagerCoordinator.java",
"java/src/org/chromium/chrome/browser/download/home/DownloadManagerUiConfig.java",
"java/src/org/chromium/chrome/browser/download/home/DownloadManagerUiConfigHelper.java",
"java/src/org/chromium/chrome/browser/download/home/FaviconProvider.java",
"java/src/org/chromium/chrome/browser/download/home/JustNowProvider.java",
"java/src/org/chromium/chrome/browser/download/home/LegacyDownloadProvider.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadDirectoryAdapter.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadLocationPreference.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadLocationPreferenceAdapter.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadLocationPreferenceDialog.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadSettings.java",
]
deps = [
":file_provider_java",
":java_resources",
"//base:base_java",
"//chrome/browser/flags:java",
"//chrome/browser/offline_pages/android:java",
"//chrome/browser/preferences:java",
"//chrome/browser/profiles/android:java",
"//chrome/browser/ui/messages/android:java",
"//chrome/browser/util:java",
"//components/browser_ui/modaldialog/android:java",
"//components/browser_ui/settings/android:java",
"//components/browser_ui/util/android:java",
"//components/browser_ui/widget/android:java",
"//components/download/internal/common:internal_java",
"//components/download/public/common:public_java",
"//components/embedder_support/android:util_java",
"//components/feature_engagement:feature_engagement_java",
"//components/feed/core/shared_prefs:feed_shared_prefs",
"//components/offline_items_collection/core:core_java",
"//components/prefs/android:java",
"//components/user_prefs/android:java",
"//content/public/android:content_java",
"//third_party/android_deps:material_design_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//third_party/androidx:androidx_core_core_java",
"//third_party/androidx:androidx_fragment_fragment_java",
"//third_party/androidx:androidx_preference_preference_java",
"//ui/android:ui_java",
]
srcjar_deps = [ "//chrome:download_enum_javagen" ]
resources_package = "org.chromium.chrome.browser.download"
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
android_library_factory("factory_java") {
# These deps will be inherited by the resulting android_library target.
deps = [
":java",
"//base:base_java",
"//chrome/browser/ui/messages/android:java",
"//components/feature_engagement:feature_engagement_java",
"//components/offline_items_collection/core:core_java",
"//components/prefs/android:java",
"//ui/android:ui_java",
]
# This internal file will be replaced by a generated file so the resulting
# android_library target does not actually depend on this internal file.
sources = [ "//chrome/browser/download/internal/android/java/src/org/chromium/chrome/browser/download/home/DownloadManagerCoordinatorFactory.java" ]
}
generate_jni("jni_headers") {
sources = [
"java/src/org/chromium/chrome/browser/download/DownloadDialogBridge.java",
"java/src/org/chromium/chrome/browser/download/DownloadInfo.java",
"java/src/org/chromium/chrome/browser/download/DownloadManagerBridge.java",
"java/src/org/chromium/chrome/browser/download/DownloadStartupUtils.java",
"java/src/org/chromium/chrome/browser/download/MimeUtils.java",
"java/src/org/chromium/chrome/browser/download/StringUtils.java",
]
}
android_library("download_java_tests") {
testonly = true
sources = [
"javatests/src/org/chromium/chrome/browser/download/DownloadFileProviderTest.java",
"javatests/src/org/chromium/chrome/browser/download/MimeUtilsTest.java",
"javatests/src/org/chromium/chrome/browser/download/StringUtilsTest.java",
]
deps = [
":file_provider_java",
":java",
"//base:base_java",
"//base:base_java_test_support",
"//chrome/browser/flags:java",
"//chrome/test/android:chrome_java_test_support",
"//components/browser_ui/util/android:java",
"//components/offline_items_collection/core:core_java",
"//third_party/android_support_test_runner:runner_java",
"//third_party/androidx:androidx_test_runner_java",
"//third_party/junit",
"//third_party/mockito:mockito_java",
]
}
android_library("junit_tests") {
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
bypass_platform_checks = true
testonly = true
sources = [
"java/src/org/chromium/chrome/browser/download/DownloadDialogBridgeUnitTest.java",
"java/src/org/chromium/chrome/browser/download/DownloadDirectoryProviderUnitTest.java",
"java/src/org/chromium/chrome/browser/download/DownloadLaterMetricsUnitTest.java",
"java/src/org/chromium/chrome/browser/download/DownloadLocationDialogMetricsUnitTest.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadDialogUtilsUnitTest.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogHelperUnitTest.java",
]
deps = [
":file_provider_java",
":java",
"//base:base_java",
"//base:base_java_test_support",
"//base:base_junit_test_support",
"//chrome/browser/flags:java",
"//chrome/browser/preferences:java",
"//chrome/test/android:chrome_java_test_support",
"//components/offline_items_collection/core:core_java",
"//components/prefs/android:java",
"//third_party/android_deps:robolectric_all_java",
"//third_party/junit",
"//third_party/mockito:mockito_java",
"//ui/android:ui_full_java",
]
}
android_resources("java_resources") {
sources = [
"java/res/layout/confirm_oma_download.xml",
"java/res/layout/download_later_dialog.xml",
"java/res/layout/download_location_dialog.xml",
"java/res/layout/download_location_preference.xml",
"java/res/layout/download_location_preference_item.xml",
"java/res/layout/download_location_spinner_dropdown_item.xml",
"java/res/layout/download_location_spinner_item.xml",
"java/res/values-v17/dimens.xml",
"java/res/values-v17/styles.xml",
"java/res/xml/download_preferences.xml",
]
deps = [
"//chrome/browser/ui/android/strings:ui_strings_grd",
"//components/browser_ui/modaldialog/android:java_resources",
"//components/browser_ui/strings/android:browser_ui_strings_grd",
"//components/browser_ui/styles/android:java_resources",
"//components/browser_ui/widget/android:java_resources",
"//ui/android:ui_java_resources",
]
}