1 #!/bin/bash 2 3 if [ $# -ne 2 ]; then 4 echo "Usage: $0 <path_to_frameworks_support> <support_version>" 5 echo " <path_to_frameworks_support>: Path to frameworks/support" 6 echo " <support_version>: Support version. This must match the API filenames exactly" 7 echo 8 echo " Example: import_api.sh ../../../frameworks/support 22.0.0" 9 exit 1 10 fi 11 12 # Make sure we are in prebuilts/sdk/support-api 13 if [ $(realpath $(dirname $0)) != $(realpath $(pwd)) ]; then 14 echo "The script must be run from $(dirname $0)." 15 exit 1 16 fi 17 18 # Remove any existing file (if they exist) 19 if [ -e "$2.txt" ]; then 20 rm "$2.txt" 21 fi 22 23 # Now create the concatentated API file 24 touch "$2.txt" 25 26 # Find all of the various API files and append them to our 27 # API file 28 29 for API_FILE in `find $1 -name "current.txt" -print | sort`; do 30 cat $API_FILE >> "$2.txt" 31 done 32