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

Unified Diff: build/android/strip_library_for_apk.py

Issue 12330112: Move shared lib stripping to python (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + changes 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/pylib/build_utils.py ('k') | build/java_apk.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/strip_library_for_apk.py
diff --git a/build/android/strip_library_for_apk.py b/build/android/strip_library_for_apk.py
new file mode 100755
index 0000000000000000000000000000000000000000..8a0e3ea6ed1e32aeef676ad112a681264578c81f
--- /dev/null
+++ b/build/android/strip_library_for_apk.py
@@ -0,0 +1,44 @@
+#!/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.
+
+import optparse
+import os
+import subprocess
+import sys
+
+from pylib import build_utils
+
+
+def StripLibrary(android_strip, android_strip_args, library_path, output_path):
+ strip_cmd = ([android_strip] +
+ android_strip_args +
+ ['-o', output_path, library_path])
+ subprocess.check_call(strip_cmd)
+
+
+def main(argv):
+ parser = optparse.OptionParser()
+
+ parser.add_option('--android-strip',
+ help='Path to the toolchain\'s strip binary')
+ parser.add_option('--android-strip-arg', action='append',
+ help='Argument to be passed to strip')
+ parser.add_option('--stripped-libraries-dir',
+ help='Directory for stripped libraries')
+
+ options, paths = parser.parse_args()
+
+ build_utils.EnsureDirectoryExists(options.stripped_libraries_dir)
+
+ for library_path in paths:
+ stripped_library_path = os.path.join(options.stripped_libraries_dir,
+ os.path.basename(library_path))
+ StripLibrary(options.android_strip, options.android_strip_arg, library_path,
+ stripped_library_path)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
« no previous file with comments | « build/android/pylib/build_utils.py ('k') | build/java_apk.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698