Index: build/android/java_cpp_template.gypi |
diff --git a/build/android/java_cpp_template.gypi b/build/android/java_cpp_template.gypi |
index c55b1002f5e5f68f4af57744744b860b7b74be08..2b254700acc6194a31df2d30c045a2a4d1c690b5 100644 |
--- a/build/android/java_cpp_template.gypi |
+++ b/build/android/java_cpp_template.gypi |
@@ -17,7 +17,7 @@ |
# 'package_name': 'org/chromium/net', |
# 'template_deps': ['net/base/certificate_mime_type_list.h'], |
# }, |
-# 'includes': [ '../build/android/java_constants.gypi' ], |
+# 'includes': [ '../build/android/java_cpp_template.gypi' ], |
# }, |
# |
# The 'sources' entry should only list template file. The template file |
@@ -31,7 +31,8 @@ |
{ |
# Location where all generated Java sources will be placed. |
'variables': { |
- 'output_dir': '<(SHARED_INTERMEDIATE_DIR)/templates/<(package_name)' |
+ 'include_path%': '<(DEPTH)', |
+ 'output_dir': '<(SHARED_INTERMEDIATE_DIR)/templates/<(package_name)', |
}, |
# Ensure that the output directory is used in the class path |
# when building targets that depend on this one. |
@@ -49,19 +50,22 @@ |
'rule_name': 'generate_java_constants', |
'extension': 'template', |
# Set template_deps as additional dependencies. |
- 'inputs': ['<@(template_deps)'], |
+ 'variables': { |
+ 'output_path': '<(output_dir)/<(RULE_INPUT_ROOT).java', |
+ }, |
+ 'inputs': [ |
+ '<(DEPTH)/build/android/pylib/build_utils.py', |
+ '<(DEPTH)/build/android/gcc_preprocess.py', |
+ '<@(template_deps)' |
+ ], |
'outputs': [ |
- '<(output_dir)/<(RULE_INPUT_ROOT).java' |
+ '<(output_path)', |
], |
'action': [ |
- 'gcc', # invoke host gcc. |
- '-E', # stop after preprocessing. |
- '-D', 'ANDROID', # Specify ANDROID define for pre-processor. |
- '-x', 'c-header', # treat sources as C header files |
- '-P', # disable line markers, i.e. '#line 309' |
- '-I', '<(DEPTH)', # Add project top-level to include path |
- '-o', '<@(_outputs)', # Specify output file |
- '<(RULE_INPUT_PATH)', # Specify input file |
+ 'python', '<(DEPTH)/build/android/gcc_preprocess.py', |
+ '--include-path=<(include_path)', |
+ '--output=<(output_path)', |
+ '--template=<(RULE_INPUT_PATH)', |
], |
'message': 'Generating Java from cpp template <(RULE_INPUT_PATH)', |
} |