Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae56a570 authored by Ying Wang's avatar Ying Wang Committed by Android Git Automerger
Browse files

am e1f94189: am ce811261: Merge "Move check-api to definition.mk" into jb-mr1.1-dev

* commit 'e1f94189':
  Move check-api to definition.mk
parents 234fa617 e1f94189
Loading
Loading
Loading
Loading
+23 −0
Original line number Original line Diff line number Diff line
@@ -2065,6 +2065,29 @@ $(if $(_erm_new_modules),$(eval $(1) += $(_erm_new_modules))\
  $(call expand-required-modules,$(1),$(_erm_new_modules)))
  $(call expand-required-modules,$(1),$(_erm_new_modules)))
endef
endef


###########################################################
## API Check
###########################################################

# eval this to define a rule that runs apicheck.
#
# Args:
#    $(1)  target
#    $(2)  stable api file
#    $(3)  api file to be tested
#    $(4)  arguments for apicheck
#    $(5)  command to run if apicheck failed
#    $(6)  target dependent on this api check
#    $(7)  additional dependencies
define check-api
$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp: $(2) $(3) $(APICHECK) $(7)
	@echo "Checking API:" $(1)
	$(hide) ( $(APICHECK_COMMAND) $(4) $(2) $(3) || ( $(5) ; exit 38 ) )
	$(hide) mkdir -p $$(dir $$@)
	$(hide) touch $$@
$(6): $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp
endef

###########################################################
###########################################################
## Other includes
## Other includes
###########################################################
###########################################################
+25 −35
Original line number Original line Diff line number Diff line
@@ -22,33 +22,19 @@ ifeq (,$(filter true, $(WITHOUT_CHECK_API) $(TARGET_BUILD_PDK)))


.PHONY: checkapi
.PHONY: checkapi


# eval this to define a rule that runs apicheck.
#
# Args:
#    $(1)  target
#    $(2)  stable api file
#    $(3)  api file to be tested
#    $(4)  arguments for apicheck
#    $(5)  command to run if apicheck failed
define check-api
$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp: $(2) $(3) $(APICHECK)
	@echo "Checking API:" $(1)
	$(hide) ( $(APICHECK_COMMAND) $(4) $(2) $(3) || ( $(5) ; exit 38 ) )
	$(hide) mkdir -p $$(dir $$@)
	$(hide) touch $$@
checkapi: $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp
endef

# Run the checkapi rules by default.
# Run the checkapi rules by default.
droidcore: checkapi
droidcore: checkapi


last_released_sdk_version := $(lastword $(call numerically_sort, \
last_released_sdk_version := $(lastword $(call numerically_sort, \
            $(filter-out $(SRC_API_DIR)/current, \
            $(filter-out current, \
                $(patsubst $(SRC_API_DIR)/%.txt,%, $(wildcard $(SRC_API_DIR)/*.txt)) \
                $(patsubst $(SRC_API_DIR)/%.txt,%, $(wildcard $(SRC_API_DIR)/*.txt)) \
             )\
             )\
        ))
        ))


# INTERNAL_PLATFORM_API_FILE is the one build by droiddoc.
# INTERNAL_PLATFORM_API_FILE is the one build by droiddoc.
# Note that since INTERNAL_PLATFORM_API_FILE is the byproduct of api-stubs module,
# (See frameworks/base/Android.mk)
# we need to add api-stubs as additional dependency of the api check.


# Check that the API we're building hasn't broken the last-released
# Check that the API we're building hasn't broken the last-released
# SDK version.
# SDK version.
@@ -59,7 +45,9 @@ $(eval $(call check-api, \
    -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 \
    -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 \
    -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
    -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
    -error 16 -error 17 -error 18 , \
    -error 16 -error 17 -error 18 , \
	cat $(BUILD_SYSTEM)/apicheck_msg_last.txt \
    cat $(BUILD_SYSTEM)/apicheck_msg_last.txt, \
    checkapi, \
    $(call doc-timestamp-for,api-stubs) \
    ))
    ))


# Check that the API we're building hasn't changed from the not-yet-released
# Check that the API we're building hasn't changed from the not-yet-released
@@ -72,7 +60,9 @@ $(eval $(call check-api, \
    -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
    -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
    -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
    -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
    -error 25 , \
    -error 25 , \
	cat $(BUILD_SYSTEM)/apicheck_msg_current.txt \
    cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \
    checkapi, \
    $(call doc-timestamp-for,api-stubs) \
    ))
    ))


.PHONY: update-api
.PHONY: update-api