summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 20:02:55 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 20:02:55 +0000
commite46f661504b9d4c2de4dcb6008b9cde4105f871a (patch)
tree5577bf583ea221a532ef05a349f6de757823e6ba
parenta5d07699a28d121d0bcabaef645ef7ece9366292 (diff)
downloadchromium_src-e46f661504b9d4c2de4dcb6008b9cde4105f871a.zip
chromium_src-e46f661504b9d4c2de4dcb6008b9cde4105f871a.tar.gz
chromium_src-e46f661504b9d4c2de4dcb6008b9cde4105f871a.tar.bz2
Uses gyp "rules" rather than "actions" templates for the JNI generator.
This allow finer grain control over what is rebuilt. Also, since we have approval over the generated header file name, it greatly simplifies both the generator and also all the gyp files as they no longer need to list the header file and keep in sync with the java file, so the process now is as simple as adding a single java file to the sources. BUG=137069 TEST=build on android Review URL: https://chromiumcodereview.appspot.com/10798010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147515 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/android/build_info.cc2
-rw-r--r--base/android/jni_generator/jni_generator.gyp24
-rwxr-xr-xbase/android/jni_generator/jni_generator.py134
-rwxr-xr-xbase/android/jni_generator/jni_generator_tests.py13
-rw-r--r--base/android/jni_generator/sample_for_tests.cc2
-rw-r--r--base/android/locale_utils.cc2
-rw-r--r--base/android/path_utils.cc2
-rw-r--r--base/base.gyp19
-rw-r--r--base/message_pump_android.cc2
-rw-r--r--build/jni_generator.gypi82
-rw-r--r--chrome/browser/android/process_utils.cc2
-rw-r--r--chrome/chrome_browser.gypi10
-rw-r--r--content/app/android/content_main.cc2
-rw-r--r--content/app/android/library_loader_hooks.cc2
-rw-r--r--content/app/android/sandboxed_process_service.cc2
-rw-r--r--content/app/android/user_agent.cc2
-rw-r--r--content/browser/android/android_browser_process.cc2
-rw-r--r--content/browser/android/content_settings.cc2
-rw-r--r--content/browser/android/content_view_client.cc2
-rw-r--r--content/browser/android/content_view_core_impl.cc2
-rw-r--r--content/browser/android/content_view_statics.cc2
-rw-r--r--content/browser/android/download_controller.cc2
-rw-r--r--content/browser/android/remote_debugging_controller.cc2
-rw-r--r--content/browser/android/sandboxed_process_launcher.cc2
-rw-r--r--content/browser/android/touch_point.cc2
-rw-r--r--content/browser/device_orientation/data_fetcher_impl_android.cc2
-rw-r--r--content/browser/geolocation/location_api_adapter_android.cc2
-rw-r--r--content/common/android/command_line.cc2
-rw-r--r--content/common/android/device_info.cc2
-rw-r--r--content/common/android/surface_callback.cc2
-rw-r--r--content/common/android/surface_texture_listener.cc2
-rw-r--r--content/common/android/trace_event_binding.cc2
-rw-r--r--content/content_jni.gypi70
-rw-r--r--content/content_shell.gypi13
-rw-r--r--content/shell/android/shell_manager.cc2
-rw-r--r--content/shell/shell_android.cc2
-rw-r--r--media/base/android/media_player_bridge.cc2
-rw-r--r--media/media.gyp31
-rw-r--r--net/android/network_change_notifier_android.cc2
-rw-r--r--net/android/network_library.cc2
-rw-r--r--net/net.gyp16
-rw-r--r--net/proxy/proxy_config_service_android.cc2
-rw-r--r--testing/android/native_test.gyp27
43 files changed, 198 insertions, 305 deletions
diff --git a/base/android/build_info.cc b/base/android/build_info.cc
index e5860c0..fcb2eef 100644
--- a/base/android/build_info.cc
+++ b/base/android/build_info.cc
@@ -11,7 +11,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/logging.h"
#include "base/memory/singleton.h"
-#include "jni/build_info_jni.h"
+#include "jni/BuildInfo_jni.h"
namespace {
diff --git a/base/android/jni_generator/jni_generator.gyp b/base/android/jni_generator/jni_generator.gyp
index 0bd3d46..dc32d22 100644
--- a/base/android/jni_generator/jni_generator.gyp
+++ b/base/android/jni_generator/jni_generator.gyp
@@ -28,25 +28,13 @@
{
'target_name': 'jni_sample_header',
'type': 'none',
- 'actions': [
- {
- 'action_name': 'generate_jni_sample_header',
- 'inputs': [
- 'jni_generator.py',
- 'SampleForTests.java',
- ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/base/jni/sample_for_tests_jni.h',
- ],
- 'action': [
- 'python',
- 'jni_generator.py',
- '-o',
- '<@(_inputs)',
- '<@(_outputs)',
- ],
- },
+ 'sources': [
+ 'SampleForTests.java',
],
+ 'variables': {
+ 'jni_gen_dir': 'base',
+ },
+ 'includes': [ '../../../build/jni_generator.gypi' ],
},
{
'target_name': 'jni_generator_tests',
diff --git a/base/android/jni_generator/jni_generator.py b/base/android/jni_generator/jni_generator.py
index 207bda8..d0a3326 100755
--- a/base/android/jni_generator/jni_generator.py
+++ b/base/android/jni_generator/jni_generator.py
@@ -889,114 +889,86 @@ def WrapOutput(output):
return '\n'.join(ret)
-def ExtractInputFiles(jar_file, input_files, out_dirs):
- """Extracts input files from jar and returns them as list of filenames.
+def ExtractJarInputFile(jar_file, input_file, out_dir):
+ """Extracts input file from jar and returns the filename.
- The input files are extracted to the same directory that the generated jni
+ The input file is extracted to the same directory that the generated jni
headers will be placed in. This is passed as an argument to script.
Args:
- jar_file: the jar file containing the input files to extract
- input_files: the list of files to extract from the jar file
- out_dirs: the name of the directories to extract to
+ jar_file: the jar file containing the input files to extract.
+ input_files: the list of files to extract from the jar file.
+ out_dir: the name of the directories to extract to.
Returns:
- a list of file names of extracted input files
+ the name of extracted input file.
"""
jar_file = zipfile.ZipFile(jar_file)
- extracted_file_names = []
-
- for (input_file, out_dir) in zip(input_files, out_dirs):
- out_dir = os.path.join(out_dir, os.path.dirname(input_file))
- if not os.path.exists(out_dir):
- os.makedirs(out_dir)
- extracted_file_name = os.path.join(out_dir, os.path.basename(input_file))
- with open(extracted_file_name, 'w') as outfile:
- outfile.write(jar_file.read(input_file))
- extracted_file_names.append(extracted_file_name)
-
- return extracted_file_names
-
-
-def GenerateJNIHeaders(input_files, output_files, namespace):
- for i in xrange(len(input_files)):
- try:
- if os.path.splitext(input_files[i])[1] == '.class':
- jni_from_javap = JNIFromJavaP.CreateFromClass(input_files[i], namespace)
- output = jni_from_javap.GetContent()
- else:
- jni_from_java_source = JNIFromJavaSource.CreateFromFile(input_files[i])
- output = jni_from_java_source.GetContent()
- except ParseError, e:
- print e
- sys.exit(1)
- if output_files:
- header_name = output_files[i]
- if not os.path.exists(os.path.dirname(os.path.abspath(header_name))):
- os.makedirs(os.path.dirname(os.path.abspath(header_name)))
- if (not os.path.exists(header_name) or
- file(header_name).read() != output):
- output_file = file(header_name, 'w')
- output_file.write(output)
- output_file.close()
+
+ out_dir = os.path.join(out_dir, os.path.dirname(input_file))
+ if not os.path.exists(out_dir):
+ os.makedirs(out_dir)
+ extracted_file_name = os.path.join(out_dir, os.path.basename(input_file))
+ with open(extracted_file_name, 'w') as outfile:
+ outfile.write(jar_file.read(input_file))
+
+ return extracted_file_name
+
+
+def GenerateJNIHeader(input_file, output_file, namespace):
+ try:
+ if os.path.splitext(input_file)[1] == '.class':
+ jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, namespace)
+ content = jni_from_javap.GetContent()
else:
- print output
-
-
-def CheckFilenames(input_files, output_files):
- """Make sure the input and output have consistent names."""
- if len(input_files) != len(output_files):
- sys.exit('Input files length %d must match output length %d' %
- (len(input_files), len(output_files)))
- for i in xrange(len(input_files)):
- input_prefix = os.path.splitext(os.path.basename(input_files[i]))[0]
- output_prefix = os.path.splitext(os.path.basename(output_files[i]))[0]
- if input_prefix.lower() + 'jni' != output_prefix.replace('_', '').lower():
- sys.exit('\n'.join([
- '*** Error ***',
- 'Input and output files have inconsistent names:',
- '\t' + os.path.basename(input_files[i]),
- '\t' + os.path.basename(output_files[i]),
- '',
- 'Input "FooBar.java" must be converted to output "foo_bar_jni.h"',
- '',
- ]))
+ jni_from_java_source = JNIFromJavaSource.CreateFromFile(input_file)
+ content = jni_from_java_source.GetContent()
+ except ParseError, e:
+ print e
+ sys.exit(1)
+ if output_file:
+ if not os.path.exists(os.path.dirname(os.path.abspath(output_file))):
+ os.makedirs(os.path.dirname(os.path.abspath(output_file)))
+ with file(output_file, 'w') as f:
+ f.write(content)
+ else:
+ print output
def main(argv):
- usage = """usage: %prog [OPTION] file1[ file2...] [output1[ output2...]]
+ usage = """usage: %prog [OPTIONS]
This script will parse the given java source code extracting the native
declarations and print the header file to stdout (or a file).
See SampleForTests.java for more details.
"""
option_parser = optparse.OptionParser(usage=usage)
- option_parser.add_option('-o', dest='output_files',
- action='store_true',
- default=False,
- help='Saves the output to file(s) (the first half of'
- ' args specify the java input files, the second'
- ' half specify the header output files.')
option_parser.add_option('-j', dest='jar_file',
help='Extract the list of input files from'
' a specified jar file.'
' Uses javap to extract the methods from a'
- ' pre-compiled class. Input files should point'
+ ' pre-compiled class. --input should point'
' to pre-compiled Java .class files.')
option_parser.add_option('-n', dest='namespace',
help='Uses as a namespace in the generated header,'
' instead of the javap class name.')
+ option_parser.add_option('--input_file',
+ help='Single input file name. The output file name '
+ 'will be derived from it. Must be used with '
+ '--output_dir.')
+ option_parser.add_option('--output_dir',
+ help='The output directory. Must be used with '
+ '--input')
options, args = option_parser.parse_args(argv)
- input_files = args[1:]
- output_files = []
- if options.output_files:
- output_files = input_files[len(input_files) / 2:]
- input_files = input_files[:len(input_files) / 2]
- CheckFilenames(input_files, output_files)
if options.jar_file:
- # CheckFileNames guarantees same length for inputs and outputs
- out_dirs = map(os.path.dirname, output_files)
- input_files = ExtractInputFiles(options.jar_file, input_files, out_dirs)
- GenerateJNIHeaders(input_files, output_files, options.namespace)
+ input_file = ExtractJarInputFile(options.jar_file, options.input_file,
+ options.output_dir)
+ else:
+ input_file = options.input_file
+ output_file = None
+ if options.output_dir:
+ root_name = os.path.splitext(os.path.basename(input_file))[0]
+ output_file = os.path.join(options.output_dir, root_name) + '_jni.h'
+ GenerateJNIHeader(input_file, output_file, options.namespace)
if __name__ == '__main__':
diff --git a/base/android/jni_generator/jni_generator_tests.py b/base/android/jni_generator/jni_generator_tests.py
index 1ce7a37..71d390d 100755
--- a/base/android/jni_generator/jni_generator_tests.py
+++ b/base/android/jni_generator/jni_generator_tests.py
@@ -1491,18 +1491,5 @@ static bool RegisterNativesImpl(JNIEnv* env) {
content, 'org/chromium/example/jni_generator/SampleForTests')
self.assertTextEquals(golden_content, jni_from_java.GetContent())
- def testCheckFilenames(self):
- self.assertRaises(SystemExit, jni_generator.CheckFilenames,
- ['more', 'input', 'than'], ['output'])
- self.assertRaises(SystemExit, jni_generator.CheckFilenames,
- ['more'], ['output', 'than', 'input'])
- self.assertRaises(SystemExit, jni_generator.CheckFilenames,
- ['NotTheSame.java'], ['not_good.h'])
- self.assertRaises(SystemExit, jni_generator.CheckFilenames,
- ['MissingJniSuffix.java'], ['missing_jni_suffix.h'])
- jni_generator.CheckFilenames(['ThisIsFine.java'], ['this_is_fine_jni.h'])
- jni_generator.CheckFilenames([], [])
-
-
if __name__ == '__main__':
unittest.main()
diff --git a/base/android/jni_generator/sample_for_tests.cc b/base/android/jni_generator/sample_for_tests.cc
index 0583d12..0c06776 100644
--- a/base/android/jni_generator/sample_for_tests.cc
+++ b/base/android/jni_generator/sample_for_tests.cc
@@ -37,7 +37,7 @@ class CPPClass {
} // namespace content
-#include "jni/sample_for_tests_jni.h"
+#include "jni/SampleForTests_jni.h"
int main() {
// On a regular application, you'd call AttachCurrentThread(). This sample is
diff --git a/base/android/locale_utils.cc b/base/android/locale_utils.cc
index c2a88cf..2a7da8e 100644
--- a/base/android/locale_utils.cc
+++ b/base/android/locale_utils.cc
@@ -9,7 +9,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/logging.h"
#include "base/string_util.h"
-#include "jni/locale_utils_jni.h"
+#include "jni/LocaleUtils_jni.h"
#include "unicode/uloc.h"
namespace base {
diff --git a/base/android/path_utils.cc b/base/android/path_utils.cc
index cf5542a..52fdd8dd6 100644
--- a/base/android/path_utils.cc
+++ b/base/android/path_utils.cc
@@ -8,7 +8,7 @@
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
-#include "jni/path_utils_jni.h"
+#include "jni/PathUtils_jni.h"
namespace base {
namespace android {
diff --git a/base/base.gyp b/base/base.gyp
index 6839ef04..e65f6fd 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -939,19 +939,14 @@
{
'target_name': 'base_jni_headers',
'type': 'none',
+ 'sources': [
+ 'android/java/src/org/chromium/base/BuildInfo.java',
+ 'android/java/src/org/chromium/base/LocaleUtils.java',
+ 'android/java/src/org/chromium/base/PathUtils.java',
+ 'android/java/src/org/chromium/base/SystemMessageHandler.java',
+ ],
'variables': {
- 'java_sources': [
- 'android/java/src/org/chromium/base/BuildInfo.java',
- 'android/java/src/org/chromium/base/LocaleUtils.java',
- 'android/java/src/org/chromium/base/PathUtils.java',
- 'android/java/src/org/chromium/base/SystemMessageHandler.java',
- ],
- 'jni_headers': [
- '<(SHARED_INTERMEDIATE_DIR)/base/jni/build_info_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/base/jni/locale_utils_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/base/jni/path_utils_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/base/jni/system_message_handler_jni.h',
- ],
+ 'jni_gen_dir': 'base',
},
'includes': [ '../build/jni_generator.gypi' ],
},
diff --git a/base/message_pump_android.cc b/base/message_pump_android.cc
index 2bc904af..29bf965 100644
--- a/base/message_pump_android.cc
+++ b/base/message_pump_android.cc
@@ -11,7 +11,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/run_loop.h"
-#include "jni/system_message_handler_jni.h"
+#include "jni/SystemMessageHandler_jni.h"
using base::android::ScopedJavaLocalRef;
diff --git a/build/jni_generator.gypi b/build/jni_generator.gypi
index b570026..837d9ab 100644
--- a/build/jni_generator.gypi
+++ b/build/jni_generator.gypi
@@ -6,51 +6,53 @@
# to generate jni bindings for Java-files in a consistent manner.
#
# To use this, create a gyp target with the following form:
-# {
-# 'target_name': 'base_jni_headers',
-# 'type': 'none',
-# 'variables': {
-# 'java_sources': [
-# 'android/java/org/chromium/base/BuildInfo.java',
-# 'android/java/org/chromium/base/PathUtils.java',
-# 'android/java/org/chromium/base/SystemMessageHandler.java',
-# ],
-# 'jni_headers': [
-# '<(SHARED_INTERMEDIATE_DIR)/base/jni/build_info_jni.h',
-# '<(SHARED_INTERMEDIATE_DIR)/base/jni/path_utils_jni.h',
-# '<(SHARED_INTERMEDIATE_DIR)/base/jni/system_message_handler_jni.h',
-# ],
-# },
-# 'includes': [ '../build/jni_generator.gypi' ],
-# }
+# {
+# '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': {
+# 'jni_gen_dir': 'base',
+# },
+# 'includes': [ '../build/jni_generator.gypi' ],
+# },
#
-# The ordering of the java_sources must match the ordering of jni_headers. The
-# result is that for each Java file listed in java_sources, the corresponding
-# entry in jni_headers contains the JNI bindings produced from running the
-# jni_generator on the input file.
+# 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).
#
# See base/android/jni_generator/jni_generator.py for more info about the
# format of generating JNI bindings.
{
- 'actions': [
- {
- 'action_name': 'generate_jni_headers',
- 'type': 'none',
- 'inputs': [
- '<(DEPTH)/base/android/jni_generator/jni_generator.py',
- '<@(java_sources)',
- ],
- 'outputs': [
- '<@(jni_headers)',
- ],
- 'action': [
- 'python',
- '<(DEPTH)/base/android/jni_generator/jni_generator.py',
- '-o',
- '<@(_inputs)',
- '<@(_outputs)',
- ],
- },
+ 'variables': {
+ 'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py',
+ },
+ 'rules': [
+ {
+ 'rule_name': 'generate_jni_headers',
+ 'extension': 'java',
+ 'inputs': [
+ '<(jni_generator)',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni/<(RULE_INPUT_ROOT)_jni.h',
+ ],
+ 'action': [
+ '<(jni_generator)',
+ '--input_file',
+ '<(RULE_INPUT_PATH)',
+ '--output_dir',
+ '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni',
+ ],
+ 'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)',
+ 'process_outputs_as_sources': 1,
+ },
],
+ # This target exports a hard dependency because it generates header
+ # files.
+ 'hard_dependency': 1,
}
diff --git a/chrome/browser/android/process_utils.cc b/chrome/browser/android/process_utils.cc
index 79d967b..c0f5280 100644
--- a/chrome/browser/android/process_utils.cc
+++ b/chrome/browser/android/process_utils.cc
@@ -10,7 +10,7 @@
#include "base/logging.h"
#include "chrome/common/render_messages.h"
#include "content/public/browser/render_process_host.h"
-#include "jni/process_utils_jni.h"
+#include "jni/ProcessUtils_jni.h"
namespace {
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 278e1a6..cbc76c2 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -5453,13 +5453,11 @@
{
'target_name': 'chrome_browser_jni_headers',
'type': 'none',
+ 'sources': [
+ 'android/java/src/org/chromium/chrome/browser/ProcessUtils.java',
+ ],
'variables': {
- 'java_sources': [
- 'android/java/src/org/chromium/chrome/browser/ProcessUtils.java',
- ],
- 'jni_headers': [
- '<(SHARED_INTERMEDIATE_DIR)/chrome/jni/process_utils_jni.h',
- ],
+ 'jni_gen_dir': 'chrome',
},
'includes': [ '../build/jni_generator.gypi' ],
},
diff --git a/content/app/android/content_main.cc b/content/app/android/content_main.cc
index bd509ca..f373186 100644
--- a/content/app/android/content_main.cc
+++ b/content/app/android/content_main.cc
@@ -12,7 +12,7 @@
#include "content/public/app/content_main_delegate.h"
#include "content/public/app/content_main_runner.h"
#include "content/public/common/content_switches.h"
-#include "jni/content_main_jni.h"
+#include "jni/ContentMain_jni.h"
#include "webkit/glue/user_agent.h"
using base::LazyInstance;
diff --git a/content/app/android/library_loader_hooks.cc b/content/app/android/library_loader_hooks.cc
index 0661fe1..e534a0ba 100644
--- a/content/app/android/library_loader_hooks.cc
+++ b/content/app/android/library_loader_hooks.cc
@@ -24,7 +24,7 @@
#include "content/public/common/content_switches.h"
#include "media/base/android/media_jni_registrar.h"
#include "net/android/net_jni_registrar.h"
-#include "jni/library_loader_jni.h"
+#include "jni/LibraryLoader_jni.h"
namespace {
base::AtExitManager* g_at_exit_manager = NULL;
diff --git a/content/app/android/sandboxed_process_service.cc b/content/app/android/sandboxed_process_service.cc
index 58a2687..291748f 100644
--- a/content/app/android/sandboxed_process_service.cc
+++ b/content/app/android/sandboxed_process_service.cc
@@ -11,7 +11,7 @@
#include "content/public/app/android_library_loader_hooks.h"
#include "content/public/common/content_descriptors.h"
#include "ipc/ipc_descriptors.h"
-#include "jni/sandboxed_process_service_jni.h"
+#include "jni/SandboxedProcessService_jni.h"
using base::android::AttachCurrentThread;
using base::android::CheckException;
diff --git a/content/app/android/user_agent.cc b/content/app/android/user_agent.cc
index aa284e5..7a1c49b 100644
--- a/content/app/android/user_agent.cc
+++ b/content/app/android/user_agent.cc
@@ -7,7 +7,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
-#include "jni/user_agent_jni.h"
+#include "jni/UserAgent_jni.h"
using base::android::AttachCurrentThread;
using base::android::ScopedJavaLocalRef;
diff --git a/content/browser/android/android_browser_process.cc b/content/browser/android/android_browser_process.cc
index 6b1ec64..6d887cb 100644
--- a/content/browser/android/android_browser_process.cc
+++ b/content/browser/android/android_browser_process.cc
@@ -9,7 +9,7 @@
#include "base/logging.h"
#include "content/browser/android/content_startup_flags.h"
#include "content/public/common/content_constants.h"
-#include "jni/android_browser_process_jni.h"
+#include "jni/AndroidBrowserProcess_jni.h"
using base::android::ConvertJavaStringToUTF8;
diff --git a/content/browser/android/content_settings.cc b/content/browser/android/content_settings.cc
index 284c1fe..4511c37 100644
--- a/content/browser/android/content_settings.cc
+++ b/content/browser/android/content_settings.cc
@@ -10,7 +10,7 @@
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/public/browser/web_contents.h"
-#include "jni/content_settings_jni.h"
+#include "jni/ContentSettings_jni.h"
#include "webkit/glue/user_agent.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webpreferences.h"
diff --git a/content/browser/android/content_view_client.cc b/content/browser/android/content_view_client.cc
index 908ce5c..652796c 100644
--- a/content/browser/android/content_view_client.cc
+++ b/content/browser/android/content_view_client.cc
@@ -23,7 +23,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/page_transition_types.h"
#include "content/public/common/referrer.h"
-#include "jni/content_view_client_jni.h"
+#include "jni/ContentViewClient_jni.h"
#include "net/http/http_request_headers.h"
#include "ui/gfx/rect.h"
#include "webkit/glue/window_open_disposition.h"
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 5849427..a867ae5 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -13,7 +13,7 @@
#include "content/browser/web_contents/navigation_controller_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
-#include "jni/content_view_core_jni.h"
+#include "jni/ContentViewCore_jni.h"
#include "webkit/glue/webmenuitem.h"
using base::android::AttachCurrentThread;
diff --git a/content/browser/android/content_view_statics.cc b/content/browser/android/content_view_statics.cc
index bac7b18..b3537ef9 100644
--- a/content/browser/android/content_view_statics.cc
+++ b/content/browser/android/content_view_statics.cc
@@ -11,7 +11,7 @@
#include "base/logging.h"
#include "content/browser/android/content_view_statics.h"
#include "content/common/android/address_parser.h"
-#include "jni/content_view_statics_jni.h"
+#include "jni/ContentViewStatics_jni.h"
using base::android::ConvertJavaStringToUTF16;
using base::android::ConvertUTF16ToJavaString;
diff --git a/content/browser/android/download_controller.cc b/content/browser/android/download_controller.cc
index 16e370a..13b75c7 100644
--- a/content/browser/android/download_controller.cc
+++ b/content/browser/android/download_controller.cc
@@ -18,7 +18,7 @@
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/global_request_id.h"
-#include "jni/download_controller_jni.h"
+#include "jni/DownloadController_jni.h"
#include "net/cookies/cookie_options.h"
#include "net/cookies/cookie_store.h"
#include "net/http/http_request_headers.h"
diff --git a/content/browser/android/remote_debugging_controller.cc b/content/browser/android/remote_debugging_controller.cc
index 763cd16..67f1bd6 100644
--- a/content/browser/android/remote_debugging_controller.cc
+++ b/content/browser/android/remote_debugging_controller.cc
@@ -7,7 +7,7 @@
#include <jni.h>
#include "content/public/browser/android/devtools_server.h"
-#include "jni/remote_debugging_controller_jni.h"
+#include "jni/RemoteDebuggingController_jni.h"
namespace content {
diff --git a/content/browser/android/sandboxed_process_launcher.cc b/content/browser/android/sandboxed_process_launcher.cc
index 9ab99a4..f46f2bb 100644
--- a/content/browser/android/sandboxed_process_launcher.cc
+++ b/content/browser/android/sandboxed_process_launcher.cc
@@ -8,7 +8,7 @@
#include "base/android/jni_array.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "jni/sandboxed_process_launcher_jni.h"
+#include "jni/SandboxedProcessLauncher_jni.h"
using base::android::AttachCurrentThread;
using base::android::ToJavaArrayOfStrings;
diff --git a/content/browser/android/touch_point.cc b/content/browser/android/touch_point.cc
index 17d888d..70ed9db 100644
--- a/content/browser/android/touch_point.cc
+++ b/content/browser/android/touch_point.cc
@@ -8,7 +8,7 @@
#include "base/time.h"
#include "base/logging.h"
-#include "jni/touch_point_jni.h"
+#include "jni/TouchPoint_jni.h"
using WebKit::WebTouchEvent;
using WebKit::WebTouchPoint;
diff --git a/content/browser/device_orientation/data_fetcher_impl_android.cc b/content/browser/device_orientation/data_fetcher_impl_android.cc
index 0354635..e51af51 100644
--- a/content/browser/device_orientation/data_fetcher_impl_android.cc
+++ b/content/browser/device_orientation/data_fetcher_impl_android.cc
@@ -9,7 +9,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "content/browser/device_orientation/orientation.h"
-#include "jni/device_orientation_jni.h"
+#include "jni/DeviceOrientation_jni.h"
using base::android::AttachCurrentThread;
using base::android::CheckException;
diff --git a/content/browser/geolocation/location_api_adapter_android.cc b/content/browser/geolocation/location_api_adapter_android.cc
index 9c2356c..6028a43 100644
--- a/content/browser/geolocation/location_api_adapter_android.cc
+++ b/content/browser/geolocation/location_api_adapter_android.cc
@@ -9,7 +9,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "content/browser/geolocation/location_provider_android.h"
-#include "jni/location_provider_jni.h"
+#include "jni/LocationProvider_jni.h"
using base::android::AttachCurrentThread;
using base::android::CheckException;
diff --git a/content/common/android/command_line.cc b/content/common/android/command_line.cc
index 5b95174..8ac58c2 100644
--- a/content/common/android/command_line.cc
+++ b/content/common/android/command_line.cc
@@ -8,7 +8,7 @@
#include "base/android/jni_string.h"
#include "base/command_line.h"
#include "base/logging.h"
-#include "jni/command_line_jni.h"
+#include "jni/CommandLine_jni.h"
using base::android::AppendJavaStringArrayToStringVector;
using base::android::ConvertJavaStringToUTF8;
diff --git a/content/common/android/device_info.cc b/content/common/android/device_info.cc
index 57211bb..2522cae 100644
--- a/content/common/android/device_info.cc
+++ b/content/common/android/device_info.cc
@@ -7,7 +7,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/logging.h"
-#include "jni/device_info_jni.h"
+#include "jni/DeviceInfo_jni.h"
using base::android::AttachCurrentThread;
using base::android::ConvertJavaStringToUTF8;
diff --git a/content/common/android/surface_callback.cc b/content/common/android/surface_callback.cc
index 069c49b..77757e9 100644
--- a/content/common/android/surface_callback.cc
+++ b/content/common/android/surface_callback.cc
@@ -15,7 +15,7 @@
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "ui/gl/android_native_window.h"
-#include "jni/surface_callback_jni.h"
+#include "jni/SurfaceCallback_jni.h"
using base::android::AttachCurrentThread;
using base::android::CheckException;
diff --git a/content/common/android/surface_texture_listener.cc b/content/common/android/surface_texture_listener.cc
index 1d50a14..6ff63b4 100644
--- a/content/common/android/surface_texture_listener.cc
+++ b/content/common/android/surface_texture_listener.cc
@@ -8,7 +8,7 @@
#include "base/logging.h"
#include "base/message_loop_proxy.h"
#include "content/common/android/surface_texture_bridge.h"
-#include "jni/surface_texture_listener_jni.h"
+#include "jni/SurfaceTextureListener_jni.h"
namespace content {
diff --git a/content/common/android/trace_event_binding.cc b/content/common/android/trace_event_binding.cc
index a39330b..3b14de0 100644
--- a/content/common/android/trace_event_binding.cc
+++ b/content/common/android/trace_event_binding.cc
@@ -10,7 +10,7 @@
#include "base/debug/trace_event.h"
#include "base/lazy_instance.h"
-#include "jni/trace_event_jni.h"
+#include "jni/TraceEvent_jni.h"
namespace {
diff --git a/content/content_jni.gypi b/content/content_jni.gypi
index ba35902..60c8c3a 100644
--- a/content/content_jni.gypi
+++ b/content/content_jni.gypi
@@ -7,53 +7,31 @@
# require specifying the java directory and generate the rest.
# TODO(jrg): when doing the above, make sure we support multiple
# output directories (e.g. browser/jni and common/jni if needed).
+ 'sources': [
+ 'public/android/java/src/org/chromium/content/app/ContentMain.java',
+ 'public/android/java/src/org/chromium/content/app/LibraryLoader.java',
+ 'public/android/java/src/org/chromium/content/app/SandboxedProcessService.java',
+ 'public/android/java/src/org/chromium/content/app/UserAgent.java',
+ 'public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java',
+ 'public/android/java/src/org/chromium/content/browser/ContentSettings.java',
+ 'public/android/java/src/org/chromium/content/browser/ContentVideoView.java',
+ 'public/android/java/src/org/chromium/content/browser/ContentViewClient.java',
+ 'public/android/java/src/org/chromium/content/browser/ContentViewCore.java',
+ 'public/android/java/src/org/chromium/content/browser/ContentViewStatics.java',
+ 'public/android/java/src/org/chromium/content/browser/DeviceOrientation.java',
+ 'public/android/java/src/org/chromium/content/browser/DownloadController.java',
+ 'public/android/java/src/org/chromium/content/browser/LocationProvider.java',
+ 'public/android/java/src/org/chromium/content/browser/RemoteDebuggingController.java',
+ 'public/android/java/src/org/chromium/content/browser/SandboxedProcessLauncher.java',
+ 'public/android/java/src/org/chromium/content/browser/TouchPoint.java',
+ 'public/android/java/src/org/chromium/content/common/CommandLine.java',
+ 'public/android/java/src/org/chromium/content/common/DeviceInfo.java',
+ 'public/android/java/src/org/chromium/content/common/SurfaceCallback.java',
+ 'public/android/java/src/org/chromium/content/common/SurfaceTextureListener.java',
+ 'public/android/java/src/org/chromium/content/common/TraceEvent.java',
+ ],
'variables': {
- 'java_sources': [
- 'public/android/java/src/org/chromium/content/app/ContentMain.java',
- 'public/android/java/src/org/chromium/content/app/LibraryLoader.java',
- 'public/android/java/src/org/chromium/content/app/SandboxedProcessService.java',
- 'public/android/java/src/org/chromium/content/app/UserAgent.java',
- 'public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java',
- 'public/android/java/src/org/chromium/content/browser/ContentSettings.java',
- 'public/android/java/src/org/chromium/content/browser/ContentVideoView.java',
- 'public/android/java/src/org/chromium/content/browser/ContentViewClient.java',
- 'public/android/java/src/org/chromium/content/browser/ContentViewCore.java',
- 'public/android/java/src/org/chromium/content/browser/ContentViewStatics.java',
- 'public/android/java/src/org/chromium/content/browser/DeviceOrientation.java',
- 'public/android/java/src/org/chromium/content/browser/DownloadController.java',
- 'public/android/java/src/org/chromium/content/browser/LocationProvider.java',
- 'public/android/java/src/org/chromium/content/browser/RemoteDebuggingController.java',
- 'public/android/java/src/org/chromium/content/browser/SandboxedProcessLauncher.java',
- 'public/android/java/src/org/chromium/content/browser/TouchPoint.java',
- 'public/android/java/src/org/chromium/content/common/CommandLine.java',
- 'public/android/java/src/org/chromium/content/common/DeviceInfo.java',
- 'public/android/java/src/org/chromium/content/common/SurfaceCallback.java',
- 'public/android/java/src/org/chromium/content/common/SurfaceTextureListener.java',
- 'public/android/java/src/org/chromium/content/common/TraceEvent.java',
- ],
- 'jni_headers': [
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/content_main_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/library_loader_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/sandboxed_process_service_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/user_agent_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/android_browser_process_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/content_settings_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/content_video_view_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/content_view_client_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/content_view_core_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/content_view_statics_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/device_orientation_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/download_controller_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/location_provider_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/remote_debugging_controller_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/sandboxed_process_launcher_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/touch_point_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/command_line_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/device_info_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/surface_callback_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/surface_texture_listener_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/jni/trace_event_jni.h',
- ],
+ 'jni_gen_dir': 'content'
},
'includes': [ '../build/jni_generator.gypi' ],
}
diff --git a/content/content_shell.gypi b/content/content_shell.gypi
index 7fd1c2f..213b32e 100644
--- a/content/content_shell.gypi
+++ b/content/content_shell.gypi
@@ -503,15 +503,12 @@
# require specifying the java directory and generate the rest.
'target_name': 'content_shell_jni_headers',
'type': 'none',
+ 'sources': [
+ 'shell/android/java/src/org/chromium/content_shell/ShellManager.java',
+ 'shell/android/java/src/org/chromium/content_shell/Shell.java',
+ ],
'variables': {
- 'java_sources': [
- 'shell/android/java/src/org/chromium/content_shell/ShellManager.java',
- 'shell/android/java/src/org/chromium/content_shell/Shell.java',
- ],
- 'jni_headers': [
- '<(SHARED_INTERMEDIATE_DIR)/content/shell/jni/shell_manager_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/content/shell/jni/shell_jni.h',
- ],
+ 'jni_gen_dir': 'content/shell',
},
'includes': [ '../build/jni_generator.gypi' ],
},
diff --git a/content/shell/android/shell_manager.cc b/content/shell/android/shell_manager.cc
index 18c1223..127e25a 100644
--- a/content/shell/android/shell_manager.cc
+++ b/content/shell/android/shell_manager.cc
@@ -7,7 +7,7 @@
#include "base/android/jni_android.h"
#include "base/android/scoped_java_ref.h"
#include "base/lazy_instance.h"
-#include "jni/shell_manager_jni.h"
+#include "jni/ShellManager_jni.h"
using base::android::ScopedJavaLocalRef;
diff --git a/content/shell/shell_android.cc b/content/shell/shell_android.cc
index a8fea37..242651c 100644
--- a/content/shell/shell_android.cc
+++ b/content/shell/shell_android.cc
@@ -11,7 +11,7 @@
#include "base/logging.h"
#include "base/string_piece.h"
#include "content/shell/android/shell_manager.h"
-#include "jni/shell_jni.h"
+#include "jni/Shell_jni.h"
using base::android::AttachCurrentThread;
using base::android::ConvertUTF8ToJavaString;
diff --git a/media/base/android/media_player_bridge.cc b/media/base/android/media_player_bridge.cc
index 44d13b6..2728271 100644
--- a/media/base/android/media_player_bridge.cc
+++ b/media/base/android/media_player_bridge.cc
@@ -12,7 +12,7 @@
// Auto generated jni class from MediaPlayerListener.java.
// Check base/android/jni_generator/golden_sample_for_tests_jni.h for example.
-#include "jni/media_player_listener_jni.h"
+#include "jni/MediaPlayerListener_jni.h"
using base::android::AttachCurrentThread;
using base::android::CheckException;
diff --git a/media/media.gyp b/media/media.gyp
index fdfc072..dfec9b7 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -1013,6 +1013,17 @@
['OS == "android"', {
'targets': [
{
+ 'target_name': 'player_android_jni_headers',
+ 'type': 'none',
+ 'sources': [
+ 'base/android/java/src/org/chromium/media/MediaPlayerListener.java',
+ ],
+ 'variables': {
+ 'jni_gen_dir': 'media',
+ },
+ 'includes': [ '../build/jni_generator.gypi' ],
+ },
+ {
'target_name': 'player_android',
'type': 'static_library',
'sources': [
@@ -1021,29 +1032,11 @@
],
'dependencies': [
'../base/base.gyp:base',
+ 'player_android_jni_headers',
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)/media',
],
- 'actions': [
- {
- 'action_name': 'generate-jni-headers',
- 'inputs': [
- '../base/android/jni_generator/jni_generator.py',
- 'base/android/java/src/org/chromium/media/MediaPlayerListener.java',
- ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/media/jni/media_player_listener_jni.h',
- ],
- 'action': [
- 'python',
- '<(DEPTH)/base/android/jni_generator/jni_generator.py',
- '-o',
- '<@(_inputs)',
- '<@(_outputs)',
- ],
- },
- ],
},
{
'target_name': 'media_java',
diff --git a/net/android/network_change_notifier_android.cc b/net/android/network_change_notifier_android.cc
index 8c74087..8e98bf5 100644
--- a/net/android/network_change_notifier_android.cc
+++ b/net/android/network_change_notifier_android.cc
@@ -6,7 +6,7 @@
#include "base/logging.h"
#include "base/android/jni_android.h"
-#include "jni/network_change_notifier_jni.h"
+#include "jni/NetworkChangeNotifier_jni.h"
namespace net {
namespace android {
diff --git a/net/android/network_library.cc b/net/android/network_library.cc
index 57cf551..d518abaf 100644
--- a/net/android/network_library.cc
+++ b/net/android/network_library.cc
@@ -9,7 +9,7 @@
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "base/logging.h"
-#include "jni/android_network_library_jni.h"
+#include "jni/AndroidNetworkLibrary_jni.h"
using base::android::AttachCurrentThread;
using base::android::ClearException;
diff --git a/net/net.gyp b/net/net.gyp
index 7cef705..881eeff 100644
--- a/net/net.gyp
+++ b/net/net.gyp
@@ -1903,17 +1903,13 @@
{
'target_name': 'net_jni_headers',
'type': 'none',
+ 'sources': [
+ 'android/java/src/org/chromium/net/AndroidNetworkLibrary.java',
+ 'android/java/src/org/chromium/net/NetworkChangeNotifier.java',
+ 'android/java/src/org/chromium/net/ProxyChangeListener.java',
+ ],
'variables': {
- 'java_sources': [
- 'android/java/src/org/chromium/net/AndroidNetworkLibrary.java',
- 'android/java/src/org/chromium/net/NetworkChangeNotifier.java',
- 'android/java/src/org/chromium/net/ProxyChangeListener.java',
- ],
- 'jni_headers': [
- '<(SHARED_INTERMEDIATE_DIR)/net/jni/android_network_library_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/net/jni/network_change_notifier_jni.h',
- '<(SHARED_INTERMEDIATE_DIR)/net/jni/proxy_change_listener_jni.h',
- ],
+ 'jni_gen_dir': 'net',
},
'includes': [ '../build/jni_generator.gypi' ],
},
diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc
index 0bb75b8..6a0be78 100644
--- a/net/proxy/proxy_config_service_android.cc
+++ b/net/proxy/proxy_config_service_android.cc
@@ -19,7 +19,7 @@
#include "base/string_tokenizer.h"
#include "base/string_util.h"
#include "googleurl/src/url_parse.h"
-#include "jni/proxy_change_listener_jni.h"
+#include "jni/ProxyChangeListener_jni.h"
#include "net/base/host_port_pair.h"
#include "net/proxy/proxy_config.h"
diff --git a/testing/android/native_test.gyp b/testing/android/native_test.gyp
index 90d080b..fb21f27 100644
--- a/testing/android/native_test.gyp
+++ b/testing/android/native_test.gyp
@@ -59,7 +59,7 @@
'-Wl,--exclude-libs=ALL',
],
},
- 'dependencies': [
+ 'dependencies': [
'../../base/base.gyp:base',
'../../base/base.gyp:test_support_base',
'../gtest.gyp:gtest',
@@ -69,26 +69,13 @@
{
'target_name': 'native_test_jni_headers',
'type': 'none',
- 'actions': [
- {
- 'action_name': 'generate_jni_headers',
- 'inputs': [
- '../../base/android/jni_generator/jni_generator.py',
- 'java/src/org/chromium/native_test/ChromeNativeTestActivity.java'
- ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/testing/android/jni/'
- 'chrome_native_test_activity_jni.h',
- ],
- 'action': [
- 'python',
- '../../base/android/jni_generator/jni_generator.py',
- '-o',
- '<@(_inputs)',
- '<@(_outputs)',
- ],
- }
+ 'sources': [
+ 'java/src/org/chromium/native_test/ChromeNativeTestActivity.java'
],
+ 'variables': {
+ 'jni_gen_dir': 'testing',
+ },
+ 'includes': [ '../../build/jni_generator.gypi' ],
# So generated jni headers can be found by targets that
# depend on this.
'direct_dependent_settings': {