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.
5 # This file is meant to be included into a target to provide a rule
6 # to build JavaScript bundles using closure compiler.
8 # To use this, create a gyp target with the following form:
10 # 'target_name': 'my_js_target',
13 # 'closure_entry_point': 'name of the closure module',
14 # 'js_bundle_files': ['path/to/dependency/file',],
16 # 'includes': ['path/to/this/gypi/file'],
20 # closure_entry_point - name of the entry point closure module.
21 # js_bundle_files - list of js files to build a bundle.
25 'closure_compiler_path': '<(DEPTH)/third_party/closure_compiler/compiler/compiler.jar',
29 'rule_name': 'jsbundlecompilation',
32 '<(closure_compiler_path)',
33 '<@(js_bundle_files)',
36 '<(SHARED_INTERMEDIATE_DIR)/<(RULE_INPUT_NAME)',
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
48 '<@(js_bundle_files)',
51 '--only_closure_dependencies',
52 '--closure_entry_point=<(closure_entry_point)',
54 'message': 'Building <(RULE_INPUT_NAME) JavaScript bundle',
55 } # rule_name: jsbundlecompilation