Brett Chabot | 87f4451 | 2012-11-16 16:00:02 -0800 | [diff] [blame] | 1 | # 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 | |
| 20 | include $(BUILD_JAVA_LIBRARY) |
| 21 | |
| 22 | cts_library_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).xml |
| 23 | cts_library_jar := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).jar |
| 24 | |
| 25 | $(cts_library_jar): PRIVATE_MODULE := $(LOCAL_MODULE) |
| 26 | $(cts_library_jar): $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE))/javalib.jar | $(ACP) |
| 27 | $(hide) mkdir -p $(CTS_TESTCASES_OUT) |
| 28 | $(hide) $(ACP) -fp $(call intermediates-dir-for,JAVA_LIBRARIES,$(PRIVATE_MODULE))/javalib.jar $@ |
| 29 | |
| 30 | $(cts_library_xml): PRIVATE_PATH := $(LOCAL_PATH)/src |
| 31 | $(cts_library_xml): PRIVATE_TEST_APP_PACKAGE := $(LOCAL_CTS_TEST_APP_PACKAGE) |
| 32 | $(cts_library_xml): PRIVATE_TEST_PACKAGE := $(LOCAL_CTS_TEST_PACKAGE) |
| 33 | $(cts_library_xml): PRIVATE_TEST_APK := $(LOCAL_CTS_TEST_APK) |
| 34 | $(cts_library_xml): PRIVATE_LIBRARY := $(LOCAL_MODULE) |
| 35 | $(cts_library_xml): PRIVATE_JAR_PATH := $(LOCAL_MODULE).jar |
| 36 | $(cts_library_xml): $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE))/javalib.jar $(CTS_EXPECTATIONS) $(CTS_JAVA_TEST_SCANNER_DOCLET) $(CTS_JAVA_TEST_SCANNER) $(CTS_XML_GENERATOR) |
| 37 | $(hide) echo Generating test description for uiautomator library $(PRIVATE_LIBRARY) |
| 38 | $(hide) mkdir -p $(CTS_TESTCASES_OUT) |
| 39 | $(hide) $(CTS_JAVA_TEST_SCANNER) -s $(PRIVATE_PATH) \ |
| 40 | -d $(CTS_JAVA_TEST_SCANNER_DOCLET) | \ |
| 41 | $(CTS_XML_GENERATOR) -t uiAutomator \ |
| 42 | -i $(PRIVATE_TEST_APK) \ |
| 43 | -j $(PRIVATE_JAR_PATH) \ |
| 44 | -a $(PRIVATE_TEST_PACKAGE) \ |
| 45 | -n $(PRIVATE_LIBRARY) \ |
| 46 | -p $(PRIVATE_TEST_PACKAGE) \ |
| 47 | -r $(PRIVATE_TEST_APP_PACKAGE) \ |
| 48 | -e $(CTS_EXPECTATIONS) \ |
| 49 | -o $@ |