skia2/infra/bots/assets/android_ndk_linux/create.py
mtklein 5580c69135 add an asset for the Linux Android NDK.
I have run create_and_upload.py... cipd is uploading now.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2275093003

Review-Url: https://codereview.chromium.org/2275093003
2016-08-26 10:52:19 -07:00

40 lines
905 B
Python
Executable File

#!/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 glob
import os.path
import shutil
import subprocess
NDK_VER = "android-ndk-r12b"
NDK_URL = \
"https://dl.google.com/android/repository/%s-linux-x86_64.zip" % NDK_VER
def create_asset(target_dir):
"""Create the asset."""
subprocess.check_call(["curl", NDK_URL, "-o", "ndk.zip"])
subprocess.check_call(["unzip", "ndk.zip", "-d", target_dir])
for f in glob.glob(os.path.join(target_dir, NDK_VER, "*")):
shutil.move(f, target_dir)
subprocess.check_call(["rm", "ndk.zip"])
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--target_dir', '-t', required=True)
args = parser.parse_args()
create_asset(args.target_dir)
if __name__ == '__main__':
main()