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

Unified 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, 9 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/push_libraries.py
diff --git a/build/android/gyp/push_libraries.py b/build/android/gyp/push_libraries.py
new file mode 100755
index 0000000000000000000000000000000000000000..9c7366e5e7b23d6f34e78b475dc3f71d34e6fc42
--- /dev/null
+++ b/build/android/gyp/push_libraries.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+#
+# Copyright 2013 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.
+
+"""Pushes native libraries to a device.
+
+"""
+
+import json
+import optparse
+import os
+import sys
+
+BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..')
+sys.path.append(BUILD_ANDROID_DIR)
+
+from pylib import android_commands
+from pylib import build_utils
+
+
+def DoPush(options):
+ libraries = build_utils.ReadJson(options.libraries_json)
+
+ adb = android_commands.AndroidCommands()
+ adb.RunShellCommand('mkdir ' + options.device_dir)
+ for lib in libraries:
+ device_path = os.path.join(options.device_dir, lib)
+ host_path = os.path.join(options.libraries_dir, lib)
+ adb.PushIfNeeded(host_path, device_path)
+
+
+def main(argv):
+ parser = optparse.OptionParser()
+ parser.add_option('--libraries-dir',
+ help='Directory that contains stripped libraries.')
+ parser.add_option('--device-dir',
+ help='Device directory to push the libraries to.')
+ parser.add_option('--libraries-json',
+ help='Path to the json list of native libraries.')
+ parser.add_option('--stamp', help='Path to touch on success.')
+ options, _ = parser.parse_args()
+
+ required_options = ['libraries_dir', 'device_dir', 'libraries_json']
+ build_utils.CheckOptions(options, parser, required=required_options)
+
+ DoPush(options)
+
+ if options.stamp:
+ build_utils.Touch(options.stamp)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
« 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