OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
6 # to generate Java source files from templates that are processed | 6 # to generate Java source files from templates that are processed |
7 # through the host C pre-processor. | 7 # through the host C pre-processor. |
8 # | 8 # |
9 # NOTE: For generating Java conterparts to enums prefer using the java_cpp_enum | 9 # NOTE: For generating Java conterparts to enums prefer using the java_cpp_enum |
10 # rule instead. | 10 # rule instead. |
(...skipping 16 matching lines...) Expand all Loading... |
27 # itself should use the 'ClassName.template' format, and will generate | 27 # itself should use the 'ClassName.template' format, and will generate |
28 # 'gen/templates/<target-name>/<package-name>/ClassName.java. The files which | 28 # 'gen/templates/<target-name>/<package-name>/ClassName.java. The files which |
29 # template dependents on and typically included by the template should be listed | 29 # template dependents on and typically included by the template should be listed |
30 # in template_deps variables. Any change to them will force a rebuild of | 30 # in template_deps variables. Any change to them will force a rebuild of |
31 # the template, and hence of any source that depends on it. | 31 # the template, and hence of any source that depends on it. |
32 # | 32 # |
33 | 33 |
34 { | 34 { |
35 # Location where all generated Java sources will be placed. | 35 # Location where all generated Java sources will be placed. |
36 'variables': { | 36 'variables': { |
37 'additional_gcc_preprocess_options': [], | |
38 'include_path%': '<(DEPTH)', | 37 'include_path%': '<(DEPTH)', |
39 'output_dir': '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)/<(packag
e_name)', | 38 'output_dir': '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)/<(packag
e_name)', |
40 }, | 39 }, |
41 'direct_dependent_settings': { | 40 'direct_dependent_settings': { |
42 'variables': { | 41 'variables': { |
43 # Ensure that the output directory is used in the class path | 42 # Ensure that the output directory is used in the class path |
44 # when building targets that depend on this one. | 43 # when building targets that depend on this one. |
45 'generated_src_dirs': [ | 44 'generated_src_dirs': [ |
46 '<(output_dir)/', | 45 '<(output_dir)/', |
47 ], | 46 ], |
(...skipping 20 matching lines...) Expand all Loading... |
68 '<@(template_deps)' | 67 '<@(template_deps)' |
69 ], | 68 ], |
70 'outputs': [ | 69 'outputs': [ |
71 '<(output_path)', | 70 '<(output_path)', |
72 ], | 71 ], |
73 'action': [ | 72 'action': [ |
74 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', | 73 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', |
75 '--include-path=<(include_path)', | 74 '--include-path=<(include_path)', |
76 '--output=<(output_path)', | 75 '--output=<(output_path)', |
77 '--template=<(RULE_INPUT_PATH)', | 76 '--template=<(RULE_INPUT_PATH)', |
78 '<@(additional_gcc_preprocess_options)', | |
79 ], | 77 ], |
80 'message': 'Generating Java from cpp template <(RULE_INPUT_PATH)', | 78 'message': 'Generating Java from cpp template <(RULE_INPUT_PATH)', |
81 } | 79 } |
82 ], | 80 ], |
83 } | 81 } |
OLD | NEW |