Move suite-level dynamic config to testcases

Enable client-side dynamic config code to access the suite-level dynamic
config files by placing them in the testcases directory. Also update
cts_v2.mk to define the location of its corresponding dynamic config file.

bug:23625592
Change-Id: Id11dea4b6acbe8ea7e5e9579e369a2be5873a224
diff --git a/core/tasks/tools/compatibility.mk b/core/tasks/tools/compatibility.mk
index 6216e6e..d8f900e 100644
--- a/core/tasks/tools/compatibility.mk
+++ b/core/tasks/tools/compatibility.mk
@@ -17,6 +17,7 @@
 # Input variables:
 #   test_suite_name: the name of this test suite eg. cts
 #   test_suite_tradefed: the name of this test suite's tradefed wrapper
+#   test_suite_dynamic_config: the path to this test suite's dynamic configuration file
 #   test_suite_readme: the path to a README file for this test suite
 # Output variables:
 #   compatibility_zip: the path to the output zip file.
@@ -34,9 +35,18 @@
 $(compatibility_zip): PRIVATE_NAME := android-$(test_suite_name)
 $(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir)
 $(compatibility_zip): PRIVATE_TOOLS := $(test_tools)
-$(compatibility_zip): $(test_artifacts) $(test_tools) | $(ADB) $(ACP)
+$(compatibility_zip): PRIVATE_SUITE_NAME := $(test_suite_name)
+$(compatibility_zip): PRIVATE_DYNAMIC_CONFIG := $(test_suite_dynamic_config)
+$(compatibility_zip): $(test_artifacts) $(test_tools) $(test_suite_dynamic_config) | $(ADB) $(ACP)
 # Make dir structure
 	$(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases
 # Copy tools
 	$(hide) $(ACP) -fp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools
+	$(if $(PRIVATE_DYNAMIC_CONFIG),$(hide) $(ACP) -fp $(PRIVATE_DYNAMIC_CONFIG) $(PRIVATE_OUT_DIR)/testcases/$(PRIVATE_SUITE_NAME).dynamic)
 	$(hide) cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME)
+
+# Reset all input variables
+test_suite_name :=
+test_suite_tradefed :=
+test_suite_dynamic_config :=
+test_suite_readme :=