prepare acts for wts integration

provides distinct ACTS module for WTS to be included as a prebuilt
tool (executable archive) within the android-wts distribution.

Bug: b/62102556
Change-Id: I03516452d742469a83d535dc3f126defbe345f37
diff --git a/Android.mk b/Android.mk
index 6e7225f..be8e9f4 100644
--- a/Android.mk
+++ b/Android.mk
@@ -20,6 +20,7 @@
 
 ifeq ($(HOST_OS),linux)
 
+# general Android Conntectivity Test Suite
 ACTS_DISTRO := $(HOST_OUT)/acts-dist/acts.zip
 
 $(ACTS_DISTRO): $(sort $(shell find $(LOCAL_PATH)/acts/framework))
@@ -31,4 +32,30 @@
 
 $(call dist-for-goals,tests,$(ACTS_DISTRO))
 
+# Wear specific Android Connectivity Test Suite
+WTS_ACTS_DISTRO_DIR := $(HOST_OUT)/wts-acts-dist
+WTS_ACTS_DISTRO := $(WTS_ACTS_DISTRO_DIR)/wts-acts
+WTS_ACTS_DISTRO_ARCHIVE := $(WTS_ACTS_DISTRO_DIR)/wts-acts.zip
+WTS_LOCAL_ACTS_DIR := tools/test/connectivity/acts/framework/acts/
+
+$(WTS_ACTS_DISTRO): $(SOONG_ZIP)
+	@echo "Packaging WTS-ACTS into $(WTS_ACTS_DISTRO)"
+	# clean-up and mkdir for dist
+	@rm -Rf $(WTS_ACTS_DISTRO_DIR)
+	@mkdir -p $(WTS_ACTS_DISTRO_DIR)
+	# grab the files from local acts framework and zip them up
+	$(hide) find $(WTS_LOCAL_ACTS_DIR) | sort >$@.list
+	$(hide) $(SOONG_ZIP) -d -P acts -o $@ -C tools/test/connectivity/acts/framework/acts/ -l $@.list
+	# add in the local wts py files for use with the prebuilt
+	$(hide) zip -r $(WTS_ACTS_DISTRO_ARCHIVE) -j tools/test/connectivity/wts-acts/*.py
+	# create executable tool from the archive
+	$(hide) echo '#!/usr/bin/env python' | cat - $(WTS_ACTS_DISTRO_DIR)/wts-acts.zip > $(WTS_ACTS_DISTRO_DIR)/wts-acts
+	$(hide) chmod 755 $(WTS_ACTS_DISTRO)
+
+wts-acts: $(WTS_ACTS_DISTRO)
+
+$(call dist-for-goals,tests,$(WTS_ACTS_DISTRO))
+
+
+
 endif