Commit 6f3252c6 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Bookmarks: Use preprocessing to generate rollup input

Bug: 1128583
Change-Id: I31a8b52c89bb411a6dc81f189829adf63907748d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2414617Reviewed-by: default avatardpapad <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808077}
parent 18e21a5e
...@@ -4,51 +4,64 @@ ...@@ -4,51 +4,64 @@
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) {
bookmarks_pak_file = "bookmarks_resources.pak" preprocess_folder = "preprocessed"
unpak_folder = "bookmarks_resources.unpak"
optimize_webui("build") { optimize_webui("build") {
host = "bookmarks" host = "bookmarks"
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 = [ "bookmarks.rollup.js" ] js_out_files = [ "bookmarks.rollup.js" ]
js_module_in_files = [ "bookmarks.js" ] js_module_in_files = [ "bookmarks.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 = bookmarks_pak_file in_folder = "./"
out_folder = unpak_folder out_folder = "$target_gen_dir/$preprocess_folder"
in_files = [
deps = [ ":flattened_resources" ] "actions.js",
} "api_listener.js",
"bookmarks.js",
grit("flattened_resources") { "browser_proxy.js",
source = "bookmarks_resources.grd" "constants.js",
"debouncer.js",
grit_flags = [ "dialog_focus_manager.js",
"-E", "dnd_manager.js",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir), "mouse_focus_behavior.js",
"reducers.js",
"store_client.js",
"store.js",
"types.js",
"util.js",
] ]
}
preprocess_grit("preprocess_generated") {
deps = [ ":web_components" ] deps = [ ":web_components" ]
defines = chrome_grit_defines in_folder = target_gen_dir
outputs = [ out_folder = "$target_gen_dir/$preprocess_folder"
"grit/bookmarks_resources.h", in_files = [
"grit/bookmarks_resources_map.cc", "app.js",
"grit/bookmarks_resources_map.h", "command_manager.js",
bookmarks_pak_file, "edit_dialog.js",
"folder_node.js",
"item.js",
"list.js",
"router.js",
"shared_style.js",
"shared_vars.js",
"toolbar.js",
] ]
output_dir = "$root_gen_dir/chrome/browser/resources/bookmarks"
} }
} }
......
...@@ -14,95 +14,80 @@ ...@@ -14,95 +14,80 @@
<includes> <includes>
<include name="IDR_BOOKMARKS_APP_JS" <include name="IDR_BOOKMARKS_APP_JS"
file="${root_gen_dir}/chrome/browser/resources/bookmarks/app.js" file="${root_gen_dir}/chrome/browser/resources/bookmarks/app.js"
use_base_dir="false" compress="false" type="BINDATA" preprocess="true" /> use_base_dir="false" type="BINDATA" preprocess="true" />
<include name="IDR_BOOKMARKS_COMMAND_MANAGER_JS" <include name="IDR_BOOKMARKS_COMMAND_MANAGER_JS"
file="${root_gen_dir}/chrome/browser/resources/bookmarks/command_manager.js" file="${root_gen_dir}/chrome/browser/resources/bookmarks/command_manager.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_BOOKMARKS_EDIT_DIALOG_JS" <include name="IDR_BOOKMARKS_EDIT_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/bookmarks/edit_dialog.js" file="${root_gen_dir}/chrome/browser/resources/bookmarks/edit_dialog.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_BOOKMARKS_FOLDER_NODE_JS" <include name="IDR_BOOKMARKS_FOLDER_NODE_JS"
file="${root_gen_dir}/chrome/browser/resources/bookmarks/folder_node.js" file="${root_gen_dir}/chrome/browser/resources/bookmarks/folder_node.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_BOOKMARKS_ITEM_JS" <include name="IDR_BOOKMARKS_ITEM_JS"
file="${root_gen_dir}/chrome/browser/resources/bookmarks/item.js" file="${root_gen_dir}/chrome/browser/resources/bookmarks/item.js"
use_base_dir="false" compress="false" type="BINDATA" preprocess="true" /> use_base_dir="false" type="BINDATA" preprocess="true" />
<include name="IDR_BOOKMARKS_LIST_JS" <include name="IDR_BOOKMARKS_LIST_JS"
file="${root_gen_dir}/chrome/browser/resources/bookmarks/list.js" file="${root_gen_dir}/chrome/browser/resources/bookmarks/list.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_BOOKMARKS_ROUTER_JS" <include name="IDR_BOOKMARKS_ROUTER_JS"
file="${root_gen_dir}/chrome/browser/resources/bookmarks/router.js" file="${root_gen_dir}/chrome/browser/resources/bookmarks/router.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_BOOKMARKS_SHARED_STYLE_JS" <include name="IDR_BOOKMARKS_SHARED_STYLE_JS"
file="${root_gen_dir}/chrome/browser/resources/bookmarks/shared_style.js" file="${root_gen_dir}/chrome/browser/resources/bookmarks/shared_style.js"
use_base_dir="false" compress="false" type="BINDATA" preprocess="true" /> use_base_dir="false" type="BINDATA" preprocess="true" />
<include name="IDR_BOOKMARKS_SHARED_VARS_JS" <include name="IDR_BOOKMARKS_SHARED_VARS_JS"
file="${root_gen_dir}/chrome/browser/resources/bookmarks/shared_vars.js" file="${root_gen_dir}/chrome/browser/resources/bookmarks/shared_vars.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
<include name="IDR_BOOKMARKS_TOOLBAR_JS" <include name="IDR_BOOKMARKS_TOOLBAR_JS"
file="${root_gen_dir}/chrome/browser/resources/bookmarks/toolbar.js" file="${root_gen_dir}/chrome/browser/resources/bookmarks/toolbar.js"
use_base_dir="false" compress="false" type="BINDATA" /> use_base_dir="false" type="BINDATA" />
</includes> </includes>
<structures> <structures>
<structure name="IDR_BOOKMARKS_ACTIONS_JS" <structure name="IDR_BOOKMARKS_ACTIONS_JS"
file="actions.js" file="actions.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_API_LISTENER_JS" <structure name="IDR_BOOKMARKS_API_LISTENER_JS"
file="api_listener.js" file="api_listener.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_BOOKMARKS_HTML" <structure name="IDR_BOOKMARKS_BOOKMARKS_HTML"
file="bookmarks.html" file="bookmarks.html"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_BOOKMARKS_JS" <structure name="IDR_BOOKMARKS_BOOKMARKS_JS"
file="bookmarks.js" file="bookmarks.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_BROWSER_PROXY_JS" <structure name="IDR_BOOKMARKS_BROWSER_PROXY_JS"
file="browser_proxy.js" file="browser_proxy.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_CONSTANTS_JS" <structure name="IDR_BOOKMARKS_CONSTANTS_JS"
file="constants.js" file="constants.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_DEBOUNCER_JS" <structure name="IDR_BOOKMARKS_DEBOUNCER_JS"
file="debouncer.js" file="debouncer.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_DIALOG_FOCUS_MANAGER_JS" <structure name="IDR_BOOKMARKS_DIALOG_FOCUS_MANAGER_JS"
file="dialog_focus_manager.js" file="dialog_focus_manager.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_DND_MANAGER_JS" <structure name="IDR_BOOKMARKS_DND_MANAGER_JS"
file="dnd_manager.js" file="dnd_manager.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_MOUSE_FOCUS_BEHAVIOR_JS" <structure name="IDR_BOOKMARKS_MOUSE_FOCUS_BEHAVIOR_JS"
file="mouse_focus_behavior.js" file="mouse_focus_behavior.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_REDUCERS_JS" <structure name="IDR_BOOKMARKS_REDUCERS_JS"
file="reducers.js" file="reducers.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_STORE_CLIENT_JS" <structure name="IDR_BOOKMARKS_STORE_CLIENT_JS"
file="store_client.js" file="store_client.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_STORE_JS" <structure name="IDR_BOOKMARKS_STORE_JS"
file="store.js" file="store.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_TYPES_JS" <structure name="IDR_BOOKMARKS_TYPES_JS"
file="types.js" file="types.js"
compress="false"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_BOOKMARKS_UTIL_JS" <structure name="IDR_BOOKMARKS_UTIL_JS"
file="util.js" file="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