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 # This file is meant to be included into a target to provide an action | 5 # This file is meant to be included into a target to provide an action |
6 # to generate Java source files from a C++ header file containing annotated | 6 # to generate Java source files from a C++ header file containing annotated |
7 # enum definitions using a Python script. | 7 # enum definitions using a Python script. |
8 # | 8 # |
9 # To use this, create a gyp target with the following form: | 9 # To use this, create a gyp target with the following form: |
10 # { | 10 # { |
(...skipping 15 matching lines...) Expand all Loading... |
26 'generator_path': '<(DEPTH)/build/android/gyp/java_cpp_enum.py', | 26 'generator_path': '<(DEPTH)/build/android/gyp/java_cpp_enum.py', |
27 'generator_args': '<(output_dir) <(source_file)', | 27 'generator_args': '<(output_dir) <(source_file)', |
28 }, | 28 }, |
29 'direct_dependent_settings': { | 29 'direct_dependent_settings': { |
30 'variables': { | 30 'variables': { |
31 # Ensure that the output directory is used in the class path | 31 # Ensure that the output directory is used in the class path |
32 # when building targets that depend on this one. | 32 # when building targets that depend on this one. |
33 'generated_src_dirs': [ | 33 'generated_src_dirs': [ |
34 '<(output_dir)/', | 34 '<(output_dir)/', |
35 ], | 35 ], |
| 36 # Ensure that the targets depending on this one are rebuilt if the sources |
| 37 # of this one are modified. |
| 38 'additional_input_paths': [ |
| 39 '<(source_file)', |
| 40 ], |
36 }, | 41 }, |
37 }, | 42 }, |
38 'actions': [ | 43 'actions': [ |
39 { | 44 { |
40 'action_name': 'generate_java_constants', | 45 'action_name': 'generate_java_constants', |
41 'inputs': [ | 46 'inputs': [ |
42 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 47 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
43 '<(generator_path)', | 48 '<(generator_path)', |
44 '<(source_file)', | 49 '<(source_file)', |
45 ], | 50 ], |
46 'outputs': [ | 51 'outputs': [ |
47 # This is the main reason this is an action and not a rule. Gyp doesn't | 52 # This is the main reason this is an action and not a rule. Gyp doesn't |
48 # properly expand RULE_INPUT_PATH here and so it's impossible to | 53 # properly expand RULE_INPUT_PATH here and so it's impossible to |
49 # calculate the list of outputs. | 54 # calculate the list of outputs. |
50 '<!@pymod_do_main(java_cpp_enum --print_output_only ' | 55 '<!@pymod_do_main(java_cpp_enum --print_output_only ' |
51 '<@(generator_args))', | 56 '<@(generator_args))', |
52 ], | 57 ], |
53 'action': [ | 58 'action': [ |
54 'python', '<(generator_path)', '<@(generator_args)' | 59 'python', '<(generator_path)', '<@(generator_args)' |
55 ], | 60 ], |
56 'message': 'Generating Java from cpp header <(source_file)', | 61 'message': 'Generating Java from cpp header <(source_file)', |
57 }, | 62 }, |
58 ], | 63 ], |
59 } | 64 } |
OLD | NEW |