OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 { | 4 { |
5 'type': 'none', | 5 'type': 'none', |
6 'variables': { | 6 'variables': { |
7 'CLOSURE_DIR': '<(DEPTH)/third_party/closure_compiler', | 7 'CLOSURE_DIR': '<(DEPTH)/third_party/closure_compiler', |
8 }, | 8 }, |
9 'actions': [ | 9 'actions': [ |
10 { | 10 { |
11 # This action optionally takes these arguments: | 11 # This action optionally takes these arguments: |
12 # - depends: scripts that the source file depends on being included alread
y | 12 # - source_files: a list of all of the source files to be compiled. |
13 # - externs: files that describe globals used by |source| | 13 # If source_files is not defined, |target_name| will be |
| 14 # used as the single source file. |
| 15 # - out_file: a file where the compiled output is written to. The default |
| 16 # is gen/closure/<target_name_file_path>/|target_name|.js. |
| 17 # - depends: scripts that the source file(s) depends on being included |
| 18 # already. |
| 19 # - externs: files that describe globals used the sourec file(s). |
| 20 # - script_args: additional arguments to pass to compile.py. |
| 21 # - closure_args: additional arguments to pass to the Closure compiler. |
14 'action_name': 'compile_js', | 22 'action_name': 'compile_js', |
15 'variables': { | 23 'variables': { |
16 'source_file': '<(_target_name).js', | 24 'source_files%': ['<(_target_name).js'], |
17 'out_file': '<(SHARED_INTERMEDIATE_DIR)/closure/<!(python <(CLOSURE_DIR)
/build/outputs.py <@(source_file))', | 25 'out_file%': '<(SHARED_INTERMEDIATE_DIR)/closure/<!(python <(CLOSURE_DIR
)/build/outputs.py <(_target_name).js)', |
18 'externs%': [], | 26 'externs%': [], |
19 'depends%': [], | 27 'depends%': [], |
| 28 'script_args%': [], |
| 29 'closure_args': [ |
| 30 'accept_const_keyword', |
| 31 'compilation_level=SIMPLE_OPTIMIZATIONS', |
| 32 'extra_annotation_name=attribute', |
| 33 'extra_annotation_name=element', |
| 34 'extra_annotation_name=group', |
| 35 'extra_annotation_name=homepage', |
| 36 'extra_annotation_name=status', |
| 37 'extra_annotation_name=submodule', |
| 38 'jscomp_error=accessControls', |
| 39 'jscomp_error=ambiguousFunctionDecl', |
| 40 'jscomp_error=checkStructDictInheritance', |
| 41 'jscomp_error=checkTypes', |
| 42 'jscomp_error=checkVars', |
| 43 'jscomp_error=constantProperty', |
| 44 'jscomp_error=deprecated', |
| 45 'jscomp_error=externsValidation', |
| 46 'jscomp_error=globalThis', |
| 47 'jscomp_error=invalidCasts', |
| 48 'jscomp_error=missingProperties', |
| 49 'jscomp_error=missingReturn', |
| 50 'jscomp_error=nonStandardJsDocs', |
| 51 'jscomp_error=suspiciousCode', |
| 52 'jscomp_error=undefinedNames', |
| 53 'jscomp_error=undefinedVars', |
| 54 'jscomp_error=unknownDefines', |
| 55 'jscomp_error=uselessCode', |
| 56 'jscomp_error=visibility', |
| 57 'jscomp_off=duplicate', |
| 58 'jscomp_off=misplacedTypeAnnotation', |
| 59 'language_in=ECMASCRIPT5_STRICT', |
| 60 'polymer_pass', |
| 61 'source_map_format=V3', |
| 62 'summary_detail_level=3', # compile.py depends on this for output pars
ing; do not override. |
| 63 ], |
20 }, | 64 }, |
21 'inputs': [ | 65 'inputs': [ |
22 'compile_js.gypi', | 66 'compile_js.gypi', |
23 '<(CLOSURE_DIR)/compile.py', | 67 '<(CLOSURE_DIR)/compile.py', |
24 '<(CLOSURE_DIR)/processor.py', | 68 '<(CLOSURE_DIR)/processor.py', |
25 '<(CLOSURE_DIR)/build/inputs.py', | 69 '<(CLOSURE_DIR)/build/inputs.py', |
26 '<(CLOSURE_DIR)/build/outputs.py', | 70 '<(CLOSURE_DIR)/build/outputs.py', |
27 '<(CLOSURE_DIR)/compiler/compiler.jar', | 71 '<(CLOSURE_DIR)/compiler/compiler.jar', |
28 '<(CLOSURE_DIR)/runner/runner.jar', | 72 '<(CLOSURE_DIR)/runner/runner.jar', |
29 '<!@(python <(CLOSURE_DIR)/build/inputs.py <(source_file) -d <@(depends)
-e <@(externs))', | 73 '<!@(python <(CLOSURE_DIR)/build/inputs.py <@(source_files) -d <@(depend
s) -e <@(externs))', |
30 ], | 74 ], |
31 'outputs': [ | 75 'outputs': [ |
32 '<(out_file)', | 76 '<(out_file)', |
33 ], | 77 ], |
34 'action': [ | 78 'action': [ |
35 'python', | 79 'python', |
36 '<(CLOSURE_DIR)/compile.py', | 80 '<(CLOSURE_DIR)/compile.py', |
37 '<(source_file)', | 81 '<@(source_files)', |
| 82 '<@(script_args)', |
38 '--depends', '<@(depends)', | 83 '--depends', '<@(depends)', |
39 '--externs', '<@(externs)', | 84 '--externs', '<@(externs)', |
40 '--out_file', '<(out_file)', | 85 '--out-file', '<(out_file)', |
| 86 '--closure-args', '<@(closure_args)', |
41 # Add '--verbose' for make glorious log spam of Closure compiler. | 87 # Add '--verbose' for make glorious log spam of Closure compiler. |
42 ], | 88 ], |
43 'message': 'Compiling <(source_file)', | 89 'message': 'Compiling <(_target_name)', |
44 } | 90 } |
45 ], | 91 ], |
46 } | 92 } |
OLD | NEW |