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

Side by Side 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: Created 7 years, 10 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/prepare_library_for_apk ('k') | build/java_apk.gypi » ('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 import optparse
8 import os
9 import subprocess
10 import sys
11
12
13 def EnsureDirectoryExists(dir_path):
14 try:
15 os.makedirs(dir_path)
16 except OSError:
17 pass
18
19
20 def StripLibrary(android_strip, android_strip_args, library_path, output_path):
21 strip_cmd = ([android_strip] +
22 android_strip_args +
23 [library_path, '-o', output_path])
24 subprocess.check_call(strip_cmd)
25
26
27 def main(argv):
28 parser = optparse.OptionParser()
29
30 parser.add_option('--android-strip', action='store')
31 parser.add_option('--android-strip-arg', action='append')
32 parser.add_option('--libraries-dir', action='store')
Yaron 2013/02/25 21:22:55 Could you os.path.dirname to get the library path,
cjhopman 2013/03/07 01:57:26 Done.
33 parser.add_option('--stripped-libraries-dir', action='store')
34 parser.add_option('--library-file-name', action='store')
35
36 options, args = parser.parse_args()
Yaron 2013/02/25 21:22:55 s/args/_/
cjhopman 2013/03/07 01:57:26 Done.
37
38 EnsureDirectoryExists(options.stripped_libraries_dir)
39
40 library_path = os.path.join(options.libraries_dir, options.library_file_name)
41 stripped_library_path = os.path.join(options.stripped_libraries_dir,
42 options.library_file_name)
43
44 StripLibrary(options.android_strip, options.android_strip_arg, library_path,
45 stripped_library_path)
46
47
48 if __name__ == '__main__':
49 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « build/android/prepare_library_for_apk ('k') | build/java_apk.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698