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

History: Use preprocessing to generate rollup input

Bug: 1128583
Change-Id: I2398ae172380f4bb8478c7d4a0c51fa981e5ebb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2414681
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808403}
parent 65913330
......@@ -4,13 +4,12 @@
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) {
history_pak_file = "history_resources.pak"
unpak_folder = "history_resources.unpak"
preprocess_folder = "preprocess"
optimize_webui("build") {
host = "history"
......@@ -18,7 +17,7 @@ if (optimize_webui) {
"history.js",
"lazy_load.js",
]
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 = [
"history.rollup.js",
"lazy_load.rollup.js",
......@@ -26,36 +25,43 @@ if (optimize_webui) {
]
deps = [
":unpak",
":preprocess",
":preprocess_generated",
"../../../../ui/webui/resources:preprocess",
]
excludes = [ "chrome://resources/js/cr.m.js" ]
}
unpak("unpak") {
pak_file = history_pak_file
out_folder = unpak_folder
deps = [ ":flattened_resources" ]
}
grit("flattened_resources") {
source = "history_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 = [
"browser_service.js",
"constants.js",
"externs.js",
"history.js",
"lazy_load.js",
"query_manager.js",
"searched_label.js",
]
}
preprocess_grit("preprocess_generated") {
deps = [ ":web_components" ]
defines = chrome_grit_defines
outputs = [
"grit/history_resources.h",
"grit/history_resources_map.cc",
"grit/history_resources_map.h",
history_pak_file,
in_folder = target_gen_dir
out_folder = "$target_gen_dir/$preprocess_folder"
in_files = [
"app.js",
"history_item.js",
"history_list.js",
"history_toolbar.js",
"router.js",
"shared_style.js",
"shared_vars.js",
"side_bar.js",
"synced_device_card.js",
"synced_device_manager.js",
]
output_dir = "$root_gen_dir/chrome/browser/resources/history"
}
}
......
......@@ -15,75 +15,65 @@
<!-- Generated Polymer 3 elements -->
<include name="IDR_HISTORY_APP_JS"
file="${root_gen_dir}/chrome/browser/resources/history/app.js"
use_base_dir="false" compress="false" type="BINDATA" preprocess="true" />
use_base_dir="false" type="BINDATA" preprocess="true" />
<include name="IDR_HISTORY_HISTORY_ITEM_JS"
file="${root_gen_dir}/chrome/browser/resources/history/history_item.js"
use_base_dir="false" compress="false" type="BINDATA" />
use_base_dir="false" type="BINDATA" />
<include name="IDR_HISTORY_HISTORY_LIST_JS"
file="${root_gen_dir}/chrome/browser/resources/history/history_list.js"
use_base_dir="false" compress="false" type="BINDATA" />
use_base_dir="false" type="BINDATA" />
<include name="IDR_HISTORY_HISTORY_TOOLBAR_JS"
file="${root_gen_dir}/chrome/browser/resources/history/history_toolbar.js"
use_base_dir="false" compress="false" type="BINDATA" />
use_base_dir="false" type="BINDATA" />
<include name="IDR_HISTORY_ROUTER_JS"
file="${root_gen_dir}/chrome/browser/resources/history/router.js"
use_base_dir="false" compress="false" type="BINDATA" />
use_base_dir="false" type="BINDATA" />
<include name="IDR_HISTORY_SHARED_STYLE_JS"
file="${root_gen_dir}/chrome/browser/resources/history/shared_style.js"
use_base_dir="false" compress="false" type="BINDATA" />
use_base_dir="false" type="BINDATA" />
<include name="IDR_HISTORY_SHARED_VARS_JS"
file="${root_gen_dir}/chrome/browser/resources/history/shared_vars.js"
use_base_dir="false" compress="false" type="BINDATA" />
use_base_dir="false" type="BINDATA" />
<include name="IDR_HISTORY_SIDE_BAR_JS"
file="${root_gen_dir}/chrome/browser/resources/history/side_bar.js"
use_base_dir="false" compress="false" type="BINDATA" />
use_base_dir="false" type="BINDATA" />
<include name="IDR_HISTORY_SYNCED_DEVICE_CARD_JS"
file="${root_gen_dir}/chrome/browser/resources/history/synced_device_card.js"
use_base_dir="false" compress="false" type="BINDATA" />
use_base_dir="false" type="BINDATA" />
<include name="IDR_HISTORY_SYNCED_DEVICE_MANAGER_JS"
file="${root_gen_dir}/chrome/browser/resources/history/synced_device_manager.js"
use_base_dir="false" compress="false" type="BINDATA" />
use_base_dir="false" type="BINDATA" />
<include name="IDR_HISTORY_CONSTANTS_JS"
file="constants.js"
compress="false"
type="BINDATA" />
<include name="IDR_HISTORY_EXTERNS_JS"
file="externs.js"
compress="false"
type="BINDATA" />
<include name="IDR_HISTORY_HISTORY_HTML"
file="history.html"
preprocess="true"
compress="false"
type="BINDATA" />
<include name="IDR_HISTORY_HISTORY_JS"
file="history.js"
compress="false"
type="BINDATA" />
<include name="IDR_HISTORY_IMAGES_SIGN_IN_PROMO_DARK_SVG"
file="images\sign_in_promo_dark.svg"
compress="false"
type="BINDATA" />
<include name="IDR_HISTORY_IMAGES_SIGN_IN_PROMO_SVG"
file="images\sign_in_promo.svg"
compress="false"
type="BINDATA" />
<include name="IDR_HISTORY_BROWSER_SERVICE_JS"
file="browser_service.js"
compress="false"
type="BINDATA" />
<include name="IDR_HISTORY_LAZY_LOAD_JS"
file="lazy_load.js"
compress="false"
type="BINDATA" />
<include name="IDR_HISTORY_QUERY_MANAGER_JS"
file="query_manager.js"
compress="false"
type="BINDATA" />
<include name="IDR_HISTORY_SEARCHED_LABEL_JS"
file="searched_label.js"
compress="false"
type="BINDATA" />
</includes>
</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