The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 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 | LOCAL_PATH:= $(call my-dir) |
| 16 | include $(CLEAR_VARS) |
| 17 | |
Brett Chabot | 5a54633 | 2009-08-28 12:22:23 -0700 | [diff] [blame] | 18 | # don't include this package in any target |
Brett Chabot | f9e03e1 | 2009-08-13 20:55:28 -0700 | [diff] [blame] | 19 | LOCAL_MODULE_TAGS := optional |
Stuart Scott | c09a2e0 | 2013-11-15 13:03:29 -0800 | [diff] [blame] | 20 | |
Brett Chabot | 584d2b9 | 2011-02-03 17:56:49 -0800 | [diff] [blame] | 21 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 22 | |
Stuart Scott | f67280f | 2014-09-30 14:07:30 -0700 | [diff] [blame] | 23 | LOCAL_PACKAGE_NAME := CtsSignatureTestCases |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 24 | |
Bill Napier | 31f8d50 | 2009-05-14 18:07:17 -0700 | [diff] [blame] | 25 | LOCAL_SDK_VERSION := current |
| 26 | |
Stuart Scott | f67280f | 2014-09-30 14:07:30 -0700 | [diff] [blame] | 27 | LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner |
Brett Chabot | a6ea248 | 2014-01-09 14:32:20 -0800 | [diff] [blame] | 28 | |
Stuart Scott | 2e1ce77 | 2013-11-15 14:26:40 -0800 | [diff] [blame] | 29 | # To be passed in on command line |
| 30 | CTS_API_VERSION ?= current |
| 31 | ifeq (current,$(CTS_API_VERSION)) |
| 32 | android_api_description := frameworks/base/api/$(CTS_API_VERSION).txt |
| 33 | else |
| 34 | android_api_description := $(SRC_API_DIR)/$(CTS_API_VERSION).txt |
| 35 | endif |
| 36 | |
| 37 | # Can't call local-intermediates-dir directly here because we have to |
| 38 | # include BUILD_CTS_PACKAGE first. Can't include BUILD_CTS_PACKAGE first |
| 39 | # because we have to override LOCAL_RESOURCE_DIR first. Hence this |
| 40 | # hack. |
| 41 | intermediates.COMMON := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),,COMMON) |
| 42 | signature_res_dir := $(intermediates.COMMON)/genres |
| 43 | LOCAL_RESOURCE_DIR := $(signature_res_dir) $(LOCAL_PATH)/res |
| 44 | |
Stuart Scott | c09a2e0 | 2013-11-15 13:03:29 -0800 | [diff] [blame] | 45 | include $(BUILD_CTS_PACKAGE) |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 46 | |
Stuart Scott | 2e1ce77 | 2013-11-15 14:26:40 -0800 | [diff] [blame] | 47 | generated_res_stamp := $(intermediates.COMMON)/genres.stamp |
| 48 | api_ver_file := $(intermediates.COMMON)/api_ver_is_$(CTS_API_VERSION) |
| 49 | |
| 50 | # The api_ver_file keeps track of which api version was last built. |
| 51 | # By only ever having one of these magic files in existence and making |
| 52 | # sure the generated resources rule depend on it, we can ensure that |
| 53 | # the proper version of the api resource gets generated. |
| 54 | $(api_ver_file): |
| 55 | $(hide) rm -f $(dir $@)/api_ver_is_* \ |
| 56 | && mkdir -p $(dir $@) && touch $@ |
| 57 | |
| 58 | android_api_xml_description := $(intermediates.COMMON)/api.xml |
| 59 | $(android_api_xml_description): $(android_api_description) | $(APICHECK) |
| 60 | @ echo "Convert api file to xml: $@" |
| 61 | @ mkdir -p $(dir $@) |
| 62 | $(hide) $(APICHECK_COMMAND) -convert2xml $< $@ |
| 63 | |
| 64 | # Split up config/api/1.xml by "package" and save the files as the |
| 65 | # resource files of SignatureTest. |
| 66 | $(generated_res_stamp): PRIVATE_PATH := $(LOCAL_PATH) |
| 67 | $(generated_res_stamp): PRIVATE_MODULE := $(LOCAL_MODULE) |
| 68 | $(generated_res_stamp): PRIVATE_RES_DIR := $(signature_res_dir) |
| 69 | $(generated_res_stamp): PRIVATE_API_XML_DESC := $(android_api_xml_description) |
| 70 | $(generated_res_stamp): $(api_ver_file) |
| 71 | $(generated_res_stamp): $(android_api_xml_description) |
| 72 | @ echo "Copy generated resources: $(PRIVATE_MODULE)" |
| 73 | $(hide) python cts/tools/utils/android_api_description_splitter.py \ |
| 74 | $(PRIVATE_API_XML_DESC) $(PRIVATE_RES_DIR) package |
| 75 | $(hide) touch $@ |
| 76 | |
| 77 | $(R_file_stamp): $(generated_res_stamp) |
| 78 | |
| 79 | # clean up temp vars |
| 80 | android_api_xml_description := |
| 81 | api_ver_file := |
| 82 | generated_res_stamp := |
| 83 | signature_res_dir := |
| 84 | android_api_description := |
| 85 | CTS_API_VERSION := |
| 86 | |
Stuart Scott | f67280f | 2014-09-30 14:07:30 -0700 | [diff] [blame] | 87 | # signature-hostside java library (for testing) |
| 88 | # ============================================================ |
| 89 | |
| 90 | include $(CLEAR_VARS) |
| 91 | |
| 92 | # These files are for device-side only, so filter-out for host library |
| 93 | LOCAL_DEVICE_ONLY_SOURCES := %/SignatureTest.java |
| 94 | |
| 95 | LOCAL_SRC_FILES := $(filter-out $(LOCAL_DEVICE_ONLY_SOURCES), $(call all-java-files-under, src)) |
| 96 | |
| 97 | LOCAL_MODULE := signature-hostside |
| 98 | |
| 99 | LOCAL_MODULE_TAGS := optional |
| 100 | |
| 101 | include $(BUILD_HOST_JAVA_LIBRARY) |