Umbrella build targets to help engineers verify build

With this change, by choosing the right build target, you can reduce
significant verification build time:
If you are working on the framework, "make target-java" sounds enough;
if you are working on native target code, "make target-native" saves
your time by not building the Java code.
This will help reduce uncaught breakges for by default not everything
is built now.

Change-Id: I5a7c82d3f6372db03bea76155c8d6cc63d988eae
This commit is contained in:
Ying Wang 2013-01-29 16:59:18 -08:00
parent 9e6f863b02
commit ef4d82f283
2 changed files with 45 additions and 0 deletions

View File

@ -592,6 +592,36 @@ $(foreach tag,$(LOCAL_MODULE_TAGS),\
$(foreach tag,$(LOCAL_MODULE_TAGS),\
$(eval ALL_MODULE_NAME_TAGS.$(tag) += $(LOCAL_MODULE)))
###########################################################
## umbrella targets used to verify builds
###########################################################
check_build_target := $(LOCAL_CHECKED_MODULE)
j_or_n :=
ifneq (,$(filter EXECUTABLES SHARED_LIBRARIES STATIC_LIBRARIES,$(LOCAL_MODULE_CLASS)))
j_or_n := native
else
ifneq (,$(filter JAVA_LIBRARIES APPS,$(LOCAL_MODULE_CLASS)))
j_or_n := java
# We don't want to verify the jni code when you just want to check the Java code.
# See LOCAL_CHECKED_MODULE in build/core/java.mk
ifneq (,$(strip $(all_java_sources)$(full_static_java_libs))$(filter true,$(LOCAL_SOURCE_FILES_ALL_GENERATED)))
check_build_target := $(full_classes_compiled_jar)
endif
endif
endif
ifdef LOCAL_IS_HOST_MODULE
h_or_t := host
else
h_or_t := target
endif
ifdef j_or_n
$(j_or_n) $(j_or_n)-$(h_or_t) : $(check_build_target)
ifneq (,$(filter $(LOCAL_MODULE_TAGS),tests))
$(j_or_n)-$(h_or_t)-tests $(j_or_n)-tests $(h_or_t)-tests : $(check_build_target)
endif
endif
###########################################################
## NOTICE files
###########################################################

View File

@ -822,6 +822,21 @@ $(call dist-for-goals,sdk win_sdk, \
)
endif
# umbrella targets to assit engineers in verifying builds
.PHONY: java native java-host java-target native-host native-target \
java-host-tests java-target-tests native-host-tests native-target-tests \
java-tests native-tests host-tests target-tests
# some synonyms
.PHONY: host-java target-java host-native target-native \
target-java-tests target-native-tests
host-java : java-host
target-java : java-target
host-native : native-host
target-native : native-target
target-java-tests : java-target-tests
target-native-tests : native-target-tests
.PHONY: lintall
.PHONY: samplecode