skia2/infra/bots/assets/android_sdk_linux/create.py
Eric Boren 690a215606 [infra] Remove most asset scripts, update create_and_upload
Change-Id: I4f0d1358eeb2046ebf7b7830dd9e7c39add33393
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414997
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2021-06-03 13:14:17 +00:00

46 lines
927 B
Python
Executable File

#!/usr/bin/env python
#
# Copyright 2017 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
import sys
ENV_VAR = 'ANDROID_SDK_LINUX_SDK_ROOT'
def getenv(key):
val = os.environ.get(key)
if not val:
print(('Environment variable %s not set; you should run this via '
'create_and_upload.py.' % key), file=sys.stderr)
sys.exit(1)
return val
def create_asset(target_dir, android_sdk_root):
"""Create the asset."""
dst = os.path.join(target_dir, 'android-sdk')
shutil.copytree(android_sdk_root, dst)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--target_dir', '-t', required=True)
args = parser.parse_args()
android_sdk_root = getenv(ENV_VAR)
create_asset(args.target_dir, android_sdk_root)
if __name__ == '__main__':
main()