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.
5 # This file is meant to be included into a target to provide a rule
6 # to generate jni bindings for system Java-files in a consistent manner.
8 # To use this, create a gyp target with the following form:
10 # 'target_name': 'android_jar_jni_headers',
13 # 'jni_gen_package': 'chrome',
14 # 'input_java_class': 'java/io/InputStream.class',
16 # 'includes': [ '../build/jar_file_jni_generator.gypi' ],
20 # input_jar_file - The input jar file, if omitted, android_sdk_jar will be used.
24 'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py',
25 # A comma separated string of include files.
26 'jni_generator_includes%': (
27 'base/android/jni_generator/jni_generator_helper.h'
29 'native_exports%': '',
33 'action_name': 'generate_jni_headers_from_jar_file',
40 'java_class_name': '<!(basename <(input_java_class)|sed "s/\.class//")',
41 'input_jar_file%': '<(android_sdk_jar)'
44 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni/<(java_class_name)_jni.h',
51 '<(input_java_class)',
53 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni',
55 '<(jni_generator_includes)',
56 '--optimize_generation',
57 '<(optimize_jni_generation)',
60 'message': 'Generating JNI bindings from <(input_jar_file)/<(input_java_class)',
61 'process_outputs_as_sources': 1,
64 # This target exports a hard dependency because it generates header
68 ['android_webview_build==1', {
70 'native_exports%': '--native_exports',
73 '<(DEPTH)/build/android/android_exports.gyp:android_exports',