Index: tools/grit/grit_rule.gni |
diff --git a/tools/grit/grit_rule.gni b/tools/grit/grit_rule.gni |
index b77a24d5e6fb3f2f429bb47c8f71fcea2941774e..d314e9b82a60b00c8e3fff8b22e12dd84e0410e4 100644 |
--- a/tools/grit/grit_rule.gni |
+++ b/tools/grit/grit_rule.gni |
@@ -82,6 +82,7 @@ import("//build/config/chrome_build.gni") |
import("//build/config/crypto.gni") |
import("//build/config/features.gni") |
import("//build/config/ui.gni") |
+import("//third_party/closure_compiler/closure_args.gni") |
declare_args() { |
# Enables used resource whitelist generation. |
@@ -300,6 +301,11 @@ if (mac_views_browser) { |
] |
} |
+# TODO(aberent): Enable for other platforms once the build machines have |
+# Java on them (and hence can run the closure compiler). |
+_strip_resource_files = is_android |
+_js_minifier = "//third_party/closure_compiler/js_minify.py" |
+ |
grit_resource_id_file = "//tools/gritsettings/resource_ids" |
grit_info_script = "//tools/grit/grit_info.py" |
@@ -441,6 +447,21 @@ template("grit") { |
args += grit_flags + assert_files_flags |
+ if (_strip_resource_files) { |
+ js_minifier_command = rebase_path(_js_minifier) |
+ js_minifier_command = "$js_minifier_command --closure_args" |
+ foreach(closure_arg, |
+ common_closure_args + minifying_closure_args + |
+ default_disabled_closure_args) { |
+ js_minifier_command = "$js_minifier_command $closure_arg" |
+ } |
+ args += [ |
+ "--js-minifier", |
+ js_minifier_command, |
+ ] |
+ inputs += [ _js_minifier ] |
+ } |
+ |
if (defined(invoker.visibility)) { |
# This needs to include both what the invoker specified (since they |
# probably include generated headers from this target), as well as the |