Add android_ninja, like android_make for ninja.

android_ninja {tests,bench,gm,bench_pictures,render_pictures} all build and run
fine.  They build so fast I thought maybe they were broken.

Note that android_ninja with no argument is failing:
    ninja: Entering directory `out/config/android-arm_v7_thumb/Debug'
    ninja: error: 'lib.target/libSampleApp.so', needed by 'android/libs/armeabi-v7a/libSampleApp.so', missing and no known rule to make it
Will look into this.

BUG=
R=djsollen@google.com

Committed: https://code.google.com/p/skia/source/detail?r=11525

Review URL: https://codereview.chromium.org/24833002

git-svn-id: http://skia.googlecode.com/svn/trunk@11527 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
mtklein@google.com 2013-09-30 17:32:09 +00:00
parent 741ea9e009
commit 48f9e1f2c1
3 changed files with 19 additions and 40 deletions

View File

@ -1,46 +1,26 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Fail-fast if anything in the script fails.
set -e
# remove the existing .android_config file prior to running android_setup. If
# we did not remove this here then we would build for whatever device type was
# Remove any existing .android_config file before running android_setup. If we
# did not remove this now then we would build for whatever device type was
# listed in the .android_config instead of the default device type.
if [ -f .android_config ]
then
rm .android_config
fi
rm -f .android_config
# run the config to setup the environment
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/android_setup.sh
# write the device id into the .android_config file
if [ $(basename $0) = "android_make" ]; then
GYP_GENERATORS=make-android make $APP_ARGS
else
GYP_GENERATORS=ninja ./gyp_skia
OUT=$SKIA_OUT/${BUILDTYPE-Debug} # Defaults to Debug if BUILDTYPE isn't set.
ninja -C $OUT $APP_ARGS
ln -sf lib $OUT/lib.target # android_run_skia looks in lib.target; ninja writes to lib.
fi
# Write the device id into the .android_config file. This tells
# android_run_skia the last build we completed.
echo $DEVICE_ID > .android_config
for arg in ${APP_ARGS[@]}
do
if [[ "${arg}" == "--use-ccache" ]];
then
if [[ -z "$ANDROID_MAKE_CCACHE" ]];
then
ANDROID_MAKE_CCACHE=$(which ccache)
fi
else
makeVars=("${makeVars[@]}" "${arg}")
fi
shift
done
if [[ -n "$ANDROID_MAKE_CCACHE" ]]; then
$ANDROID_MAKE_CCACHE --version &> /dev/null
if [[ "$?" != "0" ]]; then
echo "Unable to find ccache!"
exit 1
fi
fi
make ${makeVars[@]}
if [ $? != 0 ]
then
exit 1;
fi

View File

@ -0,0 +1 @@
android_make

View File

@ -165,7 +165,7 @@ setup_device() {
TARGET_DEVICE=$(cat .android_config)
echo "INFO: no target device was specified so using the device (${TARGET_DEVICE}) from the most recent build"
else
TARGET_DEVICE="arm_v7_thumb"
TARGET_DEVICE="arm_v7_thumb"
echo "INFO: no target device type was specified so using the default '${TARGET_DEVICE}'"
fi
fi
@ -237,8 +237,6 @@ setup_device() {
fi
DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}"
# Use the "android" flavor of the Makefile generator for both Linux and OS X.
exportVar GYP_GENERATORS "make-android"
exportVar GYP_DEFINES "$DEFINES"
exportVar SKIA_OUT "out/config/android-${TARGET_DEVICE}"
}