Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Unified Diff: third_party/closure_compiler/compile_js2.gni

Issue 2094193004: Strip comments and whitespace from Javascript resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments, plus rebases. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/closure_compiler/compile_js2.gni
diff --git a/third_party/closure_compiler/compile_js2.gni b/third_party/closure_compiler/compile_js2.gni
new file mode 100644
index 0000000000000000000000000000000000000000..bc7b3c69e0d64ff77362bbee2fc3c79ce4b59a16
--- /dev/null
+++ b/third_party/closure_compiler/compile_js2.gni
@@ -0,0 +1,35 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//third_party/closure_compiler/closure_args.gni")
+
+closure_compiler_dir = "//third_party/closure_compiler"
+
+template("compile_js2_foreach") {
+ action_foreach(target_name) {
+ sources = invoker.sources
+ script = "$closure_compiler_dir/compile2.py"
+ output_name =
+ "{{source_gen_dir}}/closure_${target_name}/{{source_file_part}}"
+ outputs = [
+ output_name,
+ ]
+ closure_args = common_closure_args
+
+ if (defined(invoker.strip_whitespace) && invoker.strip_whitespace) {
+ closure_args += [ "compilation_level=WHITESPACE_ONLY" ]
+ } else {
+ closure_args +=
+ typecheck_closure_args + [ "compilation_level=SIMPLE_OPTIMIZATIONS" ]
+ }
+
+ args = [
+ "{{source}}",
+ "--out_file",
+ rebase_path("$root_out_dir/$output_name"),
+ "--closure_args",
+ ] + closure_args + default_disabled_closure_args
+ deps = invoker.deps
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698