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

Side by Side Diff: third_party/closure_compiler/compile_js2.gni

Issue 2247353004: GN files for running Closure Compiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add script to generate polymer gn files Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « third_party/closure_compiler/compile2.py ('k') | third_party/closure_compiler/run_compiler » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("closure_args.gni")
6
7 template("compile_js") {
8 # This template optionally takes these arguments:
9 # - sources: a list of all of the source files to be compiled. Required.
10 # - out_file: a file where the compiled output is written to. The default
11 # is ${target_gen_dir}/closure/${target_name}.js".
12 # - script_args: additional arguments to pass to compile.py.
13 # - closure_args: additional arguments to pass to the Closure compiler.
14 # - disabled_closure_args: additional arguments dealing with the
15 # strictness of compilation; Non-strict
16 # defaults are provided that can be overriden.
17 # - externs: externs required to compile the sources
18 # - interfaces: interfaces required to compile the sources
19 forward_variables_from(invoker,
20 [
21 "source_files",
22 "deps",
23 "out_file",
24 "script_args",
25 "closure_args",
26 "runner_args",
27 "disabled_closure_args",
28 "externs",
29 "interfaces",
30 ])
31
32 CLOSURE_DIR = "//third_party/closure_compiler"
33
34 action(target_name) {
35 assert(defined(source_files))
36
37 if (!defined(runner_args)) {
38 runner_args = [ "enable-chrome-pass" ]
39 }
40 if (!defined(script_args)) {
41 script_args = []
42 }
43 if (!defined(closure_args)) {
44 closure_args = common_closure_args + checking_closure_args
45 }
46 if (!defined(disabled_closure_args)) {
47 disabled_closure_args = default_disabled_closure_args
48 }
49 if (!defined(out_file)) {
50 out_file = "${target_gen_dir}/closure/${target_name}.js"
51 }
52 inputs = [
53 "${CLOSURE_DIR}/compile.py",
54 "${CLOSURE_DIR}/processor.py",
55 "${CLOSURE_DIR}/build/inputs.py",
56 "${CLOSURE_DIR}/build/outputs.py",
57 "${CLOSURE_DIR}/compiler/compiler.jar",
58 "${CLOSURE_DIR}/runner/runner.jar",
59 ]
60
61 sources = source_files
62
63 if (defined(externs)) {
64 EXTERNS_DIR = "${CLOSURE_DIR}/externs"
65 foreach(extern, externs) {
66 sources += [ "$EXTERNS_DIR/$extern" ]
67 }
68 }
69 if (defined(interfaces)) {
70 INTERFACES_DIR = "${CLOSURE_DIR}/interfaces"
71 foreach(interface, interfaces) {
72 sources += [ "$INTERFACES_DIR/$interface" ]
73 }
74 }
75 outputs = [
76 out_file,
77 ]
78
79 # assign the sources to data to create run-time list of sources from the
80 # dependency tree
81 data = sources
82 source_list_file =
83 "${target_gen_dir}/closure/${target_name}_source_list_file"
84 write_runtime_deps = source_list_file
85
86 script = "${CLOSURE_DIR}/compile2.py"
87 args = script_args + rebase_path(sources)
88 args += [
89 "--out_file",
90 rebase_path(out_file),
91 ]
92 args += [
93 "--gn_source_list_file",
94 rebase_path(source_list_file),
95 ]
96 args += [ "--runner_args" ] + runner_args
97 args += [ "--closure_args" ] + closure_args + disabled_closure_args
98 }
99 }
OLDNEW
« no previous file with comments | « third_party/closure_compiler/compile2.py ('k') | third_party/closure_compiler/run_compiler » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698