Revert of Improve Android scripts: (https://codereview.chromium.org/254923003/)

Reason for revert:
errors

Original issue's description:
> 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
>
> Committed: http://code.google.com/p/skia/source/detail?r=14442

R=djsollen@google.com, scroggo@google.com
TBR=djsollen@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true

Author: halcanary@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14448 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/platform_tools/android/bin/android_gdb_exe b/platform_tools/android/bin/android_gdb_exe
index 64be9bb..920a16b 100755
--- a/platform_tools/android/bin/android_gdb_exe
+++ b/platform_tools/android/bin/android_gdb_exe
@@ -25,19 +25,15 @@
 
 # Set up gdb commands
 GDBSETUP=$GDB_TMP_DIR/gdb.setup
-{
-    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}
+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
 
-    # 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"
diff --git a/platform_tools/android/bin/android_gdbserver b/platform_tools/android/bin/android_gdbserver
index 837b97a..3508c50 100755
--- a/platform_tools/android/bin/android_gdbserver
+++ b/platform_tools/android/bin/android_gdbserver
@@ -19,7 +19,7 @@
 
 # We need the debug symbols from these files
 GDB_TMP_DIR=$(pwd)/android_gdb_tmp
-mkdir -p $GDB_TMP_DIR
+mkdir $GDB_TMP_DIR
 
 echo "Copying symbol files"
 SYSTEM_LIBRARY_PATH=/system/lib
diff --git a/platform_tools/android/bin/android_make b/platform_tools/android/bin/android_make
index 9601db9..572f4a1 100755
--- a/platform_tools/android/bin/android_make
+++ b/platform_tools/android/bin/android_make
@@ -11,8 +11,7 @@
 SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
 source $SCRIPT_DIR/android_setup.sh
 
-SKIA_SRC_DIR=$(cd "${SCRIPT_DIR}/../../.."; pwd)
-GYP_GENERATORS=ninja-android "${SKIA_SRC_DIR}/gyp_skia"
+GYP_GENERATORS=ninja-android ./gyp_skia
 ninja -C $SKIA_OUT/$BUILDTYPE ${APP_ARGS[@]}
 
 # Write the device id into the .android_config file.  This tells
diff --git a/platform_tools/android/bin/android_run_skia b/platform_tools/android/bin/android_run_skia
index 62e837c..ebcc041 100755
--- a/platform_tools/android/bin/android_run_skia
+++ b/platform_tools/android/bin/android_run_skia
@@ -13,13 +13,6 @@
   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.
@@ -29,7 +22,7 @@
 
 STATUS_FILENAME="/data/local/tmp/.skia_tmp_$(date +%s%N)"
 $ADB ${DEVICE_SERIAL} shell \
-    "cd /data/local/tmp; ./skia_launcher ${APP_ARGS[@]}; echo \$? > ${STATUS_FILENAME}"
+    "/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
diff --git a/platform_tools/android/bin/android_setup.sh b/platform_tools/android/bin/android_setup.sh
index d7d75f9..38e047c 100755
--- a/platform_tools/android/bin/android_setup.sh
+++ b/platform_tools/android/bin/android_setup.sh
@@ -146,11 +146,9 @@
   source $SCRIPT_DIR/utils/setup_toolchain.sh
 
   DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}"
-  exportVar GYP_DEFINES "$DEFINES $GYP_DEFINES"
 
-  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}}"
+  exportVar GYP_DEFINES "$DEFINES $GYP_DEFINES"
+  exportVar SKIA_OUT "${SKIA_OUT:-out/config/android-${TARGET_DEVICE}}"
 }
 
 # adb_pull_if_needed(android_src, host_dst)