Merge "Append built and installed when copying metadata."
This commit is contained in:
@@ -2976,6 +2976,19 @@ $(2): $(1)
|
|||||||
$$(copy-file-to-target)
|
$$(copy-file-to-target)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Define a rule to copy a license metadata file. For use via $(eval).
|
||||||
|
# $(1): source license metadata file
|
||||||
|
# $(2): destination license metadata file
|
||||||
|
# $(3): built targets
|
||||||
|
# $(4): installed targets
|
||||||
|
define copy-one-license-metadata-file
|
||||||
|
$(2): PRIVATE_BUILT=$(3)
|
||||||
|
$(2): PRIVATE_INSTALLED=$(4)
|
||||||
|
$(2): $(1)
|
||||||
|
@echo "Copy: $$@"
|
||||||
|
$$(call copy-license-metadata-file-to-target,$$(PRIVATE_BUILT),$$(PRIVATE_INSTALLED))
|
||||||
|
endef
|
||||||
|
|
||||||
define copy-and-uncompress-dexs
|
define copy-and-uncompress-dexs
|
||||||
$(2): $(1) $(ZIPALIGN) $(ZIP2ZIP)
|
$(2): $(1) $(ZIPALIGN) $(ZIP2ZIP)
|
||||||
@echo "Uncompress dexs in: $$@"
|
@echo "Uncompress dexs in: $$@"
|
||||||
@@ -3163,6 +3176,17 @@ $(hide) rm -f $@
|
|||||||
$(hide) cp "$<" "$@"
|
$(hide) cp "$<" "$@"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Same as copy-file-to-target, but assume file is a licenes metadata file,
|
||||||
|
# and append built from $(1) and installed from $(2).
|
||||||
|
define copy-license-metadata-file-to-target
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
$(hide) rm -f $@
|
||||||
|
$(hide) cp "$<" "$@" $(strip \
|
||||||
|
$(foreach b,$(1), && (grep -F 'built: "'"$(b)"'"' "$@" >/dev/null || echo 'built: "'"$(b)"'"' >>"$@")) \
|
||||||
|
$(foreach i,$(2), && (grep -F 'installed: "'"$(i)"'"' "$@" >/dev/null || echo 'installed: "'"$(i)"'"' >>"$@")) \
|
||||||
|
)
|
||||||
|
endef
|
||||||
|
|
||||||
# The same as copy-file-to-target, but use the local
|
# The same as copy-file-to-target, but use the local
|
||||||
# cp command instead of acp.
|
# cp command instead of acp.
|
||||||
define copy-file-to-target-with-cp
|
define copy-file-to-target-with-cp
|
||||||
|
@@ -135,7 +135,7 @@ ifdef my_register_name
|
|||||||
|
|
||||||
ifdef LOCAL_SOONG_LICENSE_METADATA
|
ifdef LOCAL_SOONG_LICENSE_METADATA
|
||||||
# Soong modules have already produced a license metadata file, copy it to where Make expects it.
|
# Soong modules have already produced a license metadata file, copy it to where Make expects it.
|
||||||
$(eval $(call copy-one-file, $(LOCAL_SOONG_LICENSE_METADATA), $(module_license_metadata)))
|
$(eval $(call copy-one-license-metadata-file, $(LOCAL_SOONG_LICENSE_METADATA), $(module_license_metadata),$(ALL_MODULES.$(my_register_name).BUILT),$(ALL_MODUES.$(my_register_name).INSTALLED)))
|
||||||
else
|
else
|
||||||
# Make modules don't have enough information to produce a license metadata rule until after fix-notice-deps
|
# Make modules don't have enough information to produce a license metadata rule until after fix-notice-deps
|
||||||
# has been called, store the necessary information until later.
|
# has been called, store the necessary information until later.
|
||||||
|
Reference in New Issue
Block a user