blob: 0b51f250e21556e10ba9adb332bd44db6d9a9e55 [file] [log] [blame]
The Android Open Source Projectf8057102009-03-15 16:47:16 -07001# 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
15LOCAL_PATH:= $(call my-dir)
16include $(CLEAR_VARS)
17
Brett Chabot5a546332009-08-28 12:22:23 -070018# don't include this package in any target
Brett Chabotf9e03e12009-08-13 20:55:28 -070019LOCAL_MODULE_TAGS := optional
Brett Chabot5a546332009-08-28 12:22:23 -070020# and when built explicitly put it in the data partition
21LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
Brian Carlstromcb711272012-06-16 23:32:47 -070022# and because it is in data, do not strip classes.dex
23LOCAL_DEX_PREOPT := false
The Android Open Source Projectf8057102009-03-15 16:47:16 -070024
Brett Chabot584d2b92011-02-03 17:56:49 -080025LOCAL_SRC_FILES := $(call all-java-files-under, src)
The Android Open Source Projectf8057102009-03-15 16:47:16 -070026
27LOCAL_JAVA_LIBRARIES := android.test.runner
28
29LOCAL_PACKAGE_NAME := SignatureTest
30
Bill Napier31f8d502009-05-14 18:07:17 -070031LOCAL_SDK_VERSION := current
32
The Android Open Source Projectf8057102009-03-15 16:47:16 -070033# To be passed in on command line
34CTS_API_VERSION ?= current
35
Ying Wangd97c2b12012-10-05 16:43:21 -070036ifeq (current,$(CTS_API_VERSION))
37android_api_description := frameworks/base/api/$(CTS_API_VERSION).txt
38else
Joe Onoratofd4394e2011-04-08 16:05:12 -070039android_api_description := $(SRC_API_DIR)/$(CTS_API_VERSION).txt
Ying Wangd97c2b12012-10-05 16:43:21 -070040endif
The Android Open Source Projectf8057102009-03-15 16:47:16 -070041
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.
46intermediates.COMMON := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),,COMMON)
47signature_res_dir := $(intermediates.COMMON)/genres
Ying Wang215341a2013-01-30 17:59:09 -080048LOCAL_RESOURCE_DIR := $(signature_res_dir) $(LOCAL_PATH)/res
The Android Open Source Projectf8057102009-03-15 16:47:16 -070049
50include $(BUILD_PACKAGE)
51
The Android Open Source Projectf8057102009-03-15 16:47:16 -070052generated_res_stamp := $(intermediates.COMMON)/genres.stamp
Ying Wang215341a2013-01-30 17:59:09 -080053api_ver_file := $(intermediates.COMMON)/api_ver_is_$(CTS_API_VERSION)
The Android Open Source Projectf8057102009-03-15 16:47:16 -070054
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 Wang7b68ff22013-01-31 19:50:16 -080060 $(hide) rm -f $(dir $@)/api_ver_is_* \
61 && mkdir -p $(dir $@) && touch $@
The Android Open Source Projectf8057102009-03-15 16:47:16 -070062
Joe Onoratofd4394e2011-04-08 16:05:12 -070063android_api_xml_description := $(intermediates.COMMON)/api.xml
Ying Wang215341a2013-01-30 17:59:09 -080064$(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 Projectf8057102009-03-15 16:47:16 -070068
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 Wang215341a2013-01-30 17:59:09 -080074$(generated_res_stamp): PRIVATE_API_XML_DESC := $(android_api_xml_description)
The Android Open Source Projectf8057102009-03-15 16:47:16 -070075$(generated_res_stamp): $(api_ver_file)
Ying Wang215341a2013-01-30 17:59:09 -080076$(generated_res_stamp): $(android_api_xml_description)
77 @ echo "Copy generated resources: $(PRIVATE_MODULE)"
The Android Open Source Projectf8057102009-03-15 16:47:16 -070078 $(hide) python cts/tools/utils/android_api_description_splitter.py \
Ying Wang215341a2013-01-30 17:59:09 -080079 $(PRIVATE_API_XML_DESC) $(PRIVATE_RES_DIR) package
The Android Open Source Projectf8057102009-03-15 16:47:16 -070080 $(hide) touch $@
81
Ying Wang215341a2013-01-30 17:59:09 -080082$(R_file_stamp): $(generated_res_stamp)
83
84# clean up temp vars
85android_api_xml_description :=
86api_ver_file :=
87generated_res_stamp :=
88signature_res_dir :=
89android_api_description :=
90CTS_API_VERSION :=
91
Bill Napierfbcc0a62009-04-06 10:33:01 -070092
93# Use the folloing include to make our test apk.
94include $(call all-makefiles-under,$(LOCAL_PATH))