Output android-cts-verifier.zip in the CTS Dist

Bug 5149412

Made it output a zip so that other tools that could be required by
the CTS Verifier could be included.

Change-Id: Icdccee3069e715f1c05d1db3cb7313713c70d7f2
diff --git a/apps/CtsVerifier/Android.mk b/apps/CtsVerifier/Android.mk
index bbf7eaf..1a39fd3 100644
--- a/apps/CtsVerifier/Android.mk
+++ b/apps/CtsVerifier/Android.mk
@@ -37,4 +37,30 @@
 	adb install -r $(ANDROID_PRODUCT_OUT)/data/app/CtsVerifier.apk \
 		&& adb shell "am start -n com.android.cts.verifier/.CtsVerifierActivity"
 
+#
+# Creates a "cts-verifier" directory that will contain:
+#
+# 1. Out directory with a "android-cts-verifier" containing the CTS Verifier
+#    and other binaries it needs.
+#
+# 2. Zipped version of the android-cts-verifier directory to be included with
+#    the build distribution.
+#
+cts-dir := $(HOST_OUT)/cts-verifier
+verifier-dir-name := android-cts-verifier
+verifier-dir := $(cts-dir)/$(verifier-dir-name)
+verifier-zip-name := $(verifier-dir-name).zip
+verifier-zip := $(cts-dir)/$(verifier-zip-name)
+
+cts : $(verifier-zip)
+$(verifier-zip) : CtsVerifier $(ACP)
+		$(hide) mkdir -p $(verifier-dir)
+		$(hide) $(ACP) -fp $(call intermediates-dir-for,APPS,CtsVerifier)/package.apk \
+				$(verifier-dir)/CtsVerifier.apk
+		$(hide) cd $(cts-dir) && zip -rq $(verifier-dir-name) $(verifier-dir-name)
+
+ifneq ($(filter cts, $(MAKECMDGOALS)),)
+  $(call dist-for-goals, cts, $(verifier-zip):$(verifier-zip-name))
+endif
+
 include $(call all-makefiles-under,$(LOCAL_PATH))