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#
16# Builds a package which is needed by a test package and copies it to CTS
17#
18# Replace "include $(BUILD_PACKAGE)" with "include $(BUILD_CTS_SUPPORT_PACKAGE)"
19#
20
21# Disable by default so "m cts" will work in emulator builds
22LOCAL_DEX_PREOPT := false
23LOCAL_PROGUARD_ENABLED := disabled
24
25include $(BUILD_PACKAGE)
26
27cts_support_apks :=
28$(foreach fp, $(ALL_MODULES.$(LOCAL_PACKAGE_NAME).BUILT_INSTALLED),\
29  $(eval pair := $(subst :,$(space),$(fp)))\
30  $(eval built := $(word 1,$(pair)))\
31  $(eval installed := $(CTS_TESTCASES_OUT)/$(notdir $(word 2,$(pair))))\
32  $(eval $(call copy-one-file, $(built), $(installed)))\
33  $(eval cts_support_apks += $(installed)))
34
35# Have the module name depend on the cts files; so the cts files get generated when you run mm/mmm/mma/mmma.
36$(my_register_name) : $(cts_support_apks)
37