[Android] Create native lib placeholder files

Add an action to create placeholder files in native lib directory.

BUG=395038

Review URL: https://codereview.chromium.org/580903008

Cr-Original-Commit-Position: refs/heads/master@{#295409}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f1f754bf3385a6f90c45ea4131844e671147f44f
This commit is contained in:
feng 2014-09-17 20:57:26 -07:00 коммит произвёл Commit bot
Родитель f9f01ce3b0
Коммит 6ee2374ae4
2 изменённых файлов: 67 добавлений и 18 удалений

Просмотреть файл

@ -0,0 +1,35 @@
#!/usr/bin/env python
# Copyright 2014 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.
"""Create placeholder files.
"""
import optparse
import os
import sys
from util import build_utils
def main():
parser = optparse.OptionParser()
parser.add_option(
'--dest-lib-dir',
help='Destination directory to have placeholder files.')
parser.add_option(
'--stamp',
help='Path to touch on success')
options, args = parser.parse_args()
for name in args:
target_path = os.path.join(options.dest_lib_dir, name)
build_utils.Touch(target_path)
if options.stamp:
build_utils.Touch(options.stamp)
if __name__ == '__main__':
sys.exit(main())

Просмотреть файл

@ -173,6 +173,8 @@
'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)',
'libchromium_android_linker': 'libchromium_android_linker.>(android_product_extension)', 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_extension)',
'extra_native_libs': [], 'extra_native_libs': [],
'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_app_abi)/native_lib_placeholder.stamp',
'native_lib_placeholders': [],
}, },
# Pass the jar path to the apk's "fake" jar target. This would be better as # 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 # direct_dependent_settings, but a variable set by a direct_dependent_settings
@ -384,15 +386,35 @@
}, },
'includes': ['../build/android/strip_native_libraries.gypi'], 'includes': ['../build/android/strip_native_libraries.gypi'],
}, },
{
'action_name': 'Create native lib placeholder files for previous releases',
'variables': {
'placeholders': ['<@(native_lib_placeholders)'],
'conditions': [
['gyp_managed_install == 1', {
# This "library" just needs to be put in the .apk. It is not loaded
# at runtime.
'placeholders': ['libfix.crbug.384638.so'],
}]
],
},
'inputs': [
'<(DEPTH)/build/android/gyp/create_placeholder_files.py',
],
'outputs': [
'<(native_lib_placeholder_stamp)',
],
'action': [
'python', '<(DEPTH)/build/android/gyp/create_placeholder_files.py',
'--dest-lib-dir=<(apk_package_native_libs_dir)/<(android_app_abi)/',
'--stamp=<(native_lib_placeholder_stamp)',
'<@(placeholders)',
],
},
], ],
'conditions': [ 'conditions': [
['gyp_managed_install == 1', { ['gyp_managed_install == 1', {
'variables': { 'variables': {
# This "library" just needs to be put in the .apk. It is not loaded
# at runtime.
'placeholder_native_library_path':
'<(apk_package_native_libs_dir)/<(android_app_abi)/libfix.crbug.384638.so',
'package_input_paths': [ '<(placeholder_native_library_path)' ],
'libraries_top_dir': '<(intermediate_dir)/lib.stripped', 'libraries_top_dir': '<(intermediate_dir)/lib.stripped',
'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)', 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)',
'device_library_dir': '<(device_intermediate_dir)/lib.stripped', 'device_library_dir': '<(device_intermediate_dir)/lib.stripped',
@ -405,19 +427,6 @@
{ {
'includes': ['../build/android/push_libraries.gypi'], 'includes': ['../build/android/push_libraries.gypi'],
}, },
{
'action_name': 'create placeholder lib',
'inputs': [
'<(DEPTH)/build/android/gyp/touch.py',
],
'outputs': [
'<(placeholder_native_library_path)',
],
'action' : [
'python', '<(DEPTH)/build/android/gyp/touch.py',
'<@(_outputs)',
],
},
{ {
'action_name': 'create device library symlinks', 'action_name': 'create device library symlinks',
'message': 'Creating links on device for <(_target_name)', 'message': 'Creating links on device for <(_target_name)',
@ -867,6 +876,11 @@
'outputs': [ 'outputs': [
'<(unsigned_apk_path)', '<(unsigned_apk_path)',
], ],
'conditions': [
['native_lib_target != ""', {
'inputs': ['<(native_lib_placeholder_stamp)'],
}],
],
'action': [ 'action': [
'python', '<(DEPTH)/build/android/gyp/ant.py', 'python', '<(DEPTH)/build/android/gyp/ant.py',
'--', '--',