1 # 2 # Copyright (C) 2017 The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 # 16 17 LOCAL_PATH := $(call my-dir) 18 19 ######################################### 20 # The prebuilt support libraries. 21 22 include $(CLEAR_VARS) 23 24 # For apps (unbundled) build, replace the typical 25 # make target artifacts with prebuilts. 26 ifneq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) 27 28 # Set up prebuilts for optional libraries. Need to specify them explicitly 29 # as the target name does not match the JAR name. 30 prebuilts += \ 31 android.test.mock.stubs-system:optional/android.test.mock.jar \ 32 33 define define-prebuilt 34 $(eval tw := $(subst :, ,$(strip $(1)))) \ 35 $(eval include $(CLEAR_VARS)) \ 36 $(eval LOCAL_MODULE := $(word 1,$(tw))) \ 37 $(eval LOCAL_MODULE_TAGS := optional) \ 38 $(eval LOCAL_MODULE_CLASS := JAVA_LIBRARIES) \ 39 $(eval LOCAL_SRC_FILES := $(word 2,$(tw))) \ 40 $(eval LOCAL_UNINSTALLABLE_MODULE := true) \ 41 $(eval LOCAL_SDK_VERSION := current) \ 42 $(eval include $(BUILD_PREBUILT)) 43 endef 44 45 $(foreach p,$(prebuilts),\ 46 $(call define-prebuilt,$(p))) 47 48 prebuilts := 49 endif # TARGET_BUILD_APPS not empty or TARGET_BUILD_PDK set to True 50