OLD | NEW |
| (Empty) |
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 | |
3 # found in the LICENSE file. | |
4 | |
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. | |
7 # | |
8 # To use this, create a gyp target with the following form: | |
9 # { | |
10 # 'target_name': 'base_jni_headers', | |
11 # 'type': 'none', | |
12 # 'sources': [ | |
13 # 'android/java/src/org/chromium/base/BuildInfo.java', | |
14 # ... | |
15 # ... | |
16 # 'android/java/src/org/chromium/base/SystemMessageHandler.java', | |
17 # ], | |
18 # 'variables': { | |
19 # 'jni_gen_package': 'base', | |
20 # }, | |
21 # 'includes': [ '../build/jni_generator.gypi' ], | |
22 # }, | |
23 # | |
24 # The generated file name pattern can be seen on the "outputs" section below. | |
25 # (note that RULE_INPUT_ROOT is the basename for the java file). | |
26 # | |
27 # See base/android/jni_generator/jni_generator.py for more info about the | |
28 # format of generating JNI bindings. | |
29 | |
30 { | |
31 'variables': { | |
32 'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py', | |
33 'jni_generator_ptr_type%': 'long', | |
34 # A comma separated string of include files. | |
35 'jni_generator_includes%': ( | |
36 'base/android/jni_generator/jni_generator_helper.h' | |
37 ), | |
38 'native_exports%': '--native_exports_optional', | |
39 }, | |
40 'rules': [ | |
41 { | |
42 'rule_name': 'generate_jni_headers', | |
43 'extension': 'java', | |
44 'inputs': [ | |
45 '<(jni_generator)', | |
46 ], | |
47 'outputs': [ | |
48 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni/<(RULE_INPUT_ROOT)_jn
i.h', | |
49 ], | |
50 'action': [ | |
51 '<(jni_generator)', | |
52 '--input_file', | |
53 '<(RULE_INPUT_PATH)', | |
54 '--output_dir', | |
55 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni', | |
56 '--includes', | |
57 '<(jni_generator_includes)', | |
58 '--optimize_generation', | |
59 '<(optimize_jni_generation)', | |
60 '--ptr_type', | |
61 '<(jni_generator_ptr_type)', | |
62 '<(native_exports)', | |
63 ], | |
64 'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)', | |
65 'process_outputs_as_sources': 1, | |
66 }, | |
67 ], | |
68 'direct_dependent_settings': { | |
69 'include_dirs': [ | |
70 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)', | |
71 ], | |
72 }, | |
73 # This target exports a hard dependency because it generates header | |
74 # files. | |
75 'hard_dependency': 1, | |
76 } | |
77 | |
OLD | NEW |