make vanilla android_ninja work, and add quiet options

BUG=
R=djsollen@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11540 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/platform_tools/android/bin/android_setup.sh b/platform_tools/android/bin/android_setup.sh
index 0629c6a..e58faa8 100755
--- a/platform_tools/android/bin/android_setup.sh
+++ b/platform_tools/android/bin/android_setup.sh
@@ -26,10 +26,16 @@
   shift
 done
 
+function verbose {
+    if [[ -n $VERBOSE ]]; then
+        echo $@
+    fi
+}
+
 function exportVar {
   NAME=$1
   VALUE=$2
-  echo export $NAME=\"$VALUE\"
+  verbose export $NAME=\"$VALUE\"
   export $NAME="$VALUE"
 }
 
@@ -81,13 +87,13 @@
 
   TOOLCHAIN_DIR=${SCRIPT_DIR}/../toolchains
   if [ $(uname) == "Linux" ]; then
-    echo "Using Linux toolchain."
+    verbose "Using Linux toolchain."
     TOOLCHAIN_TYPE=ndk-r$NDK_REV-$ANDROID_ARCH-linux_v$API_LEVEL
   elif [ $(uname) == "Darwin" ]; then
-    echo "Using Mac toolchain."
+    verbose "Using Mac toolchain."
     TOOLCHAIN_TYPE=ndk-r$NDK_REV-$ANDROID_ARCH-mac_v$API_LEVEL
   else
-    echo "Could not automatically determine toolchain!  Defaulting to Linux."
+    verbose "Could not automatically determine toolchain!  Defaulting to Linux."
     TOOLCHAIN_TYPE=ndk-r$NDK_REV-$ANDROID_ARCH-linux_v$API_LEVEL
   fi
   exportVar ANDROID_TOOLCHAIN ${TOOLCHAIN_DIR}/${TOOLCHAIN_TYPE}/bin
@@ -121,7 +127,7 @@
     return 1;
   fi
 
-  echo "The build is targeting NDK API level $API_LEVEL for use on Android 4.0 (NDK Revision $NDK_REV) and above"
+  verbose "The build is targeting NDK API level $API_LEVEL for use on Android 4.0 (NDK Revision $NDK_REV) and above"
 
   LS="/bin/ls"  # Use directly to avoid any 'ls' alias that might be defined.
   GCC=$($LS $ANDROID_TOOLCHAIN/*-gcc | head -n1)
@@ -163,10 +169,10 @@
   if [ -z "$TARGET_DEVICE" ]; then
     if [ -f .android_config ]; then
       TARGET_DEVICE=$(cat .android_config)
-      echo "INFO: no target device was specified so using the device (${TARGET_DEVICE}) from the most recent build"
+      verbose "INFO: no target device was specified so using the device (${TARGET_DEVICE}) from the most recent build"
     else
       TARGET_DEVICE="arm_v7_thumb"
-      echo "INFO: no target device type was specified so using the default '${TARGET_DEVICE}'"
+      verbose "INFO: no target device type was specified so using the default '${TARGET_DEVICE}'"
     fi
   fi
 
@@ -227,7 +233,7 @@
       ;;
   esac
 
-  echo "The build is targeting the device: $TARGET_DEVICE"
+  verbose "The build is targeting the device: $TARGET_DEVICE"
   export DEVICE_ID="$TARGET_DEVICE"
 
   # Set up the toolchain.
diff --git a/platform_tools/android/gyp/skia_android.gypi b/platform_tools/android/gyp/skia_android.gypi
index 4e6658d..64c2605 100644
--- a/platform_tools/android/gyp/skia_android.gypi
+++ b/platform_tools/android/gyp/skia_android.gypi
@@ -31,8 +31,8 @@
         {
           'destination': '<(PRODUCT_DIR)/android/libs/<(android_arch)',
           'files': [
-            '<(PRODUCT_DIR)/lib.target/libSampleApp.so',
-            '<(PRODUCT_DIR)/lib.target/libskia_android.so',
+            '<(PRODUCT_DIR)/<(SHARED_LIB_DIR)/libSampleApp.so',
+            '<(PRODUCT_DIR)/<(SHARED_LIB_DIR)/libskia_android.so',
           ],
         },
       ],
@@ -71,6 +71,7 @@
           ],
           'action': [
             'ant',
+            '-quiet',
             '-f',
             '<(android_base)/app/build.xml',
             '-Dout.dir=<(PRODUCT_DIR)/android/bin',