Chris Banes | 0df65ed | 2015-04-07 11:29:01 +0100 | [diff] [blame] | 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 | find $1 -name "$2.txt" -exec cat {} >> "$2.txt" \; |