| 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 |
| 11 those native libraries. | 11 those native libraries. |
| 12 """ | 12 """ |
| 13 | 13 |
| 14 import optparse | 14 import optparse |
| 15 import os | 15 import os |
| 16 import sys | 16 import sys |
| 17 | 17 |
| 18 from util import build_device | 18 from util import build_device |
| 19 from util import build_utils | 19 from util import build_utils |
| 20 | 20 |
| 21 BUILD_ANDROID_DIR = os.path.abspath( | 21 BUILD_ANDROID_DIR = os.path.abspath( |
| 22 os.path.join(os.path.dirname(__file__), '..')) | 22 os.path.join(os.path.dirname(__file__), '..')) |
| 23 sys.path.append(BUILD_ANDROID_DIR) | 23 sys.path.append(BUILD_ANDROID_DIR) |
| 24 | 24 |
| 25 import devil_chromium | 25 import devil_chromium |
| 26 from devil.android import apk_helper | 26 from devil.android import apk_helper |
| 27 from pylib import constants | 27 from pylib import constants |
| 28 | 28 |
| 29 def RunShellCommand(device, cmd): | 29 def RunShellCommand(device, cmd): |
| 30 output = device.RunShellCommand(cmd) | 30 output = device.RunShellCommand(cmd, check_return=True) |
| 31 | 31 |
| 32 if output: | 32 if output: |
| 33 raise Exception( | 33 raise Exception( |
| 34 'Unexpected output running command: ' + cmd + '\n' + | 34 'Unexpected output running command: ' + cmd + '\n' + |
| 35 '\n'.join(output)) | 35 '\n'.join(output)) |
| 36 | 36 |
| 37 | 37 |
| 38 def CreateSymlinkScript(options): | 38 def CreateSymlinkScript(options): |
| 39 libraries = build_utils.ParseGypList(options.libraries) | 39 libraries = build_utils.ParseGypList(options.libraries) |
| 40 | 40 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 CreateSymlinkScript(options) | 113 CreateSymlinkScript(options) |
| 114 TriggerSymlinkScript(options) | 114 TriggerSymlinkScript(options) |
| 115 | 115 |
| 116 if options.stamp: | 116 if options.stamp: |
| 117 build_utils.Touch(options.stamp) | 117 build_utils.Touch(options.stamp) |
| 118 | 118 |
| 119 | 119 |
| 120 if __name__ == '__main__': | 120 if __name__ == '__main__': |
| 121 sys.exit(main(sys.argv[1:])) | 121 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |