forked from openkylin/platform_build
Check vndk list on build
Check current vndk list on build time with current.txt. If the vndk list is changed, the current.txt must be updated manually. Otherwise the build will report an error. The list is not allowed to be updated for the release versions. Bug: 77816590 Bug: 67002788 Test: run 'm check-vndk-list' and check if build is successful. Test: 1. change vndk property of a module and run 'm check-vndk-list' and check if build is failed. 2. run 'update-vndk-list.sh'. 3. run 'm check-vndk-list' again and check if build is successful. Change-Id: I4caeb9eafa898f175d40f96125b9997edaeadbeb Merged-In: I4caeb9eafa898f175d40f96125b9997edaeadbeb (cherry picked from commit 27caa055b9e53f65b9d0aec126e05dab32145717)
This commit is contained in:
parent
681cdaf454
commit
32e3453212
|
@ -21,26 +21,31 @@ $(INTERNAL_VNDK_LIB_LIST):
|
|||
# This is the up-to-date list of vndk libs.
|
||||
# TODO(b/62012285): the lib list should be stored somewhere under
|
||||
# /prebuilts/vndk
|
||||
ifeq (REL,$(PLATFORM_VERSION_CODENAME))
|
||||
LATEST_VNDK_LIB_LIST := $(LOCAL_PATH)/$(PLATFORM_VNDK_VERSION).txt
|
||||
ifeq ($(wildcard $(LATEST_VNDK_LIB_LIST)),)
|
||||
$(error $(LATEST_VNDK_LIB_LIST) file not found. Please copy "$(LOCAL_PATH)/current.txt" to "$(LATEST_VNDK_LIB_LIST)" and commit a CL for release branch)
|
||||
endif
|
||||
else
|
||||
LATEST_VNDK_LIB_LIST := $(LOCAL_PATH)/current.txt
|
||||
endif
|
||||
|
||||
#####################################################################
|
||||
# Check the generate list against the latest list stored in the
|
||||
# source tree
|
||||
.PHONY: check-vndk-list
|
||||
|
||||
ifeq (REL,$(PLATFORM_VERSION_CODENAME))
|
||||
# The check is enforced in release branches
|
||||
# Check if vndk list is changed
|
||||
droidcore: check-vndk-list
|
||||
endif
|
||||
|
||||
check-vndk-list-timestamp := $(call intermediates-dir-for,PACKAGING,vndk)/check-list-timestamp
|
||||
check-vndk-list: $(check-vndk-list-timestamp)
|
||||
|
||||
_vndk_check_failure_message := "VNDK library list has changed."
|
||||
ifeq (REL,$(PLATFORM_VERSION_CODENAME)
|
||||
_vndk_check_failure_message += "This isn't allowed in API locked branches."
|
||||
_vndk_check_failure_message := " error: VNDK library list has been changed.\n"
|
||||
ifeq (REL,$(PLATFORM_VERSION_CODENAME))
|
||||
_vndk_check_failure_message += " Changing the VNDK library list is not allowed in API locked branches."
|
||||
else
|
||||
_vndk_check_failure_message += "Run update-vndk-list.sh to update the list."
|
||||
_vndk_check_failure_message += " Run update-vndk-list.sh to update $(LATEST_VNDK_LIB_LIST)"
|
||||
endif
|
||||
|
||||
$(check-vndk-list-timestamp): $(INTERNAL_VNDK_LIB_LIST) $(LATEST_VNDK_LIB_LIST) $(HOST_OUT_EXECUTABLES)/update-vndk-list.sh
|
||||
|
@ -48,7 +53,7 @@ $(check-vndk-list-timestamp): $(INTERNAL_VNDK_LIB_LIST) $(LATEST_VNDK_LIB_LIST)
|
|||
--new-line-format="Added %L" \
|
||||
--unchanged-line-format="" \
|
||||
$(LATEST_VNDK_LIB_LIST) $(INTERNAL_VNDK_LIB_LIST) \
|
||||
|| ( echo $(_vndk_check_failure_message); exit 1 ))
|
||||
|| ( echo -e $(_vndk_check_failure_message); exit 1 ))
|
||||
$(hide) mkdir -p $(dir $@)
|
||||
$(hide) touch $@
|
||||
|
||||
|
@ -71,7 +76,12 @@ ifeq (REL,$(PLATFORM_VERSION_CODENAME))
|
|||
$(hide) echo "echo Updating VNDK library list is NOT allowed in API locked branches." >> $@; \
|
||||
echo "exit 1" >> $@
|
||||
else
|
||||
$(hide) echo "cp $(PRIVATE_INTERNAL_VNDK_LIB_LIST) $(PRIVATE_LATEST_VNDK_LIB_LIST)" >> $@; \
|
||||
$(hide) echo "if [ -z \"\$${ANDROID_BUILD_TOP}\" ]; then" >> $@; \
|
||||
echo " echo Run lunch or choosecombo first" >> $@; \
|
||||
echo " exit 1" >> $@; \
|
||||
echo "fi" >> $@; \
|
||||
echo "cd \$${ANDROID_BUILD_TOP}" >> $@; \
|
||||
echo "cp $(PRIVATE_INTERNAL_VNDK_LIB_LIST) $(PRIVATE_LATEST_VNDK_LIB_LIST)" >> $@; \
|
||||
echo "echo $(PRIVATE_LATEST_VNDK_LIB_LIST) updated." >> $@
|
||||
endif
|
||||
@chmod a+x $@
|
||||
|
|
Loading…
Reference in New Issue