summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2012-11-14 15:57:07 -0800
committerYing Wang <wangying@google.com>2012-11-14 16:00:45 -0800
commitc065da230762acd1cba7714827c2d588ab32a7fb (patch)
tree807ba1306e6a7d88fb3a4a070b69911d14b069fb /core
parent4e9b723f694b4713bdc30e8019b82b43b1217bae (diff)
downloadbuild-c065da230762acd1cba7714827c2d588ab32a7fb.zip
build-c065da230762acd1cba7714827c2d588ab32a7fb.tar.gz
build-c065da230762acd1cba7714827c2d588ab32a7fb.tar.bz2
Move check-api to definition.mk
1) Move check-api to definition.mk, so it can be used in other places. 2) Add additional dependency to the api-stub module to consolidate the apicheck dependency. Previously you have to run 2 "make"s in a row and only in the 2nd run apicheck is run, due to a gnu-make optimization. Bug: 7540265 Change-Id: Ib24ed87d9330027a9f95ed7b16dd4002cc0e3198
Diffstat (limited to 'core')
-rw-r--r--core/definitions.mk23
-rw-r--r--core/tasks/apicheck.mk60
2 files changed, 48 insertions, 35 deletions
diff --git a/core/definitions.mk b/core/definitions.mk
index 06db960..4f4e583 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2064,6 +2064,29 @@ $(if $(_erm_new_modules),$(eval $(1) += $(_erm_new_modules))\
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
###########################################################
diff --git a/core/tasks/apicheck.mk b/core/tasks/apicheck.mk
index 8d9928e..2c1300b 100644
--- a/core/tasks/apicheck.mk
+++ b/core/tasks/apicheck.mk
@@ -22,58 +22,48 @@ ifeq (,$(filter true, $(BUILD_TINY_ANDROID) $(TARGET_BUILD_PDK)))
.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.
droidcore: checkapi
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)) \
)\
))
# 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
# SDK version.
$(eval $(call check-api, \
- checkapi-last, \
- $(SRC_API_DIR)/$(last_released_sdk_version).txt, \
- $(INTERNAL_PLATFORM_API_FILE), \
- -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 16 -error 17 -error 18 , \
- cat $(BUILD_SYSTEM)/apicheck_msg_last.txt \
- ))
+ checkapi-last, \
+ $(SRC_API_DIR)/$(last_released_sdk_version).txt, \
+ $(INTERNAL_PLATFORM_API_FILE), \
+ -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 16 -error 17 -error 18 , \
+ 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
# SDK version.
$(eval $(call check-api, \
- checkapi-current, \
- $(SRC_API_DIR)/current.txt, \
- $(INTERNAL_PLATFORM_API_FILE), \
- -error 2 -error 3 -error 4 -error 5 -error 6 \
- -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 25 , \
- cat $(BUILD_SYSTEM)/apicheck_msg_current.txt \
- ))
+ checkapi-current, \
+ $(SRC_API_DIR)/current.txt, \
+ $(INTERNAL_PLATFORM_API_FILE), \
+ -error 2 -error 3 -error 4 -error 5 -error 6 \
+ -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 25 , \
+ cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \
+ checkapi, \
+ $(call doc-timestamp-for,api-stubs) \
+ ))
.PHONY: update-api
update-api: $(INTERNAL_PLATFORM_API_FILE) | $(ACP)