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 |
Aaron Holden | aee6f60 | 2015-12-15 15:04:01 -0800 | [diff] [blame] | 20 | # test_suite_dynamic_config: the path to this test suite's dynamic configuration file |
Stuart Scott | 1926e9b | 2015-06-03 17:42:39 -0700 | [diff] [blame] | 21 | # test_suite_readme: the path to a README file for this test suite |
Todd Lee | bae7ee5 | 2017-06-01 08:00:32 -0700 | [diff] [blame^] | 22 | # test_suite_prebuilt_tools: the set of prebuilt tools to be included directly |
| 23 | # in the 'tools' subdirectory of the test suite. |
Stuart Scott | 1926e9b | 2015-06-03 17:42:39 -0700 | [diff] [blame] | 24 | # Output variables: |
| 25 | # compatibility_zip: the path to the output zip file. |
| 26 | |
| 27 | out_dir := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name) |
| 28 | test_artifacts := $(COMPATIBILITY.$(test_suite_name).FILES) |
Stuart Scott | 1dcff84 | 2015-06-08 15:04:31 -0700 | [diff] [blame] | 29 | test_tools := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar \ |
Julien Desprez | 63d377c | 2016-11-11 12:12:06 +0000 | [diff] [blame] | 30 | $(HOST_OUT_JAVA_LIBRARIES)/tradefed.jar \ |
Stuart Scott | 19324d1 | 2015-07-23 12:56:51 -0700 | [diff] [blame] | 31 | $(HOST_OUT_JAVA_LIBRARIES)/compatibility-host-util.jar \ |
Julien Desprez | 7b10950 | 2016-09-12 11:19:48 +0100 | [diff] [blame] | 32 | $(HOST_OUT_JAVA_LIBRARIES)/compatibility-host-util-tests.jar \ |
| 33 | $(HOST_OUT_JAVA_LIBRARIES)/compatibility-common-util-tests.jar \ |
| 34 | $(HOST_OUT_JAVA_LIBRARIES)/compatibility-tradefed-tests.jar \ |
Joe Onorato | 9aa0b89 | 2016-12-14 16:55:40 -0800 | [diff] [blame] | 35 | $(HOST_OUT_JAVA_LIBRARIES)/host-libprotobuf-java-full.jar \ |
Stuart Scott | 1dcff84 | 2015-06-08 15:04:31 -0700 | [diff] [blame] | 36 | $(HOST_OUT_JAVA_LIBRARIES)/$(test_suite_tradefed).jar \ |
Julien Desprez | 7b10950 | 2016-09-12 11:19:48 +0100 | [diff] [blame] | 37 | $(HOST_OUT_JAVA_LIBRARIES)/$(test_suite_tradefed)-tests.jar \ |
Stuart Scott | 1dcff84 | 2015-06-08 15:04:31 -0700 | [diff] [blame] | 38 | $(HOST_OUT_EXECUTABLES)/$(test_suite_tradefed) \ |
| 39 | $(test_suite_readme) |
Stuart Scott | 1926e9b | 2015-06-03 17:42:39 -0700 | [diff] [blame] | 40 | |
| 41 | compatibility_zip := $(out_dir).zip |
| 42 | $(compatibility_zip): PRIVATE_NAME := android-$(test_suite_name) |
| 43 | $(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir) |
Todd Lee | bae7ee5 | 2017-06-01 08:00:32 -0700 | [diff] [blame^] | 44 | $(compatibility_zip): PRIVATE_TOOLS := $(test_tools) $(test_suite_prebuilt_tools) |
Aaron Holden | aee6f60 | 2015-12-15 15:04:01 -0800 | [diff] [blame] | 45 | $(compatibility_zip): PRIVATE_SUITE_NAME := $(test_suite_name) |
| 46 | $(compatibility_zip): PRIVATE_DYNAMIC_CONFIG := $(test_suite_dynamic_config) |
Todd Lee | bae7ee5 | 2017-06-01 08:00:32 -0700 | [diff] [blame^] | 47 | $(compatibility_zip): $(test_artifacts) $(test_tools) $(test_suite_prebuilt_tools) $(test_suite_dynamic_config) $(SOONG_ZIP) | $(ADB) $(ACP) |
Stuart Scott | 1926e9b | 2015-06-03 17:42:39 -0700 | [diff] [blame] | 48 | # Make dir structure |
Stuart Scott | 3a03745 | 2015-06-10 09:25:24 -0700 | [diff] [blame] | 49 | $(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases |
Stuart Scott | 1926e9b | 2015-06-03 17:42:39 -0700 | [diff] [blame] | 50 | # Copy tools |
Stuart Scott | 1dcff84 | 2015-06-08 15:04:31 -0700 | [diff] [blame] | 51 | $(hide) $(ACP) -fp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools |
Aaron Holden | aee6f60 | 2015-12-15 15:04:01 -0800 | [diff] [blame] | 52 | $(if $(PRIVATE_DYNAMIC_CONFIG),$(hide) $(ACP) -fp $(PRIVATE_DYNAMIC_CONFIG) $(PRIVATE_OUT_DIR)/testcases/$(PRIVATE_SUITE_NAME).dynamic) |
Dan Willemsen | c4cf495 | 2017-03-10 13:39:26 -0800 | [diff] [blame] | 53 | $(hide) find $(dir $@)/$(PRIVATE_NAME) | sort >$@.list |
| 54 | $(hide) $(SOONG_ZIP) -d -o $@ -C $(dir $@) -l $@.list |
Aaron Holden | aee6f60 | 2015-12-15 15:04:01 -0800 | [diff] [blame] | 55 | |
| 56 | # Reset all input variables |
| 57 | test_suite_name := |
| 58 | test_suite_tradefed := |
| 59 | test_suite_dynamic_config := |
| 60 | test_suite_readme := |
Todd Lee | bae7ee5 | 2017-06-01 08:00:32 -0700 | [diff] [blame^] | 61 | test_suite_prebuilt_tools := |