Index: build/java_apk.gypi |
diff --git a/build/java_apk.gypi b/build/java_apk.gypi |
index 3ec75267b07c29e5ce11b5deec2bb02e3d5a8790..43c33d8d98b4e552cc8d78c756dd957358a94650 100644 |
--- a/build/java_apk.gypi |
+++ b/build/java_apk.gypi |
@@ -126,12 +126,13 @@ |
'dex_path': '<(intermediate_dir)/classes.dex', |
'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
+ 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(android_app_abi)/AndroidManifest.xml', |
Yaron
2015/05/13 21:38:22
Shouldn't this include <(target_name) somewhere so
agrieve
2015/05/14 14:53:34
<(intermediate_dir) includes the target_name
|
'push_stamp': '<(intermediate_dir)/push.stamp', |
'link_stamp': '<(intermediate_dir)/link.stamp', |
'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', |
'shared_resources%': 0, |
- 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
+ 'final_abi_split_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name)_abi_<(android_app_abi).apk', |
'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', |
'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', |
'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_target_name)/<(CONFIGURATION_NAME)', |
@@ -144,14 +145,25 @@ |
'native_lib_target%': '', |
'native_lib_version_name%': '', |
'use_chromium_linker%' : 0, |
- 'load_library_from_zip_file%' : 0, |
'use_relocation_packer%' : 0, |
'enable_chromium_linker_tests%': 0, |
'is_test_apk%': 0, |
+ 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
+ 'unsigned_abi_split_apk_path': '<(intermediate_dir)/<(apk_name)_abi_<(android_app_abi)-unsigned.apk', |
+ 'use_abi_split%': 0, |
}, |
+ 'unsigned_apk_path': '<(unsigned_apk_path)', |
+ 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', |
+ 'use_abi_split%': '<(use_abi_split)', |
'conditions': [ |
['gyp_managed_install == 1 and native_lib_target != ""', { |
- 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-standalone-unsigned.apk', |
+ 'conditions': [ |
+ ['use_abi_split == 0', { |
+ 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-standalone-unsigned.apk', |
+ }, { |
+ 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)_abi_<(android_app_abi)-standalone-unsigned.apk', |
+ }], |
+ ], |
}, { |
'unsigned_standalone_apk_path': '<(unsigned_apk_path)', |
}], |
@@ -165,6 +177,13 @@ |
},{ |
'emma_instrument%': 0, |
}], |
+ # When using abi splits, the abi split is modified by |
+ # gyp_managed_install rather than the main .apk |
+ ['use_abi_split == 1', { |
+ 'managed_input_apk_path': '<(unsigned_abi_split_apk_path)', |
+ }, { |
+ 'managed_input_apk_path': '<(unsigned_apk_path)', |
+ }], |
], |
}, |
'native_lib_target%': '', |
@@ -176,10 +195,15 @@ |
'emma_instrument%': '<(emma_instrument)', |
'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', |
'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', |
+ 'unsigned_apk_path': '<(unsigned_apk_path)', |
+ 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', |
+ 'use_abi_split%': '<(use_abi_split)', |
+ 'managed_input_apk_path': '<(managed_input_apk_path)', |
'libchromium_android_linker': 'libchromium_android_linker.>(android_product_extension)', |
'extra_native_libs': [], |
'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_app_abi)/native_lib_placeholder.stamp', |
'native_lib_placeholders': [], |
+ 'main_apk_name': '<(apk_name)', |
}, |
# Pass the jar path to the apk's "fake" jar target. This would be better as |
# direct_dependent_settings, but a variable set by a direct_dependent_settings |
@@ -483,9 +507,9 @@ |
'<(strip_additional_stamp)', |
'<(pack_arm_relocations_stamp)', |
], |
- 'input_apk_path': '<(unsigned_apk_path)', |
'output_apk_path': '<(unsigned_standalone_apk_path)', |
'libraries_top_dir%': '<(libraries_top_dir)', |
+ 'input_apk_path': '<(managed_input_apk_path)', |
}, |
'includes': [ 'android/create_standalone_apk_action.gypi' ], |
}, |
@@ -504,19 +528,87 @@ |
}], |
], |
}], # native_lib_target != '' |
- ['gyp_managed_install == 0 or create_standalone_apk == 1', { |
+ ['gyp_managed_install == 0 or create_standalone_apk == 1 or use_abi_split == 1', { |
+ 'dependencies': [ |
+ '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar', |
+ ], |
+ }], |
+ ['use_abi_split == 1 or gyp_managed_install == 0 or create_standalone_apk == 1', { |
'actions': [ |
{ |
- 'action_name': 'finalize standalone apk', |
'variables': { |
- 'input_apk_path': '<(unsigned_standalone_apk_path)', |
'output_apk_path': '<(final_apk_path)', |
+ 'conditions': [ |
+ ['use_abi_split == 0', { |
+ 'input_apk_path': '<(unsigned_standalone_apk_path)', |
+ 'load_library_from_zip': '<(load_library_from_zip_file)', |
+ }, { |
+ 'input_apk_path': '<(unsigned_apk_path)', |
+ 'load_library_from_zip': 0, |
+ }] |
+ ], |
}, |
+ 'action_name': 'finalize_base', |
Yaron
2015/05/13 21:38:22
nit: move to top
agrieve
2015/05/14 14:53:34
Done.
|
'includes': [ 'android/finalize_apk_action.gypi'] |
}, |
], |
- 'dependencies': [ |
- '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar', |
+ }], |
+ ['use_abi_split == 1', { |
+ 'actions': [ |
+ { |
+ 'action_name': 'generate_split_manifest_<(_target_name)', |
+ 'inputs': [ |
+ '<(DEPTH)/build/android/gyp/util/build_utils.py', |
+ '<(DEPTH)/build/android/gyp/generate_split_manifest.py', |
+ '<(android_manifest_path)', |
+ ], |
+ 'outputs': [ |
+ '<(split_android_manifest_path)', |
+ ], |
+ 'action': [ |
+ 'python', '<(DEPTH)/build/android/gyp/generate_split_manifest.py', |
+ '--main-manifest', '<(android_manifest_path)', |
+ '--out-manifest', '<(split_android_manifest_path)', |
+ '--split', 'abi_<(android_app_abi)', |
+ ], |
+ }, |
+ { |
+ 'variables': { |
+ 'apk_name': '<(main_apk_name)_abi_<(android_app_abi)', |
+ 'asset_location': '', |
+ 'android_manifest_path': '<(split_android_manifest_path)', |
+ }, |
+ 'includes': [ 'android/package_resources_action.gypi' ], |
+ }, |
+ { |
+ 'variables': { |
+ 'apk_name': '<(main_apk_name)_abi_<(android_app_abi)', |
+ 'apk_path': '<(unsigned_abi_split_apk_path)', |
+ 'has_code': 0, |
+ 'native_libs_dir': '<(apk_package_native_libs_dir)', |
+ 'extra_inputs': ['<(native_lib_placeholder_stamp)'], |
+ }, |
+ 'includes': ['android/apkbuilder_action.gypi'], |
+ }, |
+ ], |
+ }], |
+ ['use_abi_split == 1 and (gyp_managed_install == 0 or create_standalone_apk == 1)', { |
+ 'actions': [ |
+ { |
+ 'action_name': 'finalize_split', |
+ 'variables': { |
+ 'load_library_from_zip': '<(load_library_from_zip_file)', |
+ 'output_apk_path': '<(final_abi_split_apk_path)', |
+ 'conditions': [ |
+ ['gyp_managed_install == 1', { |
+ 'input_apk_path': '<(unsigned_standalone_apk_path)', |
+ }, { |
+ 'input_apk_path': '<(unsigned_abi_split_apk_path)', |
+ }], |
+ ], |
+ }, |
+ 'includes': [ 'android/finalize_apk_action.gypi'] |
+ }, |
], |
}], |
['gyp_managed_install == 1', { |
@@ -524,7 +616,8 @@ |
{ |
'action_name': 'finalize incomplete apk', |
'variables': { |
- 'input_apk_path': '<(unsigned_apk_path)', |
+ 'load_library_from_zip': '<(load_library_from_zip_file)', |
+ 'input_apk_path': '<(managed_input_apk_path)', |
'output_apk_path': '<(incomplete_apk_path)', |
}, |
'includes': [ 'android/finalize_apk_action.gypi'] |
@@ -543,16 +636,27 @@ |
], |
'action': [ |
'python', '<(DEPTH)/build/android/gyp/apk_install.py', |
- '--apk-path=<(incomplete_apk_path)', |
'--build-device-configuration=<(build_device_config_path)', |
'--install-record=<(apk_install_record)', |
'--configuration-name=<(CONFIGURATION_NAME)', |
], |
+ 'conditions': [ |
+ ['use_abi_split == 1', { |
+ 'inputs': [ |
+ '<(final_apk_path)', |
+ ], |
+ 'action': [ |
+ '--apk-path=<(final_apk_path)', |
+ '--split-apk-path=<(incomplete_apk_path)', |
+ ], |
+ }, { |
+ 'action': [ |
+ '--apk-path=<(incomplete_apk_path)', |
+ ], |
+ }] |
+ ], |
}, |
], |
- 'dependencies': [ |
- '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar', |
- ], |
}], |
['is_test_apk == 1', { |
'dependencies': [ |
@@ -879,11 +983,15 @@ |
{ |
'variables': { |
'apk_path': '<(unsigned_apk_path)', |
- 'native_libs_dir': '<(apk_package_native_libs_dir)', |
'conditions': [ |
['native_lib_target != ""', { |
'extra_inputs': ['<(native_lib_placeholder_stamp)'], |
}], |
+ ['use_abi_split == 0', { |
+ 'native_libs_dir': '<(apk_package_native_libs_dir)', |
+ }, { |
+ 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', |
+ }], |
], |
}, |
'includes': ['android/apkbuilder_action.gypi'], |