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

Unified 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 side-by-side diff with in-line comments
Download patch
« build/config/android/rules.gni ('K') | « build/config/android/rules.gni ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/unpack_aar.py
diff --git a/build/config/android/unpack_aar.py b/build/config/android/unpack_aar.py
new file mode 100755
index 0000000000000000000000000000000000000000..ef4217e5adc5d0e1ca6d88ea6eddd9909e7e2120
--- /dev/null
+++ b/build/config/android/unpack_aar.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 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.
+
+"""Upacks the contents of an Android AAR."""
+
+import os
+import sys
+import zipfile
+
+
+def main():
+ if len(sys.argv) != 3:
+ print 'Usage: %s <aar_file> <output_dir>' % sys.argv[0]
+ sys.exit(1)
+
+ aar_file = sys.argv[1] # e.g. library.aar
+ output_dir = sys.argv[2] # e.g. path/to/output
+
+ #library_filename = os.path.basename(output_file)
+ #library_in_jar = os.path.join(library_filename)
+
+ with zipfile.ZipFile(aar_file, 'r') as archive:
+ 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
+
+
+if __name__ == '__main__':
+ sys.exit(main())
« 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