From ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Tue, 29 Jan 2013 16:59:18 -0800 Subject: [PATCH] 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 --- core/base_rules.mk | 30 ++++++++++++++++++++++++++++++ core/main.mk | 15 +++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/core/base_rules.mk b/core/base_rules.mk index e69f73f23..92cf58c22 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -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 ########################################################### diff --git a/core/main.mk b/core/main.mk index 61c041fce..2960b65ac 100644 --- a/core/main.mk +++ b/core/main.mk @@ -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