blob: 65054fdb12df7e0729827b5711212942ff4563d1 [file] [log] [blame]
# Copyright 2017 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("//android_webview/system_webview_apk_tmpl.gni")
import("//android_webview/variables.gni")
import("//build/config/android/rules.gni")
generate_jni("nonembedded_jni_headers") {
sources = [
"java/src/org/chromium/android_webview/nonembedded/AwComponentUpdateService.java",
"java/src/org/chromium/android_webview/nonembedded/NetworkFetcherTask.java",
"java/src/org/chromium/android_webview/nonembedded/WebViewApkApplication.java",
"java/src/org/chromium/android_webview/services/ComponentsProviderPathUtil.java",
]
}
# Contains classes needed by the webview apk, but not used when loading the apk
# as a library.
android_library("nonembedded_java") {
sources = [
"java/src/org/chromium/android_webview/nonembedded/AwComponentUpdateService.java",
"java/src/org/chromium/android_webview/nonembedded/AwNonembeddedUmaRecorder.java",
"java/src/org/chromium/android_webview/nonembedded/LicenseActivity.java",
"java/src/org/chromium/android_webview/nonembedded/LicenseContentProvider.java",
"java/src/org/chromium/android_webview/nonembedded/NetworkFetcherTask.java",
"java/src/org/chromium/android_webview/nonembedded/WebViewApkApplication.java",
]
deps = [
":devui_java",
":services_java",
"//android_webview:android_webview_product_config_java",
"//android_webview:common_aidl_java",
"//android_webview:common_java",
"//android_webview/glue:glue_java",
"//android_webview/proto:metrics_bridge_records_proto_java",
"//base:base_java",
"//components/about_ui/android:aboutui_java",
"//components/embedder_support/android:application_java",
"//components/version_info/android:version_constants_java",
"//third_party/android_deps:com_google_code_findbugs_jsr305_java",
"//third_party/android_deps:protobuf_lite_runtime_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//ui/android:ui_no_recycler_view_java",
"//url:gurl_java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
android_library("devui_java") {
sources = [
"java/src/org/chromium/android_webview/devui/CrashesListFragment.java",
"java/src/org/chromium/android_webview/devui/DevUiBaseFragment.java",
"java/src/org/chromium/android_webview/devui/FlagsFragment.java",
"java/src/org/chromium/android_webview/devui/HomeFragment.java",
"java/src/org/chromium/android_webview/devui/MainActivity.java",
"java/src/org/chromium/android_webview/devui/PersistentErrorView.java",
"java/src/org/chromium/android_webview/devui/WebViewPackageError.java",
"java/src/org/chromium/android_webview/devui/util/CrashBugUrlFactory.java",
"java/src/org/chromium/android_webview/devui/util/CrashInfoLoader.java",
"java/src/org/chromium/android_webview/devui/util/UnuploadedFilesStateLoader.java",
"java/src/org/chromium/android_webview/devui/util/UploadedCrashesInfoLoader.java",
"java/src/org/chromium/android_webview/devui/util/WebViewCrashInfoCollector.java",
"java/src/org/chromium/android_webview/devui/util/WebViewCrashLogParser.java",
"java/src/org/chromium/android_webview/devui/util/WebViewPackageHelper.java",
]
deps = [
":devui_resources",
":system_webview_manifest",
"//android_webview:common_aidl_java",
"//android_webview:common_crash_java",
"//android_webview:common_java",
"//android_webview:common_platform_services_java",
"//base:base_java",
"//components/minidump_uploader:minidump_uploader_java",
"//components/version_info/android:version_constants_java",
"//third_party/androidx:androidx_activity_activity_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_lifecycle_lifecycle_common_java",
"//third_party/androidx:androidx_lifecycle_lifecycle_viewmodel_java",
"//third_party/androidx:androidx_savedstate_savedstate_java",
"//ui/android:ui_no_recycler_view_java",
]
resources_package = "org.chromium.android_webview.devui"
}
android_library("services_java") {
sources = [
"java/src/org/chromium/android_webview/services/AwMinidumpUploadJobService.java",
"java/src/org/chromium/android_webview/services/AwMinidumpUploaderDelegate.java",
"java/src/org/chromium/android_webview/services/AwVariationsSeedFetcher.java",
"java/src/org/chromium/android_webview/services/ComponentsProviderPathUtil.java",
"java/src/org/chromium/android_webview/services/ComponentsProviderService.java",
"java/src/org/chromium/android_webview/services/CrashReceiverService.java",
"java/src/org/chromium/android_webview/services/DeveloperModeContentProvider.java",
"java/src/org/chromium/android_webview/services/DeveloperUiService.java",
"java/src/org/chromium/android_webview/services/MetricsBridgeService.java",
"java/src/org/chromium/android_webview/services/SafeModeContentProvider.java",
"java/src/org/chromium/android_webview/services/SafeModeService.java",
"java/src/org/chromium/android_webview/services/VariationsSeedHolder.java",
"java/src/org/chromium/android_webview/services/VariationsSeedServer.java",
]
deps = [
":system_webview_manifest",
"//android_webview:common_aidl_java",
"//android_webview:common_crash_java",
"//android_webview:common_java",
"//android_webview:common_platform_services_java",
"//android_webview:common_variations_java",
"//android_webview/proto:metrics_bridge_records_proto_java",
"//base:base_java",
"//components/background_task_scheduler:background_task_scheduler_task_ids_java",
"//components/component_updater/android:component_provider_service_aidl_java",
"//components/minidump_uploader:minidump_uploader_java",
"//components/variations/android:variations_java",
"//components/version_info/android:version_constants_java",
"//third_party/android_deps:com_google_code_findbugs_jsr305_java",
"//third_party/android_deps:protobuf_lite_runtime_java",
"//third_party/androidx:androidx_annotation_annotation_java",
]
}
source_set("nonembedded") {
sources = [
"component_updater/aw_component_installer_policy_delegate.cc",
"component_updater/aw_component_installer_policy_delegate.h",
"component_updater/aw_component_update_service.cc",
"component_updater/aw_component_update_service.h",
"component_updater/aw_component_updater_configurator.cc",
"component_updater/aw_component_updater_configurator.h",
"component_updater/installer_policies/aw_origin_trials_component_installer.cc",
"component_updater/installer_policies/aw_origin_trials_component_installer.h",
"component_updater/installer_policies/aw_package_names_allowlist_component_installer_policy.cc",
"component_updater/installer_policies/aw_package_names_allowlist_component_installer_policy.h",
"component_updater/installer_policies/aw_trust_token_key_commitments_component_installer_policy.cc",
"component_updater/installer_policies/aw_trust_token_key_commitments_component_installer_policy.h",
"component_updater/registration.cc",
"component_updater/registration.h",
"net/network_fetcher_task.cc",
"net/network_fetcher_task.h",
"net/network_impl.cc",
"net/network_impl.h",
"webview_apk_application.cc",
"webview_apk_process.cc",
"webview_apk_process.h",
]
deps = [
":nonembedded_jni_headers",
"//android_webview/common",
"//base",
"//components/component_updater",
"//components/component_updater/installer_policies",
"//components/prefs",
"//components/update_client",
"//components/update_client:in_process_patcher",
"//components/update_client:in_process_unzipper",
"//components/version_info",
"//components/version_info/android:channel_getter",
"//url",
"//url:gurl_android",
# Called via JNI by LicenseContentProvider in :nonembedded_java.
"//components/about_ui:about_ui_android",
]
}
# WebView icon used by upstream SystemWebView and Trichrome.
android_resources("icon_resources") {
sources = [
"java/res_icon/drawable-hdpi/icon_webview.png",
"java/res_icon/drawable-mdpi/icon_webview.png",
"java/res_icon/drawable-xhdpi/icon_webview.png",
"java/res_icon/drawable-xxhdpi/icon_webview.png",
]
}
android_resources("devui_resources") {
sources = [
"java/res_devui/drawable/blue_circle.xml",
"java/res_devui/drawable/ic_action_home.xml",
"java/res_devui/drawable/ic_alert_error.xml",
"java/res_devui/drawable/ic_clear_text.xml",
"java/res_devui/drawable/ic_delete.xml",
"java/res_devui/drawable/ic_devui_search.xml",
"java/res_devui/drawable/ic_flag.xml",
"java/res_devui/layout/activity_main.xml",
"java/res_devui/layout/crashes_list_item_body.xml",
"java/res_devui/layout/crashes_list_item_header.xml",
"java/res_devui/layout/flag_states.xml",
"java/res_devui/layout/flag_ui_warning.xml",
"java/res_devui/layout/fragment_crashes_list.xml",
"java/res_devui/layout/fragment_flags.xml",
"java/res_devui/layout/fragment_home.xml",
"java/res_devui/layout/persistent_error_message.xml",
"java/res_devui/layout/toggleable_flag.xml",
"java/res_devui/layout/two_line_list_item.xml",
"java/res_devui/layout/two_line_sublist_item.xml",
"java/res_devui/menu/crashes_options_menu.xml",
"java/res_devui/menu/options_menu.xml",
"java/res_devui/values-night/colors.xml",
"java/res_devui/values-night/styles.xml",
"java/res_devui/values/colors.xml",
"java/res_devui/values/strings.xml",
"java/res_devui/values/styles.xml",
]
}
android_resources("devui_launcher_icon_resources") {
sources = []
android_manifest = "java/DeveloperUiLauncherManifest.xml"
}
android_resources("monochrome_devui_launcher_icon_resources") {
sources = []
android_manifest = "java/MonochromeDeveloperUiLauncherManifest.xml"
}
_webview_jinja_variables = [ "manifest_package=$system_webview_package_name" ] +
webview_jinja_variables
jinja_template("system_webview_manifest") {
input = "java/AndroidManifest.xml"
output = system_webview_android_manifest
variables = _webview_jinja_variables
}
jinja_template("trichrome_webview_manifest") {
input = "java/AndroidManifest.xml"
output = trichrome_webview_android_manifest
variables = trichrome_jinja_variables + _webview_jinja_variables + [
"trichrome_version=$trichrome_version_code",
"library=libmonochrome.so",
]
}
if (android_64bit_target_cpu) {
jinja_template("trichrome_webview_64_32_manifest") {
input = "java/AndroidManifest.xml"
output = trichrome_webview_64_32_android_manifest
variables = trichrome_jinja_variables + _webview_jinja_variables + [
"use32bitAbi=",
"trichrome_version=$trichrome_64_32_version_code",
"library=libmonochrome_64.so",
]
}
jinja_template("trichrome_webview_32_manifest") {
input = "java/AndroidManifest.xml"
output = trichrome_webview_32_android_manifest
variables = trichrome_jinja_variables + _webview_jinja_variables + [
"trichrome_version=$trichrome_32_version_code",
"library=libmonochrome.so",
]
}
}