skia2/infra/bots/assets/android_ndk_windows/create.py
Derek Sollenberger 19b2a56ad7 Upgrade android build (and infrastructure) to use ndk r15.
Bug: 6672
Change-Id: Ia6c6bae8a9adfd75172d7116487dfa63c3d69670
Reviewed-on: https://skia-review.googlesource.com/20904
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
2017-06-27 16:32:15 +00:00

45 lines
1.1 KiB
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-r15b"
NDK_URL = \
"https://dl.google.com/android/repository/%s-windows-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"])
# Some of these files have paths that exceed 260 characters when downloaded
# as a CIPD package. Luckily they're just tests. We don't need them.
shutil.rmtree(os.path.join(target_dir,
'sources', 'cxx-stl', 'llvm-libc++', 'test'))
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()