1# Copyright (C) 2017 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# Specify the following variables before including:
16#
17#     LOCAL_PACKAGE_NAME
18#         the name of the package
19#
20#     LOCAL_SIGNATURE_API_FILES
21#         the list of api files needed
22
23# don't include this package in any target
24LOCAL_MODULE_TAGS := tests
25
26# Tag this module as a cts test artifact
27LOCAL_COMPATIBILITY_SUITE := cts vts10 general-tests
28
29LOCAL_SDK_VERSION := current
30
31LOCAL_STATIC_JAVA_LIBRARIES += cts-api-signature-test
32
33LOCAL_JNI_SHARED_LIBRARIES += libclassdescriptors
34LOCAL_MULTILIB := both
35
36# Add dependencies needed to build/run the test with atest.
37#
38# Converts:
39#     current.api -> $(SOONG_OUT_DIR)/.intermediates/cts/tests/signature/api/cts-current-txt/gen/current.txt
40
41# Construct module name directory from file name, matches location of output of genrules
42# in ../api/Android.bp.
43#   Replace . with -
44#   Prefix every entry with cts-
45#
46cts_signature_module_deps := $(LOCAL_SIGNATURE_API_FILES)
47cts_signature_module_deps := $(subst .,-,$(cts_signature_module_deps))
48cts_signature_module_deps := $(addprefix cts-,$(cts_signature_module_deps))
49
50# Construct path to the generated files and add them as java resources.
51cts_signature_module_resources := $(addprefix $(SOONG_OUT_DIR)/.intermediates/cts/tests/signature/api/,$(cts_signature_module_deps))
52cts_signature_module_resources := $(addsuffix /gen/,$(cts_signature_module_resources))
53cts_signature_module_resources := $(join $(cts_signature_module_resources),$(LOCAL_SIGNATURE_API_FILES))
54
55LOCAL_JAVA_RESOURCE_FILES += $(cts_signature_module_resources)
56
57LOCAL_DEX_PREOPT := false
58LOCAL_PROGUARD_ENABLED := disabled
59
60LOCAL_USE_EMBEDDED_NATIVE_LIBS := false
61
62ifneq (,$(wildcard $(LOCAL_PATH)/src))
63  LOCAL_SRC_FILES := $(call all-java-files-under, src)
64endif
65
66include $(BUILD_CTS_PACKAGE)
67
68LOCAL_SIGNATURE_API_FILES :=
69cts_signature_module_resources :=
70cts_signature_module_deps :=
71