Index: build/android/gyp/unpack_aar.py |
diff --git a/build/android/gyp/unpack_aar.py b/build/android/gyp/unpack_aar.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..dea72fbe0425b0ae99ad77336ec682917a9b154f |
--- /dev/null |
+++ b/build/android/gyp/unpack_aar.py |
@@ -0,0 +1,32 @@ |
+#!/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 shutil |
+import sys |
+#import zipfile |
+ |
+from util import build_utils |
+ |
+ |
+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 |
+ |
+ # Clear previously extracted versions of the AAR |
+ shutil.rmtree(output_dir, True) |
+ |
+ build_utils.ExtractAll(aar_file, path=output_dir) |
+ |
+ |
+if __name__ == '__main__': |
+ sys.exit(main()) |