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)) |