1# Copyright (C) 2015 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# We define this in a subdir so that it won't pick up the parent's Android.xml by default.
16
17LOCAL_PATH := $(call my-dir)
18
19# $(1) name of the xml file to be created
20# $(2) path to the api text file
21define build_xml_api_file
22include $(CLEAR_VARS)
23LOCAL_MODULE := cts-$(subst .,-,$(1))
24LOCAL_MODULE_STEM := $(1)
25LOCAL_MODULE_CLASS := ETC
26LOCAL_MODULE_PATH = $(TARGET_OUT_DATA_ETC)
27LOCAL_COMPATIBILITY_SUITE := arcts cts vts general-tests
28include $(BUILD_SYSTEM)/base_rules.mk
29$$(LOCAL_BUILT_MODULE): $(2) | $(APICHECK)
30	@echo "Convert API file $$< -> $$@"
31	@mkdir -p $$(dir $$@)
32	$(hide) $(APICHECK_COMMAND) -convert2xmlnostrip $$< $$@
33endef
34
35# NOTE: the output XML file is also used
36# in //cts/hostsidetests/devicepolicy/AndroidTest.xml
37# by com.android.cts.managedprofile.CurrentApiHelper
38# ============================================================
39$(eval $(call build_xml_api_file,current.api,frameworks/base/api/current.txt))
40$(eval $(call build_xml_api_file,system-current.api,frameworks/base/api/system-current.txt))
41$(eval $(call build_xml_api_file,system-removed.api,frameworks/base/api/system-removed.txt))
42$(eval $(call build_xml_api_file,android-test-base-current.api,frameworks/base/test-base/api/android-test-base-current.txt))
43$(eval $(call build_xml_api_file,android-test-mock-current.api,frameworks/base/test-mock/api/android-test-mock-current.txt))
44$(eval $(call build_xml_api_file,android-test-runner-current.api,frameworks/base/test-runner/api/android-test-runner-current.txt))
45$(foreach ver,$(PLATFORM_SYSTEMSDK_VERSIONS),\
46  $(if $(call math_is_number,$(ver)),\
47    $(eval $(call build_xml_api_file,system-$(ver).api,prebuilts/sdk/system-api/$(ver).txt))\
48  )\
49)
50
51# current apache-http-legacy minus current api, in text format.
52# =============================================================
53# Removes any classes from the org.apache.http.legacy API description that are
54# also part of the Android API description.
55include $(CLEAR_VARS)
56LOCAL_MODULE_CLASS := ETC
57LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_ETC)
58
59# Tag this module as a cts test artifact
60LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
61
62LOCAL_MODULE := cts-apache-http-legacy-minus-current-api
63LOCAL_MODULE_STEM := apache-http-legacy-minus-current.api
64
65include $(BUILD_SYSTEM)/base_rules.mk
66$(LOCAL_BUILT_MODULE) : \
67        frameworks/base/api/current.txt \
68        external/apache-http/api/apache-http-legacy-current.txt \
69        | $(APICHECK)
70	@echo "Generate unique Apache Http Legacy API file -> $@"
71	@mkdir -p $(dir $@)
72	$(hide) $(APICHECK_COMMAND) -new_api_no_strip \
73	        frameworks/base/api/current.txt \
74            external/apache-http/api/apache-http-legacy-current.txt \
75            $@
76