Merge "Add support for LOCAL_PRIVATE_PLATFORM_APIS."

This commit is contained in:
hansson 2018-02-22 11:33:57 +00:00 committed by Gerrit Code Review
commit 3c76d02668
4 changed files with 19 additions and 0 deletions

View File

@ -196,6 +196,7 @@ LOCAL_PREBUILT_MODULE_FILE:=
LOCAL_PREBUILT_OBJ_FILES:=
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES:=
LOCAL_PREBUILT_STRIP_COMMENTS:=
LOCAL_PRIVATE_PLATFORM_APIS:=
LOCAL_PRIVILEGED_MODULE:=
# '',full,custom,disabled,obfuscation,optimization
LOCAL_PRODUCT_MODULE:=

View File

@ -67,6 +67,8 @@ all_java_sources := $(java_sources)
include $(BUILD_SYSTEM)/java_common.mk
include $(BUILD_SYSTEM)/sdk_check.mk
$(cleantarget): PRIVATE_CLEAN_FILES += $(intermediates.COMMON)
# List of dependencies for anything that needs all java sources in place

View File

@ -357,6 +357,8 @@ endif # TURBINE_ENABLED != false
include $(BUILD_SYSTEM)/java_common.mk
include $(BUILD_SYSTEM)/sdk_check.mk
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_HAS_RS_SOURCES := $(if $(renderscript_sources),true)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RS_SOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/renderscript

14
core/sdk_check.mk Normal file
View File

@ -0,0 +1,14 @@
# Enforcement checks that LOCAL_SDK_VERSION and LOCAL_PRIVATE_PLATFORM_APIS are
# set correctly.
# Should be included by java targets that allow specifying LOCAL_SDK_VERSION.
ifeq ($(LOCAL_SDK_VERSION)$(LOCAL_PRIVATE_PLATFORM_APIS),)
ifneq ($(JAVA_SDK_ENFORCEMENT_WARNING),)
$(warning Java modules must specify LOCAL_SDK_VERSION or LOCAL_PRIVATE_PLATFORM_APIS, but $(LOCAL_MODULE) specifies neither.)
endif
else ifneq ($(LOCAL_SDK_VERSION),)
ifneq ($(LOCAL_PRIVATE_PLATFORM_APIS),)
$(error $(LOCAL_MODULE) specifies both LOCAL_SDK_VERSION ($(LOCAL_SDK_VERSION)) and LOCAL_PRIVATE_PLATFORM_APIS ($(LOCAL_PRIVATE_PLATFORM_APIS)), but should specify only one.)
endif
endif