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 @@
import("//chrome/common/features.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("../optimize_webui.gni")
if (optimize_webui) {
bookmarks_pak_file = "bookmarks_resources.pak"
unpak_folder = "bookmarks_resources.unpak"
preprocess_folder = "preprocessed"
optimize_webui("build") {
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_module_in_files = [ "bookmarks.js" ]
deps = [
":unpak",
":preprocess",
":preprocess_generated",
"../../../../ui/webui/resources:preprocess",
]
excludes = [ "chrome://resources/js/cr.m.js" ]
}
unpak("unpak") {
pak_file = bookmarks_pak_file
out_folder = unpak_folder
deps = [ ":flattened_resources" ]
}
grit("flattened_resources") {
source = "bookmarks_resources.grd"
grit_flags = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
preprocess_grit("preprocess") {
in_folder = "./"
out_folder = "$target_gen_dir/$preprocess_folder"
in_files = [
"actions.js",
"api_listener.js",
"bookmarks.js",
"browser_proxy.js",
"constants.js",
"debouncer.js",
"dialog_focus_manager.js",
"dnd_manager.js",
"mouse_focus_behavior.js",
"reducers.js",
"store_client.js",
"store.js",
"types.js",
"util.js",
]
}
preprocess_grit("preprocess_generated") {
deps = [ ":web_components" ]
defines = chrome_grit_defines
outputs = [
"grit/bookmarks_resources.h",
"grit/bookmarks_resources_map.cc",
"grit/bookmarks_resources_map.h",
bookmarks_pak_file,
in_folder = target_gen_dir
out_folder = "$target_gen_dir/$preprocess_folder"
in_files = [
"app.js",
"command_manager.js",
"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 @@
<includes>
<include name="IDR_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"
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"
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"
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"
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"
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"
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"
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"
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"
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>
<structures>
<structure name="IDR_BOOKMARKS_ACTIONS_JS"
file="actions.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_API_LISTENER_JS"
file="api_listener.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_BOOKMARKS_HTML"
file="bookmarks.html"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_BOOKMARKS_JS"
file="bookmarks.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_BROWSER_PROXY_JS"
file="browser_proxy.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_CONSTANTS_JS"
file="constants.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_DEBOUNCER_JS"
file="debouncer.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_DIALOG_FOCUS_MANAGER_JS"
file="dialog_focus_manager.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_DND_MANAGER_JS"
file="dnd_manager.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_MOUSE_FOCUS_BEHAVIOR_JS"
file="mouse_focus_behavior.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_REDUCERS_JS"
file="reducers.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_STORE_CLIENT_JS"
file="store_client.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_STORE_JS"
file="store.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_TYPES_JS"
file="types.js"
compress="false"
type="chrome_html" />
<structure name="IDR_BOOKMARKS_UTIL_JS"
file="util.js"
compress="false"
type="chrome_html" />
</structures>
</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