Index: build/java.gypi |
diff --git a/build/java.gypi b/build/java.gypi |
index 215b562ba5f8d1e94866a49f24708f4ebbc8f64b..0a1df8a873eeef036b49251e1da20469b803e278 100644 |
--- a/build/java.gypi |
+++ b/build/java.gypi |
@@ -69,6 +69,8 @@ |
'conditions': [ |
['has_java_resources == 1', { |
'variables': { |
+ 'res_dir': '<(java_in_dir)/res', |
+ 'crunched_res_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/res', |
'R_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/java_R', |
'R_file': '<(R_dir)/<(R_package_relpath)/R.java', |
'generated_src_dirs': ['<(R_dir)'], |
@@ -83,38 +85,30 @@ |
# Dependent APKs include this target's resources via |
# additional_res_dirs and additional_res_packages. |
- 'additional_res_dirs': ['<(java_in_dir)/res'], |
+ 'additional_res_dirs': ['<(crunched_res_dir)', '<(res_dir)'], |
'additional_res_packages': ['<(R_package)'], |
}, |
}, |
'actions': [ |
- # Generate R.java for the library. This R.java contains non-final |
- # constants and is used only while compiling the library jar (e.g. |
- # chromium_content.jar). When building an apk, a new R.java file with |
- # the correct resource -> ID mappings will be generated by merging the |
- # resources from all libraries and the main apk project. |
+ # Generate R.java and crunch image resources. |
{ |
- 'action_name': 'generate_r_java', |
- 'message': 'generating R.java for <(package_name)', |
+ 'action_name': 'process_resources', |
+ 'message': 'processing resources for <(package_name)', |
'inputs': [ |
- '<(android_sdk_tools)/aapt', |
- '<(android_sdk)/android.jar', |
- '<(DEPTH)/build/android/AndroidManifest.xml', |
- '<!@(find <(java_in_dir)/res -type f)', |
+ '<(DEPTH)/build/android/process_resources.py', |
+ '<!@(find <(res_dir) -type f)', |
], |
'outputs': [ |
'<(R_file)', |
], |
'action': [ |
- '<(android_sdk_tools)/aapt', |
- 'package', |
- '-m', |
- '--non-constant-id', |
- '--custom-package', '<(R_package)', |
- '-M', '<(DEPTH)/build/android/AndroidManifest.xml', |
- '-S', '<(java_in_dir)/res', |
- '-I', '<(android_sdk)/android.jar', |
- '-J', '<(R_dir)', |
+ '<(DEPTH)/build/android/process_resources.py', |
+ '--android-sdk', '<(android_sdk)', |
+ '--android-sdk-tools', '<(android_sdk_tools)', |
+ '--R-package', '<(R_package)', |
+ '--R-dir', '<(R_dir)', |
+ '--res-dir', '<(res_dir)', |
+ '--crunched-res-dir', '<(crunched_res_dir)', |
], |
}, |
], |