blob: 8f0678f3374ca5ddf41c85bde59c2c56d492da34 [file] [log] [blame]
Stuart Scott1926e9b2015-06-03 17:42:39 -07001# 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 Holdenaee6f602015-12-15 15:04:01 -080020# test_suite_dynamic_config: the path to this test suite's dynamic configuration file
Stuart Scott1926e9b2015-06-03 17:42:39 -070021# test_suite_readme: the path to a README file for this test suite
Todd Leebae7ee52017-06-01 08:00:32 -070022# test_suite_prebuilt_tools: the set of prebuilt tools to be included directly
23# in the 'tools' subdirectory of the test suite.
Siyuan Zhou18883152017-11-20 17:26:40 -080024# test_suite_tools: the set of tools for this test suite
25#
Stuart Scott1926e9b2015-06-03 17:42:39 -070026# Output variables:
27# compatibility_zip: the path to the output zip file.
28
29out_dir := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name)
30test_artifacts := $(COMPATIBILITY.$(test_suite_name).FILES)
Stuart Scott1dcff842015-06-08 15:04:31 -070031test_tools := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar \
Julien Desprez63d377c2016-11-11 12:12:06 +000032 $(HOST_OUT_JAVA_LIBRARIES)/tradefed.jar \
Julien Desprezb8f37692020-07-09 15:29:37 -070033 $(HOST_OUT_JAVA_LIBRARIES)/tradefed-no-fwk.jar \
Julien Desprezfae54cb2020-05-18 13:28:40 -070034 $(HOST_OUT_JAVA_LIBRARIES)/tradefed-test-framework.jar \
jdesprez46190312018-03-19 16:47:22 -070035 $(HOST_OUT_JAVA_LIBRARIES)/loganalysis.jar \
Stuart Scott19324d12015-07-23 12:56:51 -070036 $(HOST_OUT_JAVA_LIBRARIES)/compatibility-host-util.jar \
Julien Desprez7b109502016-09-12 11:19:48 +010037 $(HOST_OUT_JAVA_LIBRARIES)/compatibility-host-util-tests.jar \
38 $(HOST_OUT_JAVA_LIBRARIES)/compatibility-common-util-tests.jar \
39 $(HOST_OUT_JAVA_LIBRARIES)/compatibility-tradefed-tests.jar \
Stuart Scott1dcff842015-06-08 15:04:31 -070040 $(HOST_OUT_JAVA_LIBRARIES)/$(test_suite_tradefed).jar \
Julien Desprez7b109502016-09-12 11:19:48 +010041 $(HOST_OUT_JAVA_LIBRARIES)/$(test_suite_tradefed)-tests.jar \
Stuart Scott1dcff842015-06-08 15:04:31 -070042 $(HOST_OUT_EXECUTABLES)/$(test_suite_tradefed) \
43 $(test_suite_readme)
Stuart Scott1926e9b2015-06-03 17:42:39 -070044
Siyuan Zhou18883152017-11-20 17:26:40 -080045test_tools += $(test_suite_tools)
46
Dan Shi6a619b82020-04-13 09:29:16 -070047# Include host shared libraries
48host_shared_libs := $(call copy-many-files, $(COMPATIBILITY.$(test_suite_name).HOST_SHARED_LIBRARY.FILES))
49
wangzhoue7f17252020-07-15 07:49:26 -070050compatibility_zip_deps := $(test_artifacts) $(test_tools) $(test_suite_prebuilt_tools) $(test_suite_dynamic_config) $(SOONG_ZIP) $(host_shared_libs)
51compatibility_zip_resources := $(out_dir)/tools $(out_dir)/testcases
52ifdef test_suite_notice
53 compatibility_zip_deps += $(test_suite_notice)
54 compatibility_zip_resources += $(out_dir)/$(notdir $(test_suite_notice))
55endif
56
Stuart Scott1926e9b2015-06-03 17:42:39 -070057compatibility_zip := $(out_dir).zip
58$(compatibility_zip): PRIVATE_NAME := android-$(test_suite_name)
59$(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir)
Todd Leebae7ee52017-06-01 08:00:32 -070060$(compatibility_zip): PRIVATE_TOOLS := $(test_tools) $(test_suite_prebuilt_tools)
Aaron Holdenaee6f602015-12-15 15:04:01 -080061$(compatibility_zip): PRIVATE_SUITE_NAME := $(test_suite_name)
62$(compatibility_zip): PRIVATE_DYNAMIC_CONFIG := $(test_suite_dynamic_config)
wangzhoue7f17252020-07-15 07:49:26 -070063$(compatibility_zip): PRIVATE_NOTICE := $(test_suite_notice)
64$(compatibility_zip): PRIVATE_RESOURCES := $(compatibility_zip_resources)
65$(compatibility_zip): $(compatibility_zip_deps) | $(ADB) $(ACP)
Stuart Scott1926e9b2015-06-03 17:42:39 -070066# Make dir structure
Stuart Scott3a037452015-06-10 09:25:24 -070067 $(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases
Julien Desprez7a106012018-07-26 11:47:46 -070068 $(hide) echo $(BUILD_NUMBER_FROM_FILE) > $(PRIVATE_OUT_DIR)/tools/version.txt
Stuart Scott1926e9b2015-06-03 17:42:39 -070069# Copy tools
Dan Willemsen288bedf2019-05-28 15:36:47 -070070 $(hide) cp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools
71 $(if $(PRIVATE_DYNAMIC_CONFIG),$(hide) cp $(PRIVATE_DYNAMIC_CONFIG) $(PRIVATE_OUT_DIR)/testcases/$(PRIVATE_SUITE_NAME).dynamic)
wangzhoue7f17252020-07-15 07:49:26 -070072 $(if $(PRIVATE_NOTICE),$(hide) cp $(PRIVATE_NOTICE) $(PRIVATE_OUT_DIR))
73 $(hide) find $(PRIVATE_RESOURCES) | sort >$@.list
Dan Willemsenc4cf4952017-03-10 13:39:26 -080074 $(hide) $(SOONG_ZIP) -d -o $@ -C $(dir $@) -l $@.list
Aaron Holdenaee6f602015-12-15 15:04:01 -080075
76# Reset all input variables
77test_suite_name :=
78test_suite_tradefed :=
79test_suite_dynamic_config :=
80test_suite_readme :=
Todd Leebae7ee52017-06-01 08:00:32 -070081test_suite_prebuilt_tools :=
Siyuan Zhou18883152017-11-20 17:26:40 -080082test_suite_tools :=
wangzhoue7f17252020-07-15 07:49:26 -070083test_suite_notice :=
Dan Shi6a619b82020-04-13 09:29:16 -070084host_shared_libs :=