Commit a27166e7 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Extensions: use preprocessing for generating rollup input

Bug: 1128583
Change-Id: If798fc3db54305ccbf2c795c0fae6c332ce34bbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410352
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807199}
parent 31606bac
...@@ -4,51 +4,85 @@ ...@@ -4,51 +4,85 @@
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
import("//third_party/closure_compiler/compile_js.gni") import("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/grit_rule.gni") import("//tools/grit/preprocess_grit.gni")
import("//tools/polymer/html_to_js.gni") import("//tools/polymer/html_to_js.gni")
import("../optimize_webui.gni") import("../optimize_webui.gni")
if (optimize_webui) { if (optimize_webui) {
extensions_pak_file = "extensions_resources.pak" preprocess_folder = "preprocessed"
unpak_folder = "extensions_resources.unpak"
optimize_webui("build") { optimize_webui("build") {
host = "extensions" host = "extensions"
input = rebase_path("$target_gen_dir/$unpak_folder", root_build_dir) input = rebase_path("$target_gen_dir/$preprocess_folder", root_build_dir)
js_out_files = [ "extensions.rollup.js" ] js_out_files = [ "extensions.rollup.js" ]
js_module_in_files = [ "extensions.js" ] js_module_in_files = [ "extensions.js" ]
deps = [ deps = [
":unpak", ":preprocess",
":preprocess_generated",
"../../../../ui/webui/resources:preprocess", "../../../../ui/webui/resources:preprocess",
] ]
excludes = [ "chrome://resources/js/cr.m.js" ] excludes = [ "chrome://resources/js/cr.m.js" ]
} }
unpak("unpak") { preprocess_grit("preprocess") {
pak_file = extensions_pak_file in_folder = "./"
out_folder = unpak_folder out_folder = "$target_gen_dir/$preprocess_folder"
in_files = [
"drag_and_drop_handler.js",
"extensions.js",
"item_behavior.js",
"item_util.js",
"keyboard_shortcut_delegate.js",
"navigation_helper.js",
"service.js",
"shortcut_util.js",
]
deps = [ ":flattened_resources" ] if (is_chromeos) {
in_files += [ "kiosk_browser_proxy.js" ]
}
} }
grit("flattened_resources") { preprocess_grit("preprocess_generated") {
source = "extensions_resources.grd"
grit_flags = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
]
deps = [ ":web_components" ] deps = [ ":web_components" ]
defines = chrome_grit_defines in_folder = target_gen_dir
outputs = [ out_folder = "$target_gen_dir/$preprocess_folder"
"grit/extensions_resources.h", in_files = [
"grit/extensions_resources_map.cc", "checkup.js",
"grit/extensions_resources_map.h", "code_section.js",
extensions_pak_file, "activity_log/activity_log_history_item.js",
"activity_log/activity_log_history.js",
"activity_log/activity_log.js",
"activity_log/activity_log_stream_item.js",
"activity_log/activity_log_stream.js",
"detail_view.js",
"drop_overlay.js",
"error_page.js",
"host_permissions_toggle_list.js",
"icons.js",
"install_warnings_dialog.js",
"item.js",
"item_list.js",
"keyboard_shortcuts.js",
"load_error.js",
"manager.js",
"options_dialog.js",
"pack_dialog_alert.js",
"pack_dialog.js",
"runtime_host_permissions.js",
"runtime_hosts_dialog.js",
"shared_style.js",
"shared_vars.js",
"shortcut_input.js",
"sidebar.js",
"toggle_row.js",
"toolbar.js",
] ]
output_dir = "$root_gen_dir/chrome/browser/resources/extensions"
if (is_chromeos) {
in_files += [ "kiosk_dialog.js" ]
}
} }
} }
......
...@@ -14,144 +14,133 @@ ...@@ -14,144 +14,133 @@
<includes> <includes>
<include name="IDR_EXTENSIONS_CODE_SECTION_JS" <include name="IDR_EXTENSIONS_CODE_SECTION_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/code_section.js" file="${root_gen_dir}/chrome/browser/resources/extensions/code_section.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_JS" <include name="IDR_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/activity_log/activity_log.js" file="${root_gen_dir}/chrome/browser/resources/extensions/activity_log/activity_log.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_HISTORY_JS" <include name="IDR_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_HISTORY_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/activity_log/activity_log_history.js" file="${root_gen_dir}/chrome/browser/resources/extensions/activity_log/activity_log_history.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_HISTORY_ITEM_JS" <include name="IDR_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_HISTORY_ITEM_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/activity_log/activity_log_history_item.js" file="${root_gen_dir}/chrome/browser/resources/extensions/activity_log/activity_log_history_item.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_STREAM_JS" <include name="IDR_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_STREAM_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/activity_log/activity_log_stream.js" file="${root_gen_dir}/chrome/browser/resources/extensions/activity_log/activity_log_stream.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_STREAM_ITEM_JS" <include name="IDR_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_STREAM_ITEM_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/activity_log/activity_log_stream_item.js" file="${root_gen_dir}/chrome/browser/resources/extensions/activity_log/activity_log_stream_item.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_CHECKUP_JS" <include name="IDR_EXTENSIONS_CHECKUP_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/checkup.js" file="${root_gen_dir}/chrome/browser/resources/extensions/checkup.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_DETAIL_VIEW_JS" <include name="IDR_EXTENSIONS_DETAIL_VIEW_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/detail_view.js" file="${root_gen_dir}/chrome/browser/resources/extensions/detail_view.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_DROP_OVERLAY_JS" <include name="IDR_EXTENSIONS_DROP_OVERLAY_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/drop_overlay.js" file="${root_gen_dir}/chrome/browser/resources/extensions/drop_overlay.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_ERROR_PAGE_JS" <include name="IDR_EXTENSIONS_ERROR_PAGE_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/error_page.js" file="${root_gen_dir}/chrome/browser/resources/extensions/error_page.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_KEYBOARD_SHORTCUTS_JS" <include name="IDR_EXTENSIONS_KEYBOARD_SHORTCUTS_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/keyboard_shortcuts.js" file="${root_gen_dir}/chrome/browser/resources/extensions/keyboard_shortcuts.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<if expr="chromeos"> <if expr="chromeos">
<include name="IDR_EXTENSIONS_KIOSK_DIALOG_JS" <include name="IDR_EXTENSIONS_KIOSK_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/kiosk_dialog.js" file="${root_gen_dir}/chrome/browser/resources/extensions/kiosk_dialog.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
</if> </if>
<include name="IDR_EXTENSIONS_MANAGER_JS" <include name="IDR_EXTENSIONS_MANAGER_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/manager.js" file="${root_gen_dir}/chrome/browser/resources/extensions/manager.js"
preprocess="true" use_base_dir="false" compress="false" type="BINDATA" /> preprocess="true" use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_ICONS_JS" <include name="IDR_EXTENSIONS_ICONS_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/icons.js" file="${root_gen_dir}/chrome/browser/resources/extensions/icons.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_INSTALL_WARNINGS_DIALOG_JS" <include name="IDR_EXTENSIONS_INSTALL_WARNINGS_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/install_warnings_dialog.js" file="${root_gen_dir}/chrome/browser/resources/extensions/install_warnings_dialog.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_ITEM_JS" <include name="IDR_EXTENSIONS_ITEM_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/item.js" file="${root_gen_dir}/chrome/browser/resources/extensions/item.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_ITEM_LIST_JS" <include name="IDR_EXTENSIONS_ITEM_LIST_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/item_list.js" file="${root_gen_dir}/chrome/browser/resources/extensions/item_list.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_LOAD_ERROR_JS" <include name="IDR_EXTENSIONS_LOAD_ERROR_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/load_error.js" file="${root_gen_dir}/chrome/browser/resources/extensions/load_error.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_HOST_PERMISSIONS_TOGGLE_LIST_JS" <include name="IDR_EXTENSIONS_HOST_PERMISSIONS_TOGGLE_LIST_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/host_permissions_toggle_list.js" file="${root_gen_dir}/chrome/browser/resources/extensions/host_permissions_toggle_list.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_OPTIONS_DIALOG_JS" <include name="IDR_EXTENSIONS_OPTIONS_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/options_dialog.js" file="${root_gen_dir}/chrome/browser/resources/extensions/options_dialog.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_PACK_DIALOG_JS" <include name="IDR_EXTENSIONS_PACK_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/pack_dialog.js" file="${root_gen_dir}/chrome/browser/resources/extensions/pack_dialog.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_PACK_DIALOG_ALERT_JS" <include name="IDR_EXTENSIONS_PACK_DIALOG_ALERT_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/pack_dialog_alert.js" file="${root_gen_dir}/chrome/browser/resources/extensions/pack_dialog_alert.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_RUNTIME_HOST_PERMISSIONS_JS" <include name="IDR_EXTENSIONS_RUNTIME_HOST_PERMISSIONS_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/runtime_host_permissions.js" file="${root_gen_dir}/chrome/browser/resources/extensions/runtime_host_permissions.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_RUNTIME_HOSTS_DIALOG_JS" <include name="IDR_EXTENSIONS_RUNTIME_HOSTS_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/runtime_hosts_dialog.js" file="${root_gen_dir}/chrome/browser/resources/extensions/runtime_hosts_dialog.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_SHARED_STYLE_JS" <include name="IDR_EXTENSIONS_SHARED_STYLE_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/shared_style.js" file="${root_gen_dir}/chrome/browser/resources/extensions/shared_style.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_SHARED_VARS_JS" <include name="IDR_EXTENSIONS_SHARED_VARS_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/shared_vars.js" file="${root_gen_dir}/chrome/browser/resources/extensions/shared_vars.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_SHORTCUT_INPUT_JS" <include name="IDR_EXTENSIONS_SHORTCUT_INPUT_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/shortcut_input.js" file="${root_gen_dir}/chrome/browser/resources/extensions/shortcut_input.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_SIDEBAR_JS" <include name="IDR_EXTENSIONS_SIDEBAR_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/sidebar.js" file="${root_gen_dir}/chrome/browser/resources/extensions/sidebar.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_TOGGLE_ROW_JS" <include name="IDR_EXTENSIONS_TOGGLE_ROW_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/toggle_row.js" file="${root_gen_dir}/chrome/browser/resources/extensions/toggle_row.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_TOOLBAR_JS" <include name="IDR_EXTENSIONS_TOOLBAR_JS"
file="${root_gen_dir}/chrome/browser/resources/extensions/toolbar.js" file="${root_gen_dir}/chrome/browser/resources/extensions/toolbar.js"
preprocess="true" use_base_dir="false" compress="false" type="BINDATA" /> preprocess="true" use_base_dir="false" type="BINDATA" />
<include name="IDR_EXTENSIONS_CHECKUP_IMAGE" <include name="IDR_EXTENSIONS_CHECKUP_IMAGE"
file="checkup_image.svg" compress="false" type="BINDATA" /> file="checkup_image.svg" type="BINDATA" />
<include name="IDR_EXTENSIONS_CHECKUP_IMAGE_DARK" <include name="IDR_EXTENSIONS_CHECKUP_IMAGE_DARK"
file="checkup_image_dark.svg" compress="false" type="BINDATA" /> file="checkup_image_dark.svg" type="BINDATA" />
</includes> </includes>
<structures> <structures>
<structure name="IDR_EXTENSIONS_ITEM_BEHAVIOR_JS" <structure name="IDR_EXTENSIONS_ITEM_BEHAVIOR_JS"
file="item_behavior.js" file="item_behavior.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_EXTENSIONS_EXTENSIONS_HTML" <structure name="IDR_EXTENSIONS_EXTENSIONS_HTML"
file="extensions.html" file="extensions.html"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_EXTENSIONS_DRAG_AND_DROP_HANDLER_JS" <structure name="IDR_EXTENSIONS_DRAG_AND_DROP_HANDLER_JS"
file="drag_and_drop_handler.js" file="drag_and_drop_handler.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_EXTENSIONS_EXTENSIONS_JS" <structure name="IDR_EXTENSIONS_EXTENSIONS_JS"
file="extensions.js" file="extensions.js"
preprocess="true"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_EXTENSIONS_KEYBOARD_SHORTCUT_DELEGATE_JS" <structure name="IDR_EXTENSIONS_KEYBOARD_SHORTCUT_DELEGATE_JS"
file="keyboard_shortcut_delegate.js" file="keyboard_shortcut_delegate.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<if expr="chromeos"> <if expr="chromeos">
<structure name="IDR_EXTENSIONS_KIOSK_BROWSER_PROXY_JS" <structure name="IDR_EXTENSIONS_KIOSK_BROWSER_PROXY_JS"
file="kiosk_browser_proxy.js" file="kiosk_browser_proxy.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
</if> </if>
<structure name="IDR_EXTENSIONS_ITEM_UTIL_JS" <structure name="IDR_EXTENSIONS_ITEM_UTIL_JS"
file="item_util.js" file="item_util.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_EXTENSIONS_NAVIGATION_HELPER_JS" <structure name="IDR_EXTENSIONS_NAVIGATION_HELPER_JS"
file="navigation_helper.js" file="navigation_helper.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_EXTENSIONS_SERVICE_JS" <structure name="IDR_EXTENSIONS_SERVICE_JS"
file="service.js" file="service.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_EXTENSIONS_SHORTCUT_UTIL_JS" <structure name="IDR_EXTENSIONS_SHORTCUT_UTIL_JS"
file="shortcut_util.js" file="shortcut_util.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
</structures> </structures>
</release> </release>
......
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