Commit 16315f99 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Remove android_resources().generated_resource_files

In favor of using the new & simpler "sources" attribute.

TBR=agrieve  # Trivial BUILD.gn in components/

Bug: 1026378
Change-Id: I1bc6db5f66262bef18b0c458435e742230c1d4e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1982187
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarLambros Lambrou <lambroslambrou@chromium.org>
Reviewed-by: default avatarMohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728524}
parent 151a7384
...@@ -901,11 +901,6 @@ if (enable_java_templates) { ...@@ -901,11 +901,6 @@ if (enable_java_templates) {
# alternative_android_sdk_dep: Optional. Alternative Android system # alternative_android_sdk_dep: Optional. Alternative Android system
# android java target to use. # android java target to use.
# resource_dirs: List of directories containing resources for this target. # resource_dirs: List of directories containing resources for this target.
# generated_resource_dirs (deprecated):
# **This is deprecated, you only need to specify generated files directly
# in |generated_resource_files|**
# generated_resource_files: List of all resource files for this target
# which are *generated* by a dependency.
# android_manifest: AndroidManifest.xml for this target (optional). Will be # android_manifest: AndroidManifest.xml for this target (optional). Will be
# merged into apks that directly or indirectly depend on this target. # merged into apks that directly or indirectly depend on this target.
# android_manifest_dep: Target that generates AndroidManifest (if applicable) # android_manifest_dep: Target that generates AndroidManifest (if applicable)
...@@ -943,11 +938,6 @@ if (enable_java_templates) { ...@@ -943,11 +938,6 @@ if (enable_java_templates) {
not_needed(invoker, [ "v14_skip" ]) not_needed(invoker, [ "v14_skip" ])
} }
# TODO(https://crbug.com/1026378): remove unneeded generated_resource_dirs
if (defined(invoker.generated_resource_dirs)) {
not_needed(invoker, [ "generated_resource_dirs" ])
}
_pass_resource_files = defined(invoker.sources) _pass_resource_files = defined(invoker.sources)
_res_sources_path = "$target_gen_dir/${invoker.target_name}.res.sources" _res_sources_path = "$target_gen_dir/${invoker.target_name}.res.sources"
...@@ -989,9 +979,7 @@ if (enable_java_templates) { ...@@ -989,9 +979,7 @@ if (enable_java_templates) {
} }
_resource_files = rebase_path(_sources_build_rel, ".", root_build_dir) _resource_files = rebase_path(_sources_build_rel, ".", root_build_dir)
} }
if (defined(invoker.generated_resource_files)) {
_resource_files += invoker.generated_resource_files
}
_rebased_resource_files = rebase_path(_resource_files, root_build_dir) _rebased_resource_files = rebase_path(_resource_files, root_build_dir)
write_file(_res_sources_path, _rebased_resource_files) write_file(_res_sources_path, _rebased_resource_files)
...@@ -4323,15 +4311,9 @@ if (enable_java_templates) { ...@@ -4323,15 +4311,9 @@ if (enable_java_templates) {
if (!_ignore_manifest) { if (!_ignore_manifest) {
android_manifest = "${_output_path}/AndroidManifest.xml" android_manifest = "${_output_path}/AndroidManifest.xml"
} }
resource_dirs = [] sources = []
generated_resource_dirs = []
if (!_strip_resources && _scanned_files.resources != []) {
generated_resource_dirs += [ "${_output_path}/res" ]
}
generated_resource_files = []
if (!_strip_resources) { if (!_strip_resources) {
generated_resource_files = sources = rebase_path(_scanned_files.resources, "", _output_path)
rebase_path(_scanned_files.resources, "", _output_path)
} }
if (!_strip_resources && _scanned_files.has_r_text_file) { if (!_strip_resources && _scanned_files.has_r_text_file) {
r_text_file = "${_output_path}/R.txt" r_text_file = "${_output_path}/R.txt"
......
...@@ -1123,9 +1123,9 @@ process_version("version_xml") { ...@@ -1123,9 +1123,9 @@ process_version("version_xml") {
} }
android_resources("product_version_resources") { android_resources("product_version_resources") {
resource_dirs = [] sources = [
generated_resource_dirs = [ version_resource_dir ] version_resource_file,
generated_resource_files = [ version_resource_file ] ]
custom_package = "org.chromium.base" custom_package = "org.chromium.base"
deps = [ deps = [
":version_xml", ":version_xml",
......
...@@ -147,10 +147,83 @@ template("webapk_tmpl") { ...@@ -147,10 +147,83 @@ template("webapk_tmpl") {
android_resources(_resources_target_name) { android_resources(_resources_target_name) {
custom_package = "org.chromium.webapk.shell_apk" custom_package = "org.chromium.webapk.shell_apk"
resource_dirs = [ "res" ] sources = [
generated_resource_dirs = [ _generated_res_background_dir ] "res/drawable-hdpi/last_resort_runtime_host_logo.png",
generated_resource_files = "res/drawable-hdpi/notification_badge.png",
get_target_outputs(":$_generate_res_background_xml_target_name") "res/drawable-hdpi/shortcut_1_icon.png",
"res/drawable-hdpi/shortcut_2_icon.png",
"res/drawable-hdpi/shortcut_3_icon.png",
"res/drawable-hdpi/shortcut_4_icon.png",
"res/drawable-hdpi/splash_icon.xml",
"res/drawable-mdpi/notification_badge.png",
"res/drawable-mdpi/shortcut_1_icon.png",
"res/drawable-mdpi/shortcut_2_icon.png",
"res/drawable-mdpi/shortcut_3_icon.png",
"res/drawable-mdpi/shortcut_4_icon.png",
"res/drawable-mdpi/splash_icon.xml",
"res/drawable-xhdpi/notification_badge.png",
"res/drawable-xhdpi/shortcut_1_icon.png",
"res/drawable-xhdpi/shortcut_2_icon.png",
"res/drawable-xhdpi/shortcut_3_icon.png",
"res/drawable-xhdpi/shortcut_4_icon.png",
"res/drawable-xhdpi/splash_icon.xml",
"res/drawable-xxhdpi/notification_badge.png",
"res/drawable-xxhdpi/shortcut_1_icon.png",
"res/drawable-xxhdpi/shortcut_2_icon.png",
"res/drawable-xxhdpi/shortcut_3_icon.png",
"res/drawable-xxhdpi/shortcut_4_icon.png",
"res/drawable-xxhdpi/splash_icon.xml",
"res/drawable-xxxhdpi/notification_badge.png",
"res/drawable-xxxhdpi/shortcut_1_icon.png",
"res/drawable-xxxhdpi/shortcut_2_icon.png",
"res/drawable-xxxhdpi/shortcut_3_icon.png",
"res/drawable-xxxhdpi/shortcut_4_icon.png",
"res/drawable-xxxhdpi/splash_icon.xml",
"res/layout/choose_host_browser_dialog.xml",
"res/layout/host_browser_list_item.xml",
"res/mipmap-anydpi-v26/ic_launcher.xml",
"res/mipmap-hdpi/app_icon.xml",
"res/mipmap-hdpi/ic_launcher.xml",
"res/mipmap-hdpi/maskable_app_icon.xml",
"res/mipmap-mdpi/app_icon.xml",
"res/mipmap-mdpi/ic_launcher.xml",
"res/mipmap-mdpi/ic_launcher_background.png",
"res/mipmap-mdpi/ic_launcher_foreground.png",
"res/mipmap-mdpi/maskable_app_icon.xml",
"res/mipmap-nodpi/app_icon_hdpi.png",
"res/mipmap-nodpi/app_icon_mdpi.png",
"res/mipmap-nodpi/app_icon_xhdpi.png",
"res/mipmap-nodpi/app_icon_xxhdpi.png",
"res/mipmap-nodpi/app_icon_xxxhdpi.png",
"res/mipmap-nodpi/maskable_app_icon_hdpi.png",
"res/mipmap-nodpi/maskable_app_icon_mdpi.png",
"res/mipmap-nodpi/maskable_app_icon_xhdpi.png",
"res/mipmap-nodpi/maskable_app_icon_xxhdpi.png",
"res/mipmap-nodpi/maskable_app_icon_xxxhdpi.png",
"res/mipmap-nodpi/maskable_splash_icon_xxhdpi.png",
"res/mipmap-nodpi/maskable_splash_icon_xxxhdpi.png",
"res/mipmap-nodpi/splash_icon_xxhdpi.png",
"res/mipmap-nodpi/splash_icon_xxxhdpi.png",
"res/mipmap-xhdpi/app_icon.xml",
"res/mipmap-xhdpi/ic_launcher.xml",
"res/mipmap-xhdpi/maskable_app_icon.xml",
"res/mipmap-xxhdpi/app_icon.xml",
"res/mipmap-xxhdpi/ic_launcher.xml",
"res/mipmap-xxhdpi/maskable_app_icon.xml",
"res/mipmap-xxxhdpi/app_icon.xml",
"res/mipmap-xxxhdpi/ic_launcher.xml",
"res/mipmap-xxxhdpi/maskable_app_icon.xml",
"res/values-hdpi/is_splash_icon_maskable_bool.xml",
"res/values-mdpi/is_splash_icon_maskable_bool.xml",
"res/values-v17/styles.xml",
"res/values-xhdpi/is_splash_icon_maskable_bool.xml",
"res/values-xxhdpi/is_splash_icon_maskable_bool.xml",
"res/values-xxxhdpi/is_splash_icon_maskable_bool.xml",
"res/values/colors.xml",
"res/values/dimens.xml",
"res/xml/shortcuts.xml",
]
sources += get_target_outputs(":$_generate_res_background_xml_target_name")
deps = [ deps = [
":$_generate_res_background_xml_target_name", ":$_generate_res_background_xml_target_name",
":webapk_strings_grd", ":webapk_strings_grd",
......
...@@ -381,14 +381,8 @@ if (gen_policy_templates_android && is_android) { ...@@ -381,14 +381,8 @@ if (gen_policy_templates_android && is_android) {
} }
android_resources("app_restrictions_resources") { android_resources("app_restrictions_resources") {
resource_dirs = [] sources = policy_templates_android_outputs +
generated_resource_dirs = [ [ "$_generated_resources_dir/xml-v21/app_restrictions.xml" ]
"$policy_templates_base_dir/android",
_generated_resources_dir,
]
generated_resource_files =
policy_templates_android_outputs +
[ "$_generated_resources_dir/xml-v21/app_restrictions.xml" ]
deps = [ deps = [
":app_restrictions_resources_copy", ":app_restrictions_resources_copy",
":policy_templates", ":policy_templates",
......
...@@ -43,9 +43,96 @@ remoting_localize("remoting_apk_manifest") { ...@@ -43,9 +43,96 @@ remoting_localize("remoting_apk_manifest") {
android_resources("remoting_android_client_java_resources") { android_resources("remoting_android_client_java_resources") {
custom_package = "org.chromium.chromoting" custom_package = "org.chromium.chromoting"
resource_dirs = [ "java/res" ] sources = [
generated_resource_dirs = [ _raw_resources_base_dir ] "java/res/drawable-hdpi/empty_host_list.png",
generated_resource_files = get_target_outputs(":credits_resources_raw") "java/res/drawable-hdpi/ic_action_full_screen.png",
"java/res/drawable-hdpi/ic_action_keyboard.png",
"java/res/drawable-hdpi/ic_announcement.png",
"java/res/drawable-hdpi/ic_help.png",
"java/res/drawable-hdpi/ic_host_offline.png",
"java/res/drawable-hdpi/ic_host_online.png",
"java/res/drawable-hdpi/ic_menu.png",
"java/res/drawable-hdpi/ic_mouse.png",
"java/res/drawable-hdpi/ic_refresh.png",
"java/res/drawable-hdpi/ic_touch.png",
"java/res/drawable-ldpi/empty_host_list.png",
"java/res/drawable-mdpi/empty_host_list.png",
"java/res/drawable-mdpi/ic_action_full_screen.png",
"java/res/drawable-mdpi/ic_action_keyboard.png",
"java/res/drawable-mdpi/ic_announcement.png",
"java/res/drawable-mdpi/ic_help.png",
"java/res/drawable-mdpi/ic_host_offline.png",
"java/res/drawable-mdpi/ic_host_online.png",
"java/res/drawable-mdpi/ic_menu.png",
"java/res/drawable-mdpi/ic_mouse.png",
"java/res/drawable-mdpi/ic_refresh.png",
"java/res/drawable-mdpi/ic_touch.png",
"java/res/drawable-xhdpi/empty_host_list.png",
"java/res/drawable-xhdpi/ic_action_full_screen.png",
"java/res/drawable-xhdpi/ic_action_keyboard.png",
"java/res/drawable-xhdpi/ic_announcement.png",
"java/res/drawable-xhdpi/ic_help.png",
"java/res/drawable-xhdpi/ic_host_offline.png",
"java/res/drawable-xhdpi/ic_host_online.png",
"java/res/drawable-xhdpi/ic_menu.png",
"java/res/drawable-xhdpi/ic_mouse.png",
"java/res/drawable-xhdpi/ic_refresh.png",
"java/res/drawable-xhdpi/ic_touch.png",
"java/res/drawable-xxhdpi/empty_host_list.png",
"java/res/drawable-xxhdpi/ic_action_full_screen.png",
"java/res/drawable-xxhdpi/ic_action_keyboard.png",
"java/res/drawable-xxhdpi/ic_announcement.png",
"java/res/drawable-xxhdpi/ic_help.png",
"java/res/drawable-xxhdpi/ic_host_offline.png",
"java/res/drawable-xxhdpi/ic_host_online.png",
"java/res/drawable-xxhdpi/ic_menu.png",
"java/res/drawable-xxhdpi/ic_mouse.png",
"java/res/drawable-xxhdpi/ic_refresh.png",
"java/res/drawable-xxhdpi/ic_touch.png",
"java/res/drawable-xxxhdpi/empty_host_list.png",
"java/res/drawable-xxxhdpi/ic_action_full_screen.png",
"java/res/drawable-xxxhdpi/ic_action_keyboard.png",
"java/res/drawable-xxxhdpi/ic_announcement.png",
"java/res/drawable-xxxhdpi/ic_help.png",
"java/res/drawable-xxxhdpi/ic_host_offline.png",
"java/res/drawable-xxxhdpi/ic_host_online.png",
"java/res/drawable-xxxhdpi/ic_menu.png",
"java/res/drawable-xxxhdpi/ic_mouse.png",
"java/res/drawable-xxxhdpi/ic_refresh.png",
"java/res/drawable-xxxhdpi/ic_touch.png",
"java/res/layout/account_ui.xml",
"java/res/layout/credits.xml",
"java/res/layout/desktop.xml",
"java/res/layout/help.xml",
"java/res/layout/host_offline.xml",
"java/res/layout/host_online.xml",
"java/res/layout/main.xml",
"java/res/layout/navigation_list.xml",
"java/res/layout/navigation_list_item.xml",
"java/res/layout/navigation_list_separator.xml",
"java/res/layout/notification_dialog.xml",
"java/res/layout/pin_dialog.xml",
"java/res/menu/chromoting_actionbar.xml",
"java/res/menu/desktop_actionbar.xml",
"java/res/menu/help_actionbar.xml",
"java/res/menu/host_context_menu.xml",
"java/res/mipmap-anydpi-v26/ic_launcher.xml",
"java/res/mipmap-hdpi/ic_launcher.png",
"java/res/mipmap-hdpi/ic_launcher_foreground.png",
"java/res/mipmap-mdpi/ic_launcher.png",
"java/res/mipmap-mdpi/ic_launcher_foreground.png",
"java/res/mipmap-xhdpi/ic_launcher.png",
"java/res/mipmap-xhdpi/ic_launcher_foreground.png",
"java/res/mipmap-xxhdpi/ic_launcher.png",
"java/res/mipmap-xxhdpi/ic_launcher_foreground.png",
"java/res/mipmap-xxxhdpi/ic_launcher.png",
"java/res/mipmap-xxxhdpi/ic_launcher_foreground.png",
"java/res/values-sw600dp/dimens.xml",
"java/res/values-v17/styles.xml",
"java/res/values/dimens.xml",
"java/res/values/ic_launcher_background.xml",
]
sources += get_target_outputs(":credits_resources_raw")
deps = [ deps = [
":credits_resources_raw", ":credits_resources_raw",
"//remoting/resources:strings_java", "//remoting/resources:strings_java",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment