2012-04-17 08:39:52 +04:00
|
|
|
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# This file is meant to be included into a target to provide a rule
|
|
|
|
# to generate jni bindings for Java-files in a consistent manner.
|
|
|
|
#
|
|
|
|
# To use this, create a gyp target with the following form:
|
2012-07-20 00:02:55 +04:00
|
|
|
# {
|
|
|
|
# 'target_name': 'base_jni_headers',
|
|
|
|
# 'type': 'none',
|
|
|
|
# 'sources': [
|
|
|
|
# 'android/java/src/org/chromium/base/BuildInfo.java',
|
|
|
|
# ...
|
|
|
|
# ...
|
|
|
|
# 'android/java/src/org/chromium/base/SystemMessageHandler.java',
|
|
|
|
# ],
|
|
|
|
# 'variables': {
|
2013-03-08 02:34:05 +04:00
|
|
|
# 'jni_gen_package': 'base',
|
2012-07-20 00:02:55 +04:00
|
|
|
# },
|
|
|
|
# 'includes': [ '../build/jni_generator.gypi' ],
|
|
|
|
# },
|
2012-04-17 08:39:52 +04:00
|
|
|
#
|
2012-07-20 00:02:55 +04:00
|
|
|
# The generated file name pattern can be seen on the "outputs" section below.
|
|
|
|
# (note that RULE_INPUT_ROOT is the basename for the java file).
|
2012-04-17 08:39:52 +04:00
|
|
|
#
|
|
|
|
# See base/android/jni_generator/jni_generator.py for more info about the
|
|
|
|
# format of generating JNI bindings.
|
|
|
|
|
|
|
|
{
|
2012-07-20 00:02:55 +04:00
|
|
|
'variables': {
|
|
|
|
'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py',
|
2013-05-29 17:51:23 +04:00
|
|
|
'jni_generator_jarjar_file%': '',
|
2013-11-05 04:54:22 +04:00
|
|
|
'jni_generator_ptr_type%': 'int',
|
2012-07-20 00:02:55 +04:00
|
|
|
},
|
|
|
|
'rules': [
|
|
|
|
{
|
|
|
|
'rule_name': 'generate_jni_headers',
|
|
|
|
'extension': 'java',
|
|
|
|
'inputs': [
|
|
|
|
'<(jni_generator)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
2013-03-08 02:34:05 +04:00
|
|
|
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni/<(RULE_INPUT_ROOT)_jni.h',
|
2012-07-20 00:02:55 +04:00
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'<(jni_generator)',
|
|
|
|
'--input_file',
|
|
|
|
'<(RULE_INPUT_PATH)',
|
|
|
|
'--output_dir',
|
2013-03-08 02:34:05 +04:00
|
|
|
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni',
|
2013-02-22 04:37:33 +04:00
|
|
|
'--optimize_generation',
|
|
|
|
'<(optimize_jni_generation)',
|
2013-05-29 17:51:23 +04:00
|
|
|
'--jarjar',
|
|
|
|
'<(jni_generator_jarjar_file)',
|
2013-11-05 04:54:22 +04:00
|
|
|
'--ptr_type',
|
|
|
|
'<(jni_generator_ptr_type)',
|
2012-07-20 00:02:55 +04:00
|
|
|
],
|
|
|
|
'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)',
|
|
|
|
'process_outputs_as_sources': 1,
|
2013-05-30 18:16:12 +04:00
|
|
|
'conditions': [
|
|
|
|
['jni_generator_jarjar_file != ""', {
|
|
|
|
'inputs': [
|
|
|
|
'<(jni_generator_jarjar_file)',
|
|
|
|
],
|
|
|
|
}]
|
|
|
|
],
|
2012-07-20 00:02:55 +04:00
|
|
|
},
|
2012-04-17 08:39:52 +04:00
|
|
|
],
|
2013-12-17 12:31:34 +04:00
|
|
|
'direct_dependent_settings': {
|
|
|
|
'include_dirs': [
|
|
|
|
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)',
|
|
|
|
],
|
|
|
|
},
|
2012-07-20 00:02:55 +04:00
|
|
|
# This target exports a hard dependency because it generates header
|
|
|
|
# files.
|
|
|
|
'hard_dependency': 1,
|
2012-04-17 08:39:52 +04:00
|
|
|
}
|