Stuart Scott | 1926e9b | 2015-06-03 17:42:39 -0700 | [diff] [blame] | 1 | # Copyright (C) 2015 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # Package up a compatibility test suite in a zip file. |
| 16 | # |
| 17 | # Input variables: |
| 18 | # test_suite_name: the name of this test suite eg. cts |
| 19 | # test_suite_tradefed: the name of this test suite's tradefed wrapper |
| 20 | # test_suite_readme: the path to a README file for this test suite |
| 21 | # Output variables: |
| 22 | # compatibility_zip: the path to the output zip file. |
| 23 | |
| 24 | out_dir := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name) |
| 25 | test_artifacts := $(COMPATIBILITY.$(test_suite_name).FILES) |
Stuart Scott | 1dcff84 | 2015-06-08 15:04:31 -0700 | [diff] [blame^] | 26 | test_tools := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar \ |
| 27 | $(HOST_OUT_JAVA_LIBRARIES)/tradefed-prebuilt.jar \ |
| 28 | $(HOST_OUT_JAVA_LIBRARIES)/compatibility-common-util-hostsidelib.jar \ |
| 29 | $(HOST_OUT_JAVA_LIBRARIES)/compatibility-tradefed.jar \ |
| 30 | $(HOST_OUT_JAVA_LIBRARIES)/$(test_suite_tradefed).jar \ |
| 31 | $(HOST_OUT_EXECUTABLES)/$(test_suite_tradefed) \ |
| 32 | $(test_suite_readme) |
Stuart Scott | 1926e9b | 2015-06-03 17:42:39 -0700 | [diff] [blame] | 33 | |
| 34 | compatibility_zip := $(out_dir).zip |
| 35 | $(compatibility_zip): PRIVATE_NAME := android-$(test_suite_name) |
| 36 | $(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir) |
Stuart Scott | 1dcff84 | 2015-06-08 15:04:31 -0700 | [diff] [blame^] | 37 | $(compatibility_zip): PRIVATE_TOOLS := $(test_tools) |
| 38 | $(compatibility_zip): $(test_artifacts) $(test_tools) | $(ADB) $(ACP) |
Stuart Scott | 1926e9b | 2015-06-03 17:42:39 -0700 | [diff] [blame] | 39 | # Make dir structure |
| 40 | $(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/repository/testcases $(PRIVATE_OUT_DIR)/repository/plans |
| 41 | # Copy tools |
Stuart Scott | 1dcff84 | 2015-06-08 15:04:31 -0700 | [diff] [blame^] | 42 | $(hide) $(ACP) -fp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools |
Stuart Scott | 1926e9b | 2015-06-03 17:42:39 -0700 | [diff] [blame] | 43 | $(hide) cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME) |