1 # Copyright (C) 2014 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 host library and defines a rule to generate the associated test 17 # package XML needed by CTS. 18 # 19 # Disable by default so "m cts" will work in emulator builds 20 LOCAL_DEX_PREOPT := false 21 include $(BUILD_JAVA_LIBRARY) 22 cts_library_jar := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).jar 23 $(cts_library_jar): $(LOCAL_BUILT_MODULE) | $(ACP) 24 $(copy-file-to-target) 25 26 cts_library_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).xml 27 $(cts_library_xml): $(cts_library_jar) 28 $(cts_library_xml): PRIVATE_PATH := $(LOCAL_PATH)/src 29 $(cts_library_xml): PRIVATE_TEST_PACKAGE := $(LOCAL_CTS_TEST_PACKAGE) 30 $(cts_library_xml): PRIVATE_LIBRARY := $(LOCAL_MODULE) 31 $(cts_library_xml): PRIVATE_JAR_PATH := $(LOCAL_MODULE).jar 32 $(cts_library_xml): PRIVATE_RUNTIME_ARGS := $(LOCAL_CTS_TARGET_RUNTIME_ARGS) 33 $(cts_library_xml): $(TARGET_OUT_JAVA_LIBRARIES)/$(LOCAL_MODULE).jar $(CTS_EXPECTATIONS) $(CTS_UNSUPPORTED_ABIS) $(CTS_JAVA_TEST_SCANNER_DOCLET) $(CTS_JAVA_TEST_SCANNER) $(CTS_XML_GENERATOR) 34 $(hide) echo Generating test description for target library $(PRIVATE_LIBRARY) 35 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 36 $(hide) $(CTS_JAVA_TEST_SCANNER) -s $(PRIVATE_PATH) \ 37 -d $(CTS_JAVA_TEST_SCANNER_DOCLET) | \ 38 $(CTS_XML_GENERATOR) -t jUnitDeviceTest \ 39 -j $(PRIVATE_JAR_PATH) \ 40 -n $(PRIVATE_LIBRARY) \ 41 -p $(PRIVATE_TEST_PACKAGE) \ 42 -e $(CTS_EXPECTATIONS) \ 43 -b $(CTS_UNSUPPORTED_ABIS) \ 44 -a $(CTS_TARGET_ARCH) \ 45 -x "runtimeArgs->$(PRIVATE_RUNTIME_ARGS)" \ 46 -o $@ 47 48 # Have the module name depend on the cts files; so the cts files get generated when you run mm/mmm/mma/mmma. 49 $(my_register_name) : $(cts_library_jar) $(cts_library_xml) 50