blob: 7b79535eb3a2bc3e8bf2ce868f7ce3beebdc0b5e [file] [log] [blame]
Chris Banes0df65ed2015-04-07 11:29:01 +01001#!/bin/bash
2
3if [ $# -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
10fi
11
12# Make sure we are in prebuilts/sdk/support-api
13if [ $(realpath $(dirname $0)) != $(realpath $(pwd)) ]; then
14 echo "The script must be run from $(dirname $0)."
15 exit 1
16fi
17
18# Remove any existing file (if they exist)
19if [ -e "$2.txt" ]; then
20 rm "$2.txt"
21fi
22
23# Now create the concatentated API file
24touch "$2.txt"
25
26# Find all of the various API files and append them to our
27# API file
28find $1 -name "$2.txt" -exec cat {} >> "$2.txt" \;