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 'closure_args+': [ | |
9 'accept_const_keyword', | |
10 'compilation_level=SIMPLE_OPTIMIZATIONS', | |
11 'extra_annotation_name=attribute', | |
12 'extra_annotation_name=element', | |
13 'extra_annotation_name=group', | |
14 'extra_annotation_name=homepage', | |
15 'extra_annotation_name=status', | |
16 'extra_annotation_name=submodule', | |
17 'jscomp_error=accessControls', | |
18 'jscomp_error=ambiguousFunctionDecl', | |
19 'jscomp_error=checkStructDictInheritance', | |
20 'jscomp_error=checkTypes', | |
21 'jscomp_error=checkVars', | |
22 'jscomp_error=constantProperty', | |
23 'jscomp_error=deprecated', | |
24 'jscomp_error=externsValidation', | |
25 'jscomp_error=globalThis', | |
26 'jscomp_error=invalidCasts', | |
27 'jscomp_error=missingProperties', | |
28 'jscomp_error=missingReturn', | |
29 'jscomp_error=nonStandardJsDocs', | |
30 'jscomp_error=suspiciousCode', | |
31 'jscomp_error=undefinedNames', | |
32 'jscomp_error=undefinedVars', | |
33 'jscomp_error=unknownDefines', | |
34 'jscomp_error=uselessCode', | |
35 'jscomp_error=visibility', | |
36 'language_in=ECMASCRIPT5_STRICT', | |
37 'polymer_pass', | |
38 'source_map_format=V3', | |
39 'summary_detail_level=3', # compile.py depends on this for output parsing; do not override. | |
40 ], | |
8 }, | 41 }, |
9 'actions': [ | 42 'actions': [ |
10 { | 43 { |
11 # This action optionally takes these arguments: | 44 # This action optionally takes these arguments: |
12 # - depends: scripts that the source file depends on being included alread y | 45 # - source_files: a list of all of the source files to be compiled. |
13 # - externs: files that describe globals used by |source| | 46 # If source_files is not defined, |target_name| will be |
47 # used as the single source file. | |
48 # - out_file: a file where the compiled output is written to. The default | |
49 # is gen/closure/<path to |target_name|>/|target_name|.js. | |
50 # - depends: scripts that the source file(s) depends on being included alr eady. | |
51 # - externs: files that describe globals used the source file(s). | |
52 # - script_args: additional arguments to pass to compile.py. | |
53 # - closure_args: additional arguments to pass to the Closure compiler. | |
54 # - closure_strictness_args: additional arguments dealing with the strictn ess of compilation; | |
55 # Non-strict defaults are provided that can be overriden. | |
14 'action_name': 'compile_js', | 56 'action_name': 'compile_js', |
15 'variables': { | 57 'variables': { |
16 'source_file': '<(_target_name).js', | 58 'source_files%': ['<(_target_name).js'], |
17 'out_file': '<(SHARED_INTERMEDIATE_DIR)/closure/<!(python <(CLOSURE_DIR) /build/outputs.py <@(source_file))', | 59 'out_file%': '<(SHARED_INTERMEDIATE_DIR)/closure/<!(python <(CLOSURE_DIR )/build/outputs.py <(_target_name).js)', |
18 'externs%': [], | 60 'externs%': [], |
19 'depends%': [], | 61 'depends%': [], |
62 'script_args%': [], | |
63 'closure_strictness_args%': [ | |
Dan Beam
2015/06/03 23:39:11
the strictness args are... looser?
Theresa
2015/06/04 17:44:05
I think this could use a better name. The defaults
Theresa
2015/06/04 19:21:30
I was making this more complexly than necessary. I
| |
64 'jscomp_off=duplicate', | |
65 'jscomp_off=misplacedTypeAnnotation', | |
66 ], | |
20 }, | 67 }, |
21 'inputs': [ | 68 'inputs': [ |
22 'compile_js.gypi', | 69 'compile_js.gypi', |
23 '<(CLOSURE_DIR)/compile.py', | 70 '<(CLOSURE_DIR)/compile.py', |
24 '<(CLOSURE_DIR)/processor.py', | 71 '<(CLOSURE_DIR)/processor.py', |
25 '<(CLOSURE_DIR)/build/inputs.py', | 72 '<(CLOSURE_DIR)/build/inputs.py', |
26 '<(CLOSURE_DIR)/build/outputs.py', | 73 '<(CLOSURE_DIR)/build/outputs.py', |
27 '<(CLOSURE_DIR)/compiler/compiler.jar', | 74 '<(CLOSURE_DIR)/compiler/compiler.jar', |
28 '<(CLOSURE_DIR)/runner/runner.jar', | 75 '<(CLOSURE_DIR)/runner/runner.jar', |
29 '<!@(python <(CLOSURE_DIR)/build/inputs.py <(source_file) -d <@(depends) -e <@(externs))', | 76 '<!@(python <(CLOSURE_DIR)/build/inputs.py <@(source_files) -d <@(depend s) -e <@(externs))', |
30 ], | 77 ], |
31 'outputs': [ | 78 'outputs': [ |
32 '<(out_file)', | 79 '<(out_file)', |
33 ], | 80 ], |
34 'action': [ | 81 'action': [ |
35 'python', | 82 'python', |
36 '<(CLOSURE_DIR)/compile.py', | 83 '<(CLOSURE_DIR)/compile.py', |
37 '<(source_file)', | 84 '<@(source_files)', |
85 '<@(script_args)', | |
38 '--depends', '<@(depends)', | 86 '--depends', '<@(depends)', |
39 '--externs', '<@(externs)', | 87 '--externs', '<@(externs)', |
40 '--out_file', '<(out_file)', | 88 '--out-file', '<(out_file)', |
89 '--closure-args', '<@(closure_args)', '<@(closure_strictness_args)', | |
41 # Add '--verbose' for make glorious log spam of Closure compiler. | 90 # Add '--verbose' for make glorious log spam of Closure compiler. |
42 ], | 91 ], |
43 'message': 'Compiling <(source_file)', | 92 'message': 'Compiling <(_target_name)', |
44 } | 93 } |
45 ], | 94 ], |
46 } | 95 } |
OLD | NEW |