1# Copyright (C) 2022 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
15ifneq ($(wildcard test/sts/README-sts-sdk.md),)
16test_suite_name := sts-lite
17test_suite_tradefed := sts-tradefed
18test_suite_readme := test/sts/README-sts-sdk.md
19sts_sdk_zip := $(HOST_OUT)/$(test_suite_name)/sts-sdk.zip
20
21include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk
22
23sts_sdk_samples := $(call intermediates-dir-for,ETC,sts-sdk-samples.zip)/sts-sdk-samples.zip
24
25$(sts_sdk_zip): STS_LITE_ZIP := $(compatibility_zip)
26$(sts_sdk_zip): STS_SDK_SAMPLES := $(sts_sdk_samples)
27$(sts_sdk_zip): $(MERGE_ZIPS) $(ZIP2ZIP) $(compatibility_zip) $(sts_sdk_samples)
28	rm -f $@ $(STS_LITE_ZIP)_filtered
29	$(ZIP2ZIP) -i $(STS_LITE_ZIP) -o $(STS_LITE_ZIP)_filtered \
30		-x android-sts-lite/tools/sts-tradefed-tests.jar \
31		'android-sts-lite/tools/*:sts-test/libs/' \
32		'android-sts-lite/testcases/*:sts-test/utils/' \
33		'android-sts-lite/jdk/**/*:sts-test/jdk/'
34	$(MERGE_ZIPS) $@ $(STS_LITE_ZIP)_filtered $(STS_SDK_SAMPLES)
35	rm -f $(STS_LITE_ZIP)_filtered
36
37.PHONY: sts-sdk
38sts-sdk: $(sts_sdk_zip)
39$(call dist-for-goals, sts-sdk, $(sts_sdk_zip))
40
41endif
42