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 |
Brett Chabot | 5a54633 | 2009-08-28 12:22:23 -0700 | [diff] [blame] | 20 | # and when built explicitly put it in the data partition |
| 21 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) |
Brian Carlstrom | cb71127 | 2012-06-16 23:32:47 -0700 | [diff] [blame] | 22 | # and because it is in data, do not strip classes.dex |
| 23 | LOCAL_DEX_PREOPT := false |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 24 | |
Brett Chabot | 584d2b9 | 2011-02-03 17:56:49 -0800 | [diff] [blame] | 25 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 26 | |
| 27 | LOCAL_JAVA_LIBRARIES := android.test.runner |
| 28 | |
| 29 | LOCAL_PACKAGE_NAME := SignatureTest |
| 30 | |
Bill Napier | 31f8d50 | 2009-05-14 18:07:17 -0700 | [diff] [blame] | 31 | LOCAL_SDK_VERSION := current |
| 32 | |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 33 | # To be passed in on command line |
| 34 | CTS_API_VERSION ?= current |
| 35 | |
Ying Wang | d97c2b1 | 2012-10-05 16:43:21 -0700 | [diff] [blame] | 36 | ifeq (current,$(CTS_API_VERSION)) |
| 37 | android_api_description := frameworks/base/api/$(CTS_API_VERSION).txt |
| 38 | else |
Joe Onorato | fd4394e | 2011-04-08 16:05:12 -0700 | [diff] [blame] | 39 | android_api_description := $(SRC_API_DIR)/$(CTS_API_VERSION).txt |
Ying Wang | d97c2b1 | 2012-10-05 16:43:21 -0700 | [diff] [blame] | 40 | endif |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 41 | |
| 42 | # Can't call local-intermediates-dir directly here because we have to |
| 43 | # include BUILD_PACAKGE first. Can't include BUILD_PACKAGE first |
| 44 | # because we have to override LOCAL_RESOURCE_DIR first. Hence this |
| 45 | # hack. |
| 46 | intermediates.COMMON := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),,COMMON) |
| 47 | signature_res_dir := $(intermediates.COMMON)/genres |
Ying Wang | 215341a | 2013-01-30 17:59:09 -0800 | [diff] [blame] | 48 | LOCAL_RESOURCE_DIR := $(signature_res_dir) $(LOCAL_PATH)/res |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 49 | |
| 50 | include $(BUILD_PACKAGE) |
| 51 | |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 52 | generated_res_stamp := $(intermediates.COMMON)/genres.stamp |
Ying Wang | 215341a | 2013-01-30 17:59:09 -0800 | [diff] [blame] | 53 | api_ver_file := $(intermediates.COMMON)/api_ver_is_$(CTS_API_VERSION) |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 54 | |
| 55 | # The api_ver_file keeps track of which api version was last built. |
| 56 | # By only ever having one of these magic files in existance and making |
| 57 | # sure the generated resources rule depend on it, we can ensure that |
| 58 | # the proper version of the api resource gets generated. |
| 59 | $(api_ver_file): |
Ying Wang | 7b68ff2 | 2013-01-31 19:50:16 -0800 | [diff] [blame] | 60 | $(hide) rm -f $(dir $@)/api_ver_is_* \ |
| 61 | && mkdir -p $(dir $@) && touch $@ |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 62 | |
Joe Onorato | fd4394e | 2011-04-08 16:05:12 -0700 | [diff] [blame] | 63 | android_api_xml_description := $(intermediates.COMMON)/api.xml |
Ying Wang | 215341a | 2013-01-30 17:59:09 -0800 | [diff] [blame] | 64 | $(android_api_xml_description): $(android_api_description) | $(APICHECK) |
| 65 | @ echo "Convert api file to xml: $@" |
| 66 | @ mkdir -p $(dir $@) |
| 67 | $(hide) $(APICHECK_COMMAND) -convert2xml $< $@ |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 68 | |
| 69 | # Split up config/api/1.xml by "package" and save the files as the |
| 70 | # resource files of SignatureTest. |
| 71 | $(generated_res_stamp): PRIVATE_PATH := $(LOCAL_PATH) |
| 72 | $(generated_res_stamp): PRIVATE_MODULE := $(LOCAL_MODULE) |
| 73 | $(generated_res_stamp): PRIVATE_RES_DIR := $(signature_res_dir) |
Ying Wang | 215341a | 2013-01-30 17:59:09 -0800 | [diff] [blame] | 74 | $(generated_res_stamp): PRIVATE_API_XML_DESC := $(android_api_xml_description) |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 75 | $(generated_res_stamp): $(api_ver_file) |
Ying Wang | 215341a | 2013-01-30 17:59:09 -0800 | [diff] [blame] | 76 | $(generated_res_stamp): $(android_api_xml_description) |
| 77 | @ echo "Copy generated resources: $(PRIVATE_MODULE)" |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 78 | $(hide) python cts/tools/utils/android_api_description_splitter.py \ |
Ying Wang | 215341a | 2013-01-30 17:59:09 -0800 | [diff] [blame] | 79 | $(PRIVATE_API_XML_DESC) $(PRIVATE_RES_DIR) package |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 80 | $(hide) touch $@ |
| 81 | |
Ying Wang | 215341a | 2013-01-30 17:59:09 -0800 | [diff] [blame] | 82 | $(R_file_stamp): $(generated_res_stamp) |
| 83 | |
| 84 | # clean up temp vars |
| 85 | android_api_xml_description := |
| 86 | api_ver_file := |
| 87 | generated_res_stamp := |
| 88 | signature_res_dir := |
| 89 | android_api_description := |
| 90 | CTS_API_VERSION := |
| 91 | |
Bill Napier | fbcc0a6 | 2009-04-06 10:33:01 -0700 | [diff] [blame] | 92 | |
| 93 | # Use the folloing include to make our test apk. |
| 94 | include $(call all-makefiles-under,$(LOCAL_PATH)) |