blob: a191d72fc9160a6a4a8a3aca90a33c80a9588520 [file] [log] [blame]
Brett Chabot87f44512012-11-16 16:00:02 -08001# Copyright (C) 2012 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#
16# Builds a uiautomator library and defines a rule to generate the associated test
17# package XML needed by CTS.
18#
19
Stuart Scottd4d679f2013-06-05 16:08:28 -070020LOCAL_DEX_PREOPT := false
21
Brett Chabot87f44512012-11-16 16:00:02 -080022include $(BUILD_JAVA_LIBRARY)
Guang Zhu76be1e52015-05-18 20:19:01 -070023include $(BUILD_CTS_MODULE_TEST_CONFIG)
Brett Chabot87f44512012-11-16 16:00:02 -080024
Brett Chabot87f44512012-11-16 16:00:02 -080025cts_library_jar := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).jar
Stuart Scott0337dbf2015-02-04 10:37:07 -080026$(cts_library_jar): $(LOCAL_BUILT_MODULE)
27 $(call copy-file-to-target)
Brett Chabot87f44512012-11-16 16:00:02 -080028
dcashman8e1f6e42014-10-24 16:16:30 -070029cts_src_dirs := $(LOCAL_PATH)/src
30cts_src_dirs += $(sort $(dir $(LOCAL_GENERATED_SOURCES)))
31cts_src_dirs := $(addprefix -s , $(cts_src_dirs))
32
Stuart Scott0337dbf2015-02-04 10:37:07 -080033cts_library_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).xml
dcashman8e1f6e42014-10-24 16:16:30 -070034$(cts_library_xml): PRIVATE_SRC_DIRS := $(cts_src_dirs)
Brett Chabot87f44512012-11-16 16:00:02 -080035$(cts_library_xml): PRIVATE_TEST_APP_PACKAGE := $(LOCAL_CTS_TEST_APP_PACKAGE)
36$(cts_library_xml): PRIVATE_TEST_PACKAGE := $(LOCAL_CTS_TEST_PACKAGE)
37$(cts_library_xml): PRIVATE_TEST_APK := $(LOCAL_CTS_TEST_APK)
38$(cts_library_xml): PRIVATE_LIBRARY := $(LOCAL_MODULE)
39$(cts_library_xml): PRIVATE_JAR_PATH := $(LOCAL_MODULE).jar
Stuart Scott544aec02015-03-11 16:41:43 -070040$(cts_library_xml): $(cts_library_jar)
Guang Zhu76be1e52015-05-18 20:19:01 -070041$(cts_library_xml): $(cts_module_test_config)
Stuart Scott544aec02015-03-11 16:41:43 -070042$(cts_library_xml): $(CTS_EXPECTATIONS) $(CTS_UNSUPPORTED_ABIS) $(CTS_JAVA_TEST_SCANNER_DOCLET) $(CTS_JAVA_TEST_SCANNER) $(CTS_XML_GENERATOR)
Brett Chabot87f44512012-11-16 16:00:02 -080043 $(hide) echo Generating test description for uiautomator library $(PRIVATE_LIBRARY)
44 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
dcashman8e1f6e42014-10-24 16:16:30 -070045 $(hide) $(CTS_JAVA_TEST_SCANNER) $(PRIVATE_SRC_DIRS) \
Brett Chabot87f44512012-11-16 16:00:02 -080046 -d $(CTS_JAVA_TEST_SCANNER_DOCLET) | \
47 $(CTS_XML_GENERATOR) -t uiAutomator \
48 -i $(PRIVATE_TEST_APK) \
49 -j $(PRIVATE_JAR_PATH) \
Stuart Scott34c8fc82014-09-08 13:25:16 -070050 -s $(PRIVATE_TEST_PACKAGE) \
Brett Chabot87f44512012-11-16 16:00:02 -080051 -n $(PRIVATE_LIBRARY) \
52 -p $(PRIVATE_TEST_PACKAGE) \
53 -r $(PRIVATE_TEST_APP_PACKAGE) \
54 -e $(CTS_EXPECTATIONS) \
Stuart Scott34c8fc82014-09-08 13:25:16 -070055 -b $(CTS_UNSUPPORTED_ABIS) \
Stuart Scottccdc00b2014-09-29 20:42:08 +000056 -a $(CTS_TARGET_ARCH) \
Brett Chabot87f44512012-11-16 16:00:02 -080057 -o $@
Ying Wang1aed9cd2015-01-28 16:59:57 -080058
59# Have the module name depend on the cts files; so the cts files get generated when you run mm/mmm/mma/mmma.
Guang Zhu76be1e52015-05-18 20:19:01 -070060$(my_register_name) : $(cts_library_jar) $(cts_library_xml) $(cts_module_test_config)