OSDN Git Service

Adds the compatibility build task and cts_v2 rules.
authorStuart Scott <stuartscott@google.com>
Thu, 4 Jun 2015 00:42:39 +0000 (17:42 -0700)
committerStuart Scott <stuartscott@google.com>
Thu, 4 Jun 2015 22:09:47 +0000 (15:09 -0700)
Change-Id: If7939dba38566f26cbc678da3fe7cb605c19745a

core/tasks/cts_v2.mk [new file with mode: 0644]
core/tasks/tools/compatibility.mk [new file with mode: 0644]

diff --git a/core/tasks/cts_v2.mk b/core/tasks/cts_v2.mk
new file mode 100644 (file)
index 0000000..76a4d02
--- /dev/null
@@ -0,0 +1,23 @@
+# Copyright (C) 2015 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.
+
+test_suite_name := cts_v2
+test_suite_tradefed := cts-tradefed_v2
+test_suite_readme := cts/tools/cts-tradefed/README
+
+include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk
+
+.PHONY: cts_v2
+cts_v2: $(compatibility_zip)
+$(call dist-for-goals, cts_v2, $(compatibility_zip))
diff --git a/core/tasks/tools/compatibility.mk b/core/tasks/tools/compatibility.mk
new file mode 100644 (file)
index 0000000..3a8e43b
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright (C) 2015 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.
+
+# Package up a compatibility test suite in a zip file.
+#
+# 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_readme: the path to a README file for this test suite
+# Output variables:
+#   compatibility_zip: the path to the output zip file.
+
+out_dir := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name)
+test_artifacts := $(COMPATIBILITY.$(test_suite_name).FILES)
+hosttestlib_jar := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar
+tf_prebuilt := $(HOST_OUT_JAVA_LIBRARIES)/tradefed-prebuilt.jar
+host_library := $(HOST_OUT_JAVA_LIBRARIES)/compatibility-common-util-hostsidelib.jar
+tf_library := $(HOST_OUT_JAVA_LIBRARIES)/compatibility-tradefed.jar
+jar := $(HOST_OUT_JAVA_LIBRARIES)/$(test_suite_tradefed).jar
+exec := $(HOST_OUT_EXECUTABLES)/$(test_suite_tradefed)
+readme := $(test_suite_readme)
+
+compatibility_zip := $(out_dir).zip
+$(compatibility_zip): PRIVATE_NAME := android-$(test_suite_name)
+$(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir)
+$(compatibility_zip): $(test_artifacts) $(hosttestlib_jar) $(tf_prebuilt) $(host_library) $(tf_library) $(jar) $(exec) $(readme) | $(ADB) $(ACP)
+# Make dir structure
+       $(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/repository/testcases $(PRIVATE_OUT_DIR)/repository/plans
+# Copy tools
+       $(hide) $(ACP) -fp $^ $(PRIVATE_OUT_DIR)/tools
+       $(hide) cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME)