OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Creates symlinks to native libraries for an APK. | 7 """Creates symlinks to native libraries for an APK. |
8 | 8 |
9 The native libraries should have previously been pushed to the device (in | 9 The native libraries should have previously been pushed to the device (in |
10 options.target_dir). This script then creates links in an apk's lib/ folder to | 10 options.target_dir). This script then creates links in an apk's lib/ folder to |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 if not device: | 57 if not device: |
58 return | 58 return |
59 | 59 |
60 apk_package = apk_helper.GetPackageName(options.apk) | 60 apk_package = apk_helper.GetPackageName(options.apk) |
61 apk_libraries_dir = '/data/data/%s/lib' % apk_package | 61 apk_libraries_dir = '/data/data/%s/lib' % apk_package |
62 | 62 |
63 device_dir = os.path.dirname(options.script_device_path) | 63 device_dir = os.path.dirname(options.script_device_path) |
64 mkdir_cmd = ('if [ ! -e %(dir)s ]; then mkdir -p %(dir)s; fi ' % | 64 mkdir_cmd = ('if [ ! -e %(dir)s ]; then mkdir -p %(dir)s; fi ' % |
65 { 'dir': device_dir }) | 65 { 'dir': device_dir }) |
66 RunShellCommand(device, mkdir_cmd) | 66 RunShellCommand(device, mkdir_cmd) |
67 device.PushChangedFiles([(options.script_host_path, | 67 device.PushChangedFiles(options.script_host_path, options.script_device_path) |
68 options.script_device_path)]) | |
69 | 68 |
70 trigger_cmd = ( | 69 trigger_cmd = ( |
71 'APK_LIBRARIES_DIR=%(apk_libraries_dir)s; ' | 70 'APK_LIBRARIES_DIR=%(apk_libraries_dir)s; ' |
72 'STRIPPED_LIBRARIES_DIR=%(target_dir)s; ' | 71 'STRIPPED_LIBRARIES_DIR=%(target_dir)s; ' |
73 '. %(script_device_path)s' | 72 '. %(script_device_path)s' |
74 ) % { | 73 ) % { |
75 'apk_libraries_dir': apk_libraries_dir, | 74 'apk_libraries_dir': apk_libraries_dir, |
76 'target_dir': options.target_dir, | 75 'target_dir': options.target_dir, |
77 'script_device_path': options.script_device_path | 76 'script_device_path': options.script_device_path |
78 } | 77 } |
(...skipping 26 matching lines...) Expand all Loading... |
105 | 104 |
106 CreateSymlinkScript(options) | 105 CreateSymlinkScript(options) |
107 TriggerSymlinkScript(options) | 106 TriggerSymlinkScript(options) |
108 | 107 |
109 if options.stamp: | 108 if options.stamp: |
110 build_utils.Touch(options.stamp) | 109 build_utils.Touch(options.stamp) |
111 | 110 |
112 | 111 |
113 if __name__ == '__main__': | 112 if __name__ == '__main__': |
114 sys.exit(main(sys.argv[1:])) | 113 sys.exit(main(sys.argv[1:])) |
OLD | NEW |