OLD | NEW |
| (Empty) |
1 # Copyright 2015 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 # This file is meant to be included into a target to provide a rule | |
6 # to build JavaScript bundles using closure compiler. | |
7 # | |
8 # To use this, create a gyp target with the following form: | |
9 # { | |
10 # 'target_name': 'my_js_target', | |
11 # 'type': 'none', | |
12 # 'variables': { | |
13 # 'closure_entry_point': 'name of the closure module', | |
14 # 'js_bundle_files': ['path/to/dependency/file',], | |
15 # }, | |
16 # 'includes': ['path/to/this/gypi/file'], | |
17 # } | |
18 # | |
19 # Required variables: | |
20 # closure_entry_point - name of the entry point closure module. | |
21 # js_bundle_files - list of js files to build a bundle. | |
22 | |
23 { | |
24 'variables': { | |
25 'closure_compiler_path': '<(DEPTH)/third_party/closure_compiler/compiler/com
piler.jar', | |
26 }, | |
27 'rules': [ | |
28 { | |
29 'rule_name': 'jsbundlecompilation', | |
30 'extension': 'js', | |
31 'inputs': [ | |
32 '<(closure_compiler_path)', | |
33 '<@(js_bundle_files)', | |
34 ], | |
35 'outputs': [ | |
36 '<(SHARED_INTERMEDIATE_DIR)/<(RULE_INPUT_NAME)', | |
37 ], | |
38 'action': [ | |
39 'java', | |
40 '-jar', | |
41 '<(closure_compiler_path)', | |
42 '--compilation_level', | |
43 'SIMPLE_OPTIMIZATIONS', | |
44 # Pass every js file to closure compiler. --only_closure_dependencies | |
45 # flag ensures that unnecessary files will not be compiled into the | |
46 # final output file. | |
47 '--js', | |
48 '<@(js_bundle_files)', | |
49 '--js_output_file', | |
50 '<@(_outputs)', | |
51 '--only_closure_dependencies', | |
52 '--closure_entry_point=<(closure_entry_point)', | |
53 ], | |
54 'message': 'Building <(RULE_INPUT_NAME) JavaScript bundle', | |
55 } # rule_name: jsbundlecompilation | |
56 ] | |
57 } | |
OLD | NEW |