Refactor removing classes.dex for dexpreopt
Combining $(call dexpreopt-remove-classes.dex) into a
$(call copy-one-file) rule is hacky and error prone. Make a helper
dexpreopt-copy-jar function that takes LOCAL_DEX_PREOPT and copies
the jar, removing the dex files if necessary.
Test: only description message changes to out/build-${TARGET_PRODUCT}.ninja
Change-Id: Id2fa2d18571ca01bc81302c912b8de25f3dde7a1
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index f515230..d112e86 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -430,11 +430,7 @@
@echo "Dexpreopt Jar: $(PRIVATE_MODULE) ($@)"
$(call dexpreopt-one-file,$<,$@)
-$(built_module) : $(my_prebuilt_src_file)
- $(call copy-file-to-target)
-ifneq (nostripping,$(LOCAL_DEX_PREOPT))
- $(call dexpreopt-remove-classes.dex,$@)
-endif
+$(eval $(call dexpreopt-copy-jar,$(my_prebuilt_src_file),$(built_module),$(LOCAL_DEX_PREOPT)))
endif # boot jar
else # ! LOCAL_DEX_PREOPT
$(built_module) : $(my_prebuilt_src_file)