Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: build/android/gyp/push_libraries.py

Issue 13334003: Push native libraries separately when gyp manages install (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@apkinstall
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/gyp/create_device_library_links.py ('k') | build/android/process_resources.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 #
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
5 # found in the LICENSE file.
6
7 """Pushes native libraries to a device.
8
9 """
10
11 import json
12 import optparse
13 import os
14 import sys
15
16 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..')
17 sys.path.append(BUILD_ANDROID_DIR)
18
19 from pylib import android_commands
20 from pylib import build_utils
21
22
23 def DoPush(options):
24 libraries = build_utils.ReadJson(options.libraries_json)
25
26 adb = android_commands.AndroidCommands()
27 adb.RunShellCommand('mkdir ' + options.device_dir)
28 for lib in libraries:
29 device_path = os.path.join(options.device_dir, lib)
30 host_path = os.path.join(options.libraries_dir, lib)
31 adb.PushIfNeeded(host_path, device_path)
32
33
34 def main(argv):
35 parser = optparse.OptionParser()
36 parser.add_option('--libraries-dir',
37 help='Directory that contains stripped libraries.')
38 parser.add_option('--device-dir',
39 help='Device directory to push the libraries to.')
40 parser.add_option('--libraries-json',
41 help='Path to the json list of native libraries.')
42 parser.add_option('--stamp', help='Path to touch on success.')
43 options, _ = parser.parse_args()
44
45 required_options = ['libraries_dir', 'device_dir', 'libraries_json']
46 build_utils.CheckOptions(options, parser, required=required_options)
47
48 DoPush(options)
49
50 if options.stamp:
51 build_utils.Touch(options.stamp)
52
53
54 if __name__ == '__main__':
55 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « build/android/gyp/create_device_library_links.py ('k') | build/android/process_resources.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698