collect emm meta files for emma instrumented build
when doing 'make dist', with EMMA_INSTRUMENT on the coverage.em files
generated for each module will be collected into one emma_meta.zip file
Change-Id: I382c39a97005e6cae5c79ad7eaef1c8857f658af
diff --git a/core/Makefile b/core/Makefile
index 361d190..78d1c32 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1064,6 +1064,17 @@
$(hide) mkdir -p $(dir $@)
$(hide) zip -qj $@ $(TARGET_OUT_APPS)/*
+
+#------------------------------------------------------------------
+# A zip of emma code coverage meta files. Generated for fully emma
+# instrumented build.
+#
+EMMA_META_ZIP := $(PRODUCT_OUT)/emma_meta.zip
+$(EMMA_META_ZIP): $(INSTALLED_SYSTEMIMAGE)
+ @echo "Collecting Emma coverage meta files."
+ $(hide) find $(TARGET_COMMON_OUT_ROOT) -name "coverage.em" | \
+ zip -@ -q $@
+
endif # TARGET_SIMULATOR != true
# -----------------------------------------------------------------
diff --git a/core/main.mk b/core/main.mk
index 3ffb084..1fd546e 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -705,6 +705,12 @@
$(INSTALLED_RAMDISK_TARGET) \
)
+ifeq ($(EMMA_INSTRUMENT),true)
+$(call dist-for-goals, droid, \
+ $(EMMA_META_ZIP) \
+ )
+endif
+
# Tests are installed in userdata.img. If we're building the tests
# variant, copy it for "make tests dist". Also copy a zip of the
# contents of userdata.img, so that people can easily extract a