OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Fail-fast if anything in the script fails. | 3 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
4 set -e | |
5 | 4 |
6 # Remove any existing .android_config file before running android_setup. If we | 5 # remove the existing .android_config file prior to running android_setup. If |
7 # did not remove this now then we would build for whatever device type was | 6 # we did not remove this here then we would build for whatever device type was |
8 # listed in the .android_config instead of the default device type. | 7 # listed in the .android_config instead of the default device type. |
9 rm -f .android_config | 8 if [ -f .android_config ] |
10 | 9 then |
11 source android_setup.sh | 10 rm .android_config |
12 | |
13 if [ $(basename $0) = "android_make" ]; then | |
14 GYP_GENERATORS=make-android make $APP_ARGS | |
15 else | |
16 GYP_GENERATORS=ninja ./gyp_skia | |
17 OUT=$SKIA_OUT/${BUILDTYPE-Debug} # Defaults to Debug if BUILDTYPE isn't se
t. | |
18 ninja -C $OUT $APP_ARGS | |
19 ln -sf lib $OUT/lib.target # android_run_skia looks in lib.target; n
inja writes to lib. | |
20 fi | 11 fi |
21 | 12 |
22 # Write the device id into the .android_config file. This tells | 13 # run the config to setup the environment |
23 # android_run_skia the last build we completed. | 14 source $SCRIPT_DIR/android_setup.sh |
| 15 |
| 16 # write the device id into the .android_config file |
24 echo $DEVICE_ID > .android_config | 17 echo $DEVICE_ID > .android_config |
25 | 18 |
| 19 for arg in ${APP_ARGS[@]} |
| 20 do |
| 21 if [[ "${arg}" == "--use-ccache" ]]; |
| 22 then |
| 23 if [[ -z "$ANDROID_MAKE_CCACHE" ]]; |
| 24 then |
| 25 ANDROID_MAKE_CCACHE=$(which ccache) |
| 26 fi |
| 27 else |
| 28 makeVars=("${makeVars[@]}" "${arg}") |
| 29 fi |
| 30 |
| 31 shift |
| 32 done |
| 33 |
| 34 if [[ -n "$ANDROID_MAKE_CCACHE" ]]; then |
| 35 $ANDROID_MAKE_CCACHE --version &> /dev/null |
| 36 if [[ "$?" != "0" ]]; then |
| 37 echo "Unable to find ccache!" |
| 38 exit 1 |
| 39 fi |
| 40 fi |
| 41 |
| 42 make ${makeVars[@]} |
| 43 if [ $? != 0 ] |
| 44 then |
| 45 exit 1; |
| 46 fi |
OLD | NEW |