1#!/bin/bash 2 3# This script requires depot_tools to be on path. 4 5print_usage () { 6 echo "Usage: create_ndk_cipd_package.sh <PATH_TO_NDK_ASSETS> <PLATFORM_NAME> <VERSION_TAG>" 7 echo " where:" 8 echo " - PATH_TO_NDK_ASSETS is the path to the unzipped NDK folder" 9 echo " - PLATFORM_NAME is one of linux-amd64, mac-amd64, or windows-amd64" 10 echo " - VERSION_TAG is the version of the NDK, e.g. r19b" 11} 12 13if [[ $3 == "" ]]; then 14 print_usage 15 exit 1 16fi 17 18if [[ ! -d "$1" ]]; then 19 echo "Directory $1 not found." 20 print_usage 21 exit 1 22fi 23 24if [[ $2 != "linux-amd64" && $2 != "mac-amd64" && $2 != "windows-amd64" ]]; then 25 echo "Unsupported platform $2." 26 echo "Valid options are linux-amd64, mac-amd64, windows-amd64." 27 print_usage 28 exit 1 29fi 30 31cipd create -in $1 -name flutter/android/ndk/$2 -install-mode copy -tag version:$3 32