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
diff --git a/acts/framework/acts/bin/__init__.py b/acts/framework/acts/bin/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/acts/framework/acts/bin/__init__.py
diff --git a/wts-acts/README b/wts-acts/README
new file mode 100644
index 0000000..77924b2
--- /dev/null
+++ b/wts-acts/README
@@ -0,0 +1,4 @@
+Note that this directory contains additional files to be packaged specifically
+with the wts-acts distribution, for use when running the Wear Test Suite.
+
+See ../Android.mk for details.
diff --git a/wts-acts/__init__.py b/wts-acts/__init__.py
new file mode 100644
index 0000000..345b574
--- /dev/null
+++ b/wts-acts/__init__.py
@@ -0,0 +1,13 @@
+#   Copyright 2017 - The Android Open Source Project
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
diff --git a/wts-acts/__main__.py b/wts-acts/__main__.py
new file mode 100644
index 0000000..d805838
--- /dev/null
+++ b/wts-acts/__main__.py
@@ -0,0 +1,7 @@
+#!/usr/bin/python
+__requires__ = 'acts==0.9'
+import sys
+
+from acts.bin.act import main
+main(sys.argv[1:])
+