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 jni bindings for Java-files in a consistent manner. | 6 # to generate jni bindings for Java-files in a consistent manner. |
7 # | 7 # |
8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
9 # { | 9 # { |
10 # 'target_name': 'base_jni_headers', | 10 # 'target_name': 'base_jni_headers', |
(...skipping 14 matching lines...) Expand all Loading... |
25 # (note that RULE_INPUT_ROOT is the basename for the java file). | 25 # (note that RULE_INPUT_ROOT is the basename for the java file). |
26 # | 26 # |
27 # See base/android/jni_generator/jni_generator.py for more info about the | 27 # See base/android/jni_generator/jni_generator.py for more info about the |
28 # format of generating JNI bindings. | 28 # format of generating JNI bindings. |
29 | 29 |
30 { | 30 { |
31 'variables': { | 31 'variables': { |
32 'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py', | 32 'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py', |
33 'jni_generator_jarjar_file%': '', | 33 'jni_generator_jarjar_file%': '', |
34 'jni_generator_ptr_type%': 'int', | 34 'jni_generator_ptr_type%': 'int', |
| 35 # A comma separated string of include files. |
| 36 'jni_generator_includes%': ( |
| 37 'base/android/jni_generator/jni_generator_helper.h' |
| 38 ), |
35 }, | 39 }, |
36 'rules': [ | 40 'rules': [ |
37 { | 41 { |
38 'rule_name': 'generate_jni_headers', | 42 'rule_name': 'generate_jni_headers', |
39 'extension': 'java', | 43 'extension': 'java', |
40 'inputs': [ | 44 'inputs': [ |
41 '<(jni_generator)', | 45 '<(jni_generator)', |
42 ], | 46 ], |
43 'outputs': [ | 47 'outputs': [ |
44 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni/<(RULE_INPUT_ROOT)_jn
i.h', | 48 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni/<(RULE_INPUT_ROOT)_jn
i.h', |
45 ], | 49 ], |
46 'action': [ | 50 'action': [ |
47 '<(jni_generator)', | 51 '<(jni_generator)', |
48 '--input_file', | 52 '--input_file', |
49 '<(RULE_INPUT_PATH)', | 53 '<(RULE_INPUT_PATH)', |
50 '--output_dir', | 54 '--output_dir', |
51 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni', | 55 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni', |
| 56 '--includes', |
| 57 '<(jni_generator_includes)', |
52 '--optimize_generation', | 58 '--optimize_generation', |
53 '<(optimize_jni_generation)', | 59 '<(optimize_jni_generation)', |
54 '--jarjar', | 60 '--jarjar', |
55 '<(jni_generator_jarjar_file)', | 61 '<(jni_generator_jarjar_file)', |
56 '--ptr_type', | 62 '--ptr_type', |
57 '<(jni_generator_ptr_type)', | 63 '<(jni_generator_ptr_type)', |
58 ], | 64 ], |
59 'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)', | 65 'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)', |
60 'process_outputs_as_sources': 1, | 66 'process_outputs_as_sources': 1, |
61 'conditions': [ | 67 'conditions': [ |
62 ['jni_generator_jarjar_file != ""', { | 68 ['jni_generator_jarjar_file != ""', { |
63 'inputs': [ | 69 'inputs': [ |
64 '<(jni_generator_jarjar_file)', | 70 '<(jni_generator_jarjar_file)', |
65 ], | 71 ], |
66 }] | 72 }] |
67 ], | 73 ], |
68 }, | 74 }, |
69 ], | 75 ], |
70 # This target exports a hard dependency because it generates header | 76 # This target exports a hard dependency because it generates header |
71 # files. | 77 # files. |
72 'hard_dependency': 1, | 78 'hard_dependency': 1, |
73 } | 79 } |
OLD | NEW |