Improve Android scripts:
* android_gdbserver: - Don't complain if $GDB_TMP_DIR already exists - Since $GDB_TMP_DIR/gdb.setup might already exist, overwrite the file. * android_run_skia: - Move resource files onto the device. - Change to tmp directory before executing program. * android_make, android_setup: - stop assuming PWD is skia source directory. NOTRY=true R=djsollen@google.com, scroggo@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/254923003 git-svn-id: http://skia.googlecode.com/svn/trunk@14442 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
19a21894ea
commit
21a6d13a2b
@ -25,15 +25,19 @@ PORT=5039
|
||||
|
||||
# Set up gdb commands
|
||||
GDBSETUP=$GDB_TMP_DIR/gdb.setup
|
||||
echo "file $GDB_TMP_DIR/skia_launcher" >> $GDBSETUP
|
||||
echo "target remote :$PORT" >> $GDBSETUP
|
||||
echo "set solib-absolute-prefix $GDB_TMP_DIR" >> $GDBSETUP
|
||||
echo "set solib-search-path $GDB_TMP_DIR" >> $GDBSETUP
|
||||
{
|
||||
echo "file ${GDB_TMP_DIR}/skia_launcher"
|
||||
echo "target remote :${PORT}"
|
||||
echo "set solib-absolute-prefix ${GDB_TMP_DIR}"
|
||||
echo "set solib-search-path ${GDB_TMP_DIR}
|
||||
|
||||
# The apps shared library symbols are not loaded by default so we
|
||||
# load them here."
|
||||
echo "break launch_app"
|
||||
echo "continue"
|
||||
echo "sharedLibrary ${APP_NAME}"
|
||||
} > $GDBSETUP
|
||||
|
||||
# The apps shared library symbols are not loaded by default so we load them here
|
||||
echo "break launch_app" >> $GDBSETUP
|
||||
echo "continue" >> $GDBSETUP
|
||||
echo "sharedLibrary $APP_NAME" >> $GDBSETUP
|
||||
|
||||
# Launch gdb client
|
||||
echo "Entering gdb client shell"
|
||||
|
@ -19,7 +19,7 @@ fi
|
||||
|
||||
# We need the debug symbols from these files
|
||||
GDB_TMP_DIR=$(pwd)/android_gdb_tmp
|
||||
mkdir $GDB_TMP_DIR
|
||||
mkdir -p $GDB_TMP_DIR
|
||||
|
||||
echo "Copying symbol files"
|
||||
SYSTEM_LIBRARY_PATH=/system/lib
|
||||
|
@ -11,7 +11,8 @@ rm -f .android_config
|
||||
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
source $SCRIPT_DIR/android_setup.sh
|
||||
|
||||
GYP_GENERATORS=ninja-android ./gyp_skia
|
||||
SKIA_SRC_DIR=$(cd "${SCRIPT_DIR}/../../.."; pwd)
|
||||
GYP_GENERATORS=ninja-android "${SKIA_SRC_DIR}/gyp_skia"
|
||||
ninja -C $SKIA_OUT/$BUILDTYPE ${APP_ARGS[@]}
|
||||
|
||||
# Write the device id into the .android_config file. This tells
|
||||
|
@ -13,6 +13,13 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
(
|
||||
SKIA_SRC_DIR=$(cd ${SCRIPT_DIR}/../../..; pwd)
|
||||
cd "$SKIA_SRC_DIR"
|
||||
for resource in $(find resources -type f); do
|
||||
adb_push_if_needed "$resource" "/data/local/tmp/${resource}"
|
||||
done
|
||||
)
|
||||
adb_push_if_needed "${SKIA_OUT}/$BUILDTYPE/skia_launcher" /data/local/tmp
|
||||
if [ -f "${SKIA_OUT}/$BUILDTYPE/lib/libskia_android.so" ]; then
|
||||
# Does not exist for builds with static skia.
|
||||
@ -22,7 +29,7 @@ adb_push_if_needed "${SKIA_OUT}/$BUILDTYPE/lib/lib${APP_ARGS[0]}.so" /data/local
|
||||
|
||||
STATUS_FILENAME="/data/local/tmp/.skia_tmp_$(date +%s%N)"
|
||||
$ADB ${DEVICE_SERIAL} shell \
|
||||
"/data/local/tmp/skia_launcher ${APP_ARGS[@]}; echo \$? > ${STATUS_FILENAME}"
|
||||
"cd /data/local/tmp; ./skia_launcher ${APP_ARGS[@]}; echo \$? > ${STATUS_FILENAME}"
|
||||
if [ -z "$($ADB $DEVICE_SERIAL shell 'if [ -f $STATUS_FILENAME ]; then echo exists; fi')" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
@ -146,9 +146,11 @@ setup_device() {
|
||||
source $SCRIPT_DIR/utils/setup_toolchain.sh
|
||||
|
||||
DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}"
|
||||
|
||||
exportVar GYP_DEFINES "$DEFINES $GYP_DEFINES"
|
||||
exportVar SKIA_OUT "${SKIA_OUT:-out/config/android-${TARGET_DEVICE}}"
|
||||
|
||||
SKIA_SRC_DIR=$(cd "${SCRIPT_DIR}/../../.."; pwd)
|
||||
DEFAULT_SKIA_OUT="${SKIA_SRC_DIR}/out/config/android-${TARGET_DEVICE}"
|
||||
exportVar SKIA_OUT "${SKIA_OUT:-${DEFAULT_SKIA_OUT}}"
|
||||
}
|
||||
|
||||
# adb_pull_if_needed(android_src, host_dst)
|
||||
|
Loading…
Reference in New Issue
Block a user