1# Copyright (C) 2008 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# Build the CTS harness
16
17JUNIT_HOST_JAR := $(HOST_OUT_JAVA_LIBRARIES)/junit.jar
18HOSTTESTLIB_JAR := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar
19TF_JAR := $(HOST_OUT_JAVA_LIBRARIES)/tradefed-prebuilt.jar
20CTS_TF_JAR := $(HOST_OUT_JAVA_LIBRARIES)/old-cts-tradefed.jar
21CTS_TF_EXEC_PATH ?= $(HOST_OUT_EXECUTABLES)/old-cts-tradefed
22
23cts_prebuilt_jar := $(HOST_OUT)/old-cts/old-android-cts/tools/cts-prebuilt.jar
24$(cts_prebuilt_jar): PRIVATE_TESTS_DIR := $(HOST_OUT)/old-cts/old-android-cts/repository/testcases
25$(cts_prebuilt_jar): PRIVATE_PLANS_DIR := $(HOST_OUT)/old-cts/old-android-cts/repository/plans
26$(cts_prebuilt_jar): PRIVATE_TOOLS_DIR := $(HOST_OUT)/old-cts/old-android-cts/tools
27$(cts_prebuilt_jar): $(JUNIT_HOST_JAR) $(HOSTTESTLIB_JAR) $(TF_JAR) $(CTS_TF_JAR) $(CTS_TF_EXEC_PATH) $(ADDITIONAL_TF_JARS) | $(ACP) $(HOST_OUT_EXECUTABLES)/adb
28	mkdir -p $(PRIVATE_TESTS_DIR)
29	mkdir -p $(PRIVATE_PLANS_DIR)
30	mkdir -p $(PRIVATE_TOOLS_DIR)
31	$(ACP) -fp $(JUNIT_HOST_JAR) $(HOSTTESTLIB_JAR) $(TF_JAR) $(CTS_TF_JAR) $(CTS_TF_EXEC_PATH) $(ADDITIONAL_TF_JARS) $(PRIVATE_TOOLS_DIR)
32
33.PHONY: cts-harness
34cts-harness : $(cts_prebuilt_jar)
35
36# Put the test coverage report in the dist dir if "old-cts" is among the build goals.
37ifneq ($(filter old-cts, $(MAKECMDGOALS)),)
38  $(call dist-for-goals,old-cts,$(CTS_TF_JAR))
39  $(call dist-for-goals,old-cts,$(HOSTTESTLIB_JAR))
40endif
41
42include $(call all-subdir-makefiles)
43