From bc415dd5eb2a135cbc24c21760338e6294c7a0d3 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Wed, 15 Aug 2012 12:22:44 -0700 Subject: [PATCH] Support to build emmap_mata.zip in unbundled builds. Bug: 6987838 Change-Id: Id6c81b08c4859442b7d52054ed5f278575719d1a --- core/Makefile | 6 +++++- core/main.mk | 21 ++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/core/Makefile b/core/Makefile index 2a214c6ae..4dde9f49e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1287,12 +1287,16 @@ $(APPS_ZIP): $(INSTALLED_SYSTEMIMAGE) # A zip of emma code coverage meta files. Generated for fully emma # instrumented build. # +ifeq (true,$(EMMA_INSTRUMENT)) EMMA_META_ZIP := $(PRODUCT_OUT)/emma_meta.zip -$(EMMA_META_ZIP): $(INSTALLED_SYSTEMIMAGE) +# the dependency will be set up later in build/core/main.mk. +$(EMMA_META_ZIP) : @echo "Collecting Emma coverage meta files." $(hide) find $(TARGET_COMMON_OUT_ROOT) -name "coverage.em" | \ zip -@ -q $@ +endif # EMMA_INSTRUMENT=true + # ----------------------------------------------------------------- # dalvik something .PHONY: dalvikfiles diff --git a/core/main.mk b/core/main.mk index 64be9ff82..49367ec6a 100644 --- a/core/main.mk +++ b/core/main.mk @@ -780,10 +780,6 @@ droidcore: files \ # dist_files only for putting your library into the dist directory with a full build. .PHONY: dist_files -ifeq ($(EMMA_INSTRUMENT),true) - $(call dist-for-goals, dist_files, $(EMMA_META_ZIP)) -endif - # Dist for droid if droid is among the cmd goals, or no cmd goal is given. ifneq ($(filter droid,$(MAKECMDGOALS))$(filter ||,|$(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))|),) @@ -798,10 +794,15 @@ ifneq ($(TARGET_BUILD_APPS),) unbundled_build_modules := $(TARGET_BUILD_APPS) endif + apps_only_installed_files := $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) # dist the unbundled app. - $(call dist-for-goals,apps_only, \ - $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) \ - ) + $(call dist-for-goals,apps_only, $(apps_only_installed_files)) + + ifeq ($(EMMA_INSTRUMENT),true) + $(EMMA_META_ZIP) : $(apps_only_installed_files) + + $(call dist-for-goals,apps_only, $(EMMA_META_ZIP)) + endif .PHONY: apps_only apps_only: $(unbundled_build_modules) @@ -830,6 +831,12 @@ else # TARGET_BUILD_APPS ) endif + ifeq ($(EMMA_INSTRUMENT),true) + $(EMMA_META_ZIP) : $(INSTALLED_SYSTEMIMAGE) + + $(call dist-for-goals, dist_files, $(EMMA_META_ZIP)) + endif + # Building a full system-- the default is to build droidcore droid: droidcore dist_files -- 2.11.0