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 |
+ } |
+} |