Merge "Package jacoco and proguard files out of a PACKAGING directory"
This commit is contained in:
commit
df682c6fe1
6 changed files with 97 additions and 23 deletions
|
@ -5353,10 +5353,18 @@ ifeq (true,$(EMMA_INSTRUMENT))
|
||||||
# Any dependencies are set up later in build/make/core/main.mk.
|
# Any dependencies are set up later in build/make/core/main.mk.
|
||||||
|
|
||||||
JACOCO_REPORT_CLASSES_ALL := $(PRODUCT_OUT)/jacoco-report-classes-all.jar
|
JACOCO_REPORT_CLASSES_ALL := $(PRODUCT_OUT)/jacoco-report-classes-all.jar
|
||||||
|
$(JACOCO_REPORT_CLASSES_ALL): PRIVATE_TARGET_JACOCO_DIR := $(call intermediates-dir-for,PACKAGING,jacoco)
|
||||||
|
$(JACOCO_REPORT_CLASSES_ALL): PRIVATE_HOST_JACOCO_DIR := $(call intermediates-dir-for,PACKAGING,jacoco,HOST)
|
||||||
|
$(JACOCO_REPORT_CLASSES_ALL): PRIVATE_TARGET_PROGUARD_USAGE_DIR := $(call intermediates-dir-for,PACKAGING,proguard_usage)
|
||||||
|
$(JACOCO_REPORT_CLASSES_ALL): PRIVATE_HOST_PROGUARD_USAGE_DIR := $(call intermediates-dir-for,PACKAGING,proguard_usage,HOST)
|
||||||
$(JACOCO_REPORT_CLASSES_ALL) :
|
$(JACOCO_REPORT_CLASSES_ALL) :
|
||||||
@echo "Collecting uninstrumented classes"
|
@echo "Collecting uninstrumented classes"
|
||||||
find $(TARGET_COMMON_OUT_ROOT) $(HOST_COMMON_OUT_ROOT) -name "jacoco-report-classes.jar" -o -name "proguard_usage.zip" 2>/dev/null | sort > $@.list
|
mkdir -p $(PRIVATE_TARGET_JACOCO_DIR) $(PRIVATE_HOST_JACOCO_DIR) $(PRIVATE_TARGET_PROGUARD_USAGE_DIR) $(PRIVATE_HOST_PROGUARD_USAGE_DIR)
|
||||||
$(SOONG_ZIP) -o $@ -L 0 -C $(OUT_DIR) -P out -l $@.list
|
$(SOONG_ZIP) -o $@ -L 0 \
|
||||||
|
-C $(PRIVATE_TARGET_JACOCO_DIR) -P out/target/common/obj -D $(PRIVATE_TARGET_JACOCO_DIR) \
|
||||||
|
-C $(PRIVATE_HOST_JACOCO_DIR) -P out/target/common/obj -D $(PRIVATE_HOST_JACOCO_DIR) \
|
||||||
|
-C $(PRIVATE_TARGET_PROGUARD_USAGE_DIR) -P out/target/common/obj -D $(PRIVATE_TARGET_PROGUARD_USAGE_DIR) \
|
||||||
|
-C $(PRIVATE_HOST_PROGUARD_USAGE_DIR) -P out/target/common/obj -D $(PRIVATE_HOST_PROGUARD_USAGE_DIR)
|
||||||
|
|
||||||
ifeq (,$(TARGET_BUILD_UNBUNDLED))
|
ifeq (,$(TARGET_BUILD_UNBUNDLED))
|
||||||
$(JACOCO_REPORT_CLASSES_ALL): $(INTERNAL_ALLIMAGES_FILES)
|
$(JACOCO_REPORT_CLASSES_ALL): $(INTERNAL_ALLIMAGES_FILES)
|
||||||
|
@ -5372,13 +5380,11 @@ PROGUARD_DICT_ZIP := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-proguard-dict-$(FILE_NAME_
|
||||||
ifeq (,$(TARGET_BUILD_UNBUNDLED))
|
ifeq (,$(TARGET_BUILD_UNBUNDLED))
|
||||||
$(PROGUARD_DICT_ZIP): $(INTERNAL_ALLIMAGES_FILES) $(updater_dep)
|
$(PROGUARD_DICT_ZIP): $(INTERNAL_ALLIMAGES_FILES) $(updater_dep)
|
||||||
endif
|
endif
|
||||||
$(PROGUARD_DICT_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,proguard)/filelist
|
$(PROGUARD_DICT_ZIP): PRIVATE_PACKAGING_DIR := $(call intermediates-dir-for,PACKAGING,proguard_dictionary)
|
||||||
$(PROGUARD_DICT_ZIP): $(SOONG_ZIP)
|
$(PROGUARD_DICT_ZIP): $(SOONG_ZIP)
|
||||||
@echo "Packaging Proguard obfuscation dictionary files."
|
@echo "Packaging Proguard obfuscation dictionary files."
|
||||||
mkdir -p $(dir $@) $(TARGET_OUT_COMMON_INTERMEDIATES)/APPS $(dir $(PRIVATE_LIST_FILE))
|
mkdir -p $(dir $@) $(PRIVATE_PACKAGING_DIR)
|
||||||
find $(TARGET_OUT_COMMON_INTERMEDIATES)/APPS -name proguard_dictionary | \
|
$(SOONG_ZIP) --ignore_missing_files -d -o $@ -C $(PRIVATE_PACKAGING_DIR) -P out/target/common/obj -D $(PRIVATE_PACKAGING_DIR)
|
||||||
sed -e 's/\(.*\)\/proguard_dictionary/\0\n\1\/classes.jar/' > $(PRIVATE_LIST_FILE)
|
|
||||||
$(SOONG_ZIP) --ignore_missing_files -d -o $@ -C $(OUT_DIR)/.. -l $(PRIVATE_LIST_FILE)
|
|
||||||
|
|
||||||
#------------------------------------------------------------------
|
#------------------------------------------------------------------
|
||||||
# A zip of Proguard usage files.
|
# A zip of Proguard usage files.
|
||||||
|
@ -5399,11 +5405,12 @@ $(PROGUARD_USAGE_ZIP): \
|
||||||
$(INSTALLED_ODM_DLKMIMAGE_TARGET) \
|
$(INSTALLED_ODM_DLKMIMAGE_TARGET) \
|
||||||
$(updater_dep)
|
$(updater_dep)
|
||||||
endif
|
endif
|
||||||
$(PROGUARD_USAGE_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,proguard_usage)/filelist
|
$(PROGUARD_USAGE_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,proguard_usage.zip)/filelist
|
||||||
|
$(PROGUARD_USAGE_ZIP): PRIVATE_PACKAGING_DIR := $(call intermediates-dir-for,PACKAGING,proguard_usage)
|
||||||
$(PROGUARD_USAGE_ZIP): $(MERGE_ZIPS)
|
$(PROGUARD_USAGE_ZIP): $(MERGE_ZIPS)
|
||||||
@echo "Packaging Proguard usage files."
|
@echo "Packaging Proguard usage files."
|
||||||
mkdir -p $(dir $@) $(TARGET_OUT_COMMON_INTERMEDIATES)/APPS $(dir $(PRIVATE_LIST_FILE))
|
mkdir -p $(dir $@) $(PRIVATE_PACKAGING_DIR) $(dir $(PRIVATE_LIST_FILE))
|
||||||
find $(TARGET_OUT_COMMON_INTERMEDIATES)/APPS -name proguard_usage.zip > $(PRIVATE_LIST_FILE)
|
find $(PRIVATE_PACKAGING_DIR) -name proguard_usage.zip > $(PRIVATE_LIST_FILE)
|
||||||
$(MERGE_ZIPS) $@ @$(PRIVATE_LIST_FILE)
|
$(MERGE_ZIPS) $@ @$(PRIVATE_LIST_FILE)
|
||||||
|
|
||||||
ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS))
|
ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS))
|
||||||
|
|
|
@ -744,6 +744,42 @@ $(strip \
|
||||||
)
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
## The packaging directory for a module. Similar to intermedates, but
|
||||||
|
## in a location that will be wiped by an m installclean.
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
# $(1): subdir in PACKAGING
|
||||||
|
# $(2): target class, like "APPS"
|
||||||
|
# $(3): target name, like "NotePad"
|
||||||
|
# $(4): { HOST, HOST_CROSS, <empty (TARGET)>, <other non-empty (HOST)> }
|
||||||
|
define packaging-dir-for
|
||||||
|
$(strip \
|
||||||
|
$(eval _pdfClass := $(strip $(2))) \
|
||||||
|
$(if $(_pdfClass),, \
|
||||||
|
$(error $(LOCAL_PATH): Class not defined in call to generated-sources-dir-for)) \
|
||||||
|
$(eval _pdfName := $(strip $(3))) \
|
||||||
|
$(if $(_pdfName),, \
|
||||||
|
$(error $(LOCAL_PATH): Name not defined in call to generated-sources-dir-for)) \
|
||||||
|
$(call intermediates-dir-for,PACKAGING,$(1),$(4))/$(_pdfClass)/$(_pdfName)_intermediates \
|
||||||
|
)
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Uses LOCAL_MODULE_CLASS, LOCAL_MODULE, and LOCAL_IS_HOST_MODULE
|
||||||
|
# to determine the packaging directory.
|
||||||
|
#
|
||||||
|
# $(1): subdir in PACKAGING
|
||||||
|
define local-packaging-dir
|
||||||
|
$(strip \
|
||||||
|
$(if $(strip $(LOCAL_MODULE_CLASS)),, \
|
||||||
|
$(error $(LOCAL_PATH): LOCAL_MODULE_CLASS not defined before call to local-generated-sources-dir)) \
|
||||||
|
$(if $(strip $(LOCAL_MODULE)),, \
|
||||||
|
$(error $(LOCAL_PATH): LOCAL_MODULE not defined before call to local-generated-sources-dir)) \
|
||||||
|
$(call packaging-dir-for,$(1),$(LOCAL_MODULE_CLASS),$(LOCAL_MODULE),$(if $(strip $(LOCAL_IS_HOST_MODULE)),HOST)) \
|
||||||
|
)
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
## Convert a list of short module names (e.g., "framework", "Browser")
|
## Convert a list of short module names (e.g., "framework", "Browser")
|
||||||
## into the list of files that are built for those modules.
|
## into the list of files that are built for those modules.
|
||||||
|
|
|
@ -71,7 +71,11 @@ $(my_classes_to_report_on_path): $(my_unzipped_timestamp_path)
|
||||||
zip -q $@ \
|
zip -q $@ \
|
||||||
-r $(PRIVATE_UNZIPPED_PATH)
|
-r $(PRIVATE_UNZIPPED_PATH)
|
||||||
|
|
||||||
|
# Make a rule to copy the jacoco-report-classes.jar to a packaging directory.
|
||||||
|
$(eval $(call copy-one-file,$(my_classes_to_report_on_path),\
|
||||||
|
$(call local-packaging-dir,jacoco)/jacoco-report-classes.jar))
|
||||||
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
||||||
|
$(call local-packaging-dir,jacoco)/jacoco-report-classes.jar)
|
||||||
|
|
||||||
# make a task that invokes instrumentation
|
# make a task that invokes instrumentation
|
||||||
my_instrumented_path := $(my_files)/work/instrumented/classes
|
my_instrumented_path := $(my_files)/work/instrumented/classes
|
||||||
|
|
11
core/java.mk
11
core/java.mk
|
@ -470,6 +470,17 @@ endif
|
||||||
|
|
||||||
ifneq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),)
|
ifneq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),)
|
||||||
$(built_dex_intermediate): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary) $(proguard_configuration)
|
$(built_dex_intermediate): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary) $(proguard_configuration)
|
||||||
|
|
||||||
|
# Make a rule to copy the proguard_dictionary to a packaging directory.
|
||||||
|
$(eval $(call copy-one-file,$(proguard_dictionary),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/proguard_dictionary))
|
||||||
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/proguard_dictionary)
|
||||||
|
|
||||||
|
$(eval $(call copy-one-file,$(full_classes_pre_proguard_jar),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/classes.jar))
|
||||||
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/classes.jar)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif # LOCAL_PROGUARD_ENABLED defined
|
endif # LOCAL_PROGUARD_ENABLED defined
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# LOCAL_SOONG_HEADER_JAR
|
# LOCAL_SOONG_HEADER_JAR
|
||||||
# LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
|
# LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
|
||||||
# LOCAL_SOONG_PROGUARD_DICT
|
# LOCAL_SOONG_PROGUARD_DICT
|
||||||
# LOCAL_SOONG_PROGUARD_USAGE
|
# LOCAL_SOONG_PROGUARD_USAGE_ZIP
|
||||||
# LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
|
# LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
|
||||||
# LOCAL_SOONG_RRO_DIRS
|
# LOCAL_SOONG_RRO_DIRS
|
||||||
# LOCAL_SOONG_JNI_LIBS_$(TARGET_ARCH)
|
# LOCAL_SOONG_JNI_LIBS_$(TARGET_ARCH)
|
||||||
|
@ -74,23 +74,31 @@ endif
|
||||||
|
|
||||||
ifdef LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
|
ifdef LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
|
||||||
$(eval $(call copy-one-file,$(LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR),\
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR),\
|
||||||
$(intermediates.COMMON)/jacoco-report-classes.jar))
|
$(call local-packaging-dir,jacoco)/jacoco-report-classes.jar))
|
||||||
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
||||||
$(intermediates.COMMON)/jacoco-report-classes.jar)
|
$(call local-packaging-dir,jacoco)/jacoco-report-classes.jar)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef LOCAL_SOONG_PROGUARD_DICT
|
ifdef LOCAL_SOONG_PROGUARD_DICT
|
||||||
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_DICT),\
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_DICT),\
|
||||||
$(intermediates.COMMON)/proguard_dictionary))
|
$(intermediates.COMMON)/proguard_dictionary))
|
||||||
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_DICT),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/proguard_dictionary))
|
||||||
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_CLASSES_JAR),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/classes.jar))
|
||||||
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
||||||
$(intermediates.COMMON)/proguard_dictionary)
|
$(intermediates.COMMON)/proguard_dictionary)
|
||||||
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/proguard_dictionary)
|
||||||
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/classes.jar)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef LOCAL_SOONG_PROGUARD_USAGE_ZIP
|
ifdef LOCAL_SOONG_PROGUARD_USAGE_ZIP
|
||||||
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_USAGE_ZIP),\
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_USAGE_ZIP),\
|
||||||
$(intermediates.COMMON)/proguard_usage.zip))
|
$(call local-packaging-dir,proguard_usage)/proguard_usage.zip))
|
||||||
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
||||||
$(intermediates.COMMON)/proguard_usage.zip)
|
$(call local-packaging-dir,proguard_usage)/proguard_usage.zip)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
|
ifdef LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
|
||||||
|
|
|
@ -47,23 +47,31 @@ $(eval $(call copy-one-file,$(LOCAL_PREBUILT_MODULE_FILE),$(LOCAL_BUILT_MODULE))
|
||||||
|
|
||||||
ifdef LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
|
ifdef LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
|
||||||
$(eval $(call copy-one-file,$(LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR),\
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR),\
|
||||||
$(intermediates.COMMON)/jacoco-report-classes.jar))
|
$(call local-packaging-dir,jacoco)/jacoco-report-classes.jar))
|
||||||
$(call add-dependency,$(common_javalib.jar),\
|
$(call add-dependency,$(common_javalib.jar),\
|
||||||
$(intermediates.COMMON)/jacoco-report-classes.jar)
|
$(call local-packaging-dir,jacoco)/jacoco-report-classes.jar)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef LOCAL_SOONG_PROGUARD_DICT
|
ifdef LOCAL_SOONG_PROGUARD_DICT
|
||||||
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_DICT),\
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_DICT),\
|
||||||
$(intermediates.COMMON)/proguard_dictionary))
|
$(intermediates.COMMON)/proguard_dictionary))
|
||||||
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_DICT),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/proguard_dictionary))
|
||||||
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_CLASSES_JAR),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/classes.jar))
|
||||||
|
$(call add-dependency,$(common_javalib.jar),\
|
||||||
$(intermediates.COMMON)/proguard_dictionary)
|
$(intermediates.COMMON)/proguard_dictionary)
|
||||||
|
$(call add-dependency,$(common_javalib.jar),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/proguard_dictionary)
|
||||||
|
$(call add-dependency,$(common_javalib.jar),\
|
||||||
|
$(call local-packaging-dir,proguard_dictionary)/classes.jar)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef LOCAL_SOONG_PROGUARD_USAGE
|
ifdef LOCAL_SOONG_PROGUARD_USAGE_ZIP
|
||||||
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_USAGE_ZIP),\
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_USAGE_ZIP),\
|
||||||
$(intermediates.COMMON)/proguard_usage.zip))
|
$(call local-packaging-dir,proguard_usage)/proguard_usage.zip))
|
||||||
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
$(call add-dependency,$(common_javalib.jar),\
|
||||||
$(intermediates.COMMON)/proguard_usage.zip)
|
$(call local-packaging-dir,proguard_usage)/proguard_usage.zip)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue