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

Unified Diff: infra/bots/assets/android_sdk/create.py

Issue 2086003002: Add Android SDK asset (Closed) Base URL: https://skia.googlesource.com/skia.git@cipd
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
« no previous file with comments | « infra/bots/assets/android_sdk/common.py ('k') | infra/bots/assets/android_sdk/create_and_upload.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/assets/android_sdk/create.py
diff --git a/infra/bots/assets/android_sdk/create.py b/infra/bots/assets/android_sdk/create.py
new file mode 100644
index 0000000000000000000000000000000000000000..256a41d9f4a27bac429c746cadb880e250607c32
--- /dev/null
+++ b/infra/bots/assets/android_sdk/create.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Create the asset."""
+
+
+import argparse
+import os
+import shutil
+
+
+def create_asset(target_dir, android_sdk_root):
+ """Create the asset."""
+ if not android_sdk_root:
+ android_sdk_root = (os.environ.get('ANDROID_HOME') or
+ os.environ.get('ANDROID_SDK_ROOT'))
+ if not android_sdk_root:
+ raise Exception('No --android_sdk_root provided and no ANDROID_HOME or '
+ 'ANDROID_SDK_ROOT environment variables.')
+
+ dst = os.path.join(target_dir, 'android-sdk')
+ shutil.copytree(android_sdk_root, dst)
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--android_sdk_root')
+ parser.add_argument('--target_dir', '-t', required=True)
+ args = parser.parse_args()
+ create_asset(args.target_dir, args.android_sdk_root)
+
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « infra/bots/assets/android_sdk/common.py ('k') | infra/bots/assets/android_sdk/create_and_upload.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698