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

Side by Side Diff: build/config/android/unpack_aar.py

Issue 2069273002: [NOT FOR COMMIT] Added GN support for Android .AAR packaged libraries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 #
3 # Copyright 2016 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 """Upacks the contents of an Android AAR."""
8
9 import os
10 import sys
11 import zipfile
12
13
14 def main():
15 if len(sys.argv) != 3:
16 print 'Usage: %s <aar_file> <output_dir>' % sys.argv[0]
17 sys.exit(1)
18
19 aar_file = sys.argv[1] # e.g. library.aar
20 output_dir = sys.argv[2] # e.g. path/to/output
21
22 #library_filename = os.path.basename(output_file)
23 #library_in_jar = os.path.join(library_filename)
24
25 with zipfile.ZipFile(aar_file, 'r') as archive:
26 archive.extractall(output_dir)
agrieve 2016/06/16 02:00:04 Probably a good idea to assert that the .aar has n
agrieve 2016/06/16 02:00:04 nit: you don't need to extract res/, so probably s
agrieve 2016/06/16 02:00:04 Probably a good idea to shutil.rmtree() first so t
agrieve 2016/06/16 02:00:04 do you need an os.makedirs() first?
agrieve 2016/06/16 02:00:04 For extra extra bonus points, it might be useful t
27
28
29 if __name__ == '__main__':
30 sys.exit(main())
OLDNEW
« build/config/android/rules.gni ('K') | « build/config/android/rules.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698