SkQP: optionally build make_universal_apk with debug on.

  * Respects SKQP_DEBUG=true.
  * Also, be more selective about cleaning. (So I can test on master.)
  * Also, stop using `gradlew --daemon`, which was getting confused
    when switching back and forth build types.

No-Try:true
Change-Id: Id93f77ab7831a82cad9a3a64dbb8a93af4757d57
Reviewed-on: https://skia-review.googlesource.com/108222
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Stephan Altmueller <stephana@google.com>
diff --git a/tools/skqp/make_universal_apk b/tools/skqp/make_universal_apk
index 29c67bd..56b7253 100755
--- a/tools/skqp/make_universal_apk
+++ b/tools/skqp/make_universal_apk
@@ -40,9 +40,14 @@
 
 cd "$(dirname "$0")/../.."
 
-
-git clean -fxd platform_tools/android/apps/skqp
-
+(
+    cd platform_tools/android/apps
+    git clean -fxd skqp/build \
+                   skqp/src/main/assets/gmkb \
+                   skqp/src/main/assets/resources \
+                   skqp/src/main/libs \
+                   .gradle build viewer/build
+)
 python tools/skqp/download_model
 if [ -z "$SKQP_EXTRA_MODELS" ]; then
     python tools/skqp/remove_unneeded_assets
@@ -61,8 +66,13 @@
 fi
 
 for ARCH in $*; do
-    BUILD=out/skqp-$ARCH
-    python tools/skqp/generate_gn_args $BUILD "$ANDROID_NDK" --arch "$ARCH"
+    if [ "$SKQP_DEBUG" ]; then
+        BUILD=out/skqp-${ARCH}-debug
+        python tools/skqp/generate_gn_args $BUILD "$ANDROID_NDK" --arch "$ARCH" --debug
+    else
+        BUILD=out/skqp-$ARCH
+        python tools/skqp/generate_gn_args $BUILD "$ANDROID_NDK" --arch "$ARCH"
+    fi
     bin/gn gen $BUILD
     ninja -C $BUILD $LIB
     case $ARCH in
@@ -79,7 +89,7 @@
 
 (
     cd platform_tools/android
-    apps/gradlew --daemon -p apps/$APP -P suppressNativeBuild :$APP:assembleUniversalDebug
+    apps/gradlew -p apps/$APP -P suppressNativeBuild :$APP:assembleUniversalDebug
 )
 
 mkdir -p out/skqp