Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fe94592 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Append built and installed when copying metadata."

parents 08a46cda 04fbe296
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -2976,6 +2976,19 @@ $(2): $(1)
	$$(copy-file-to-target)
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
$(2): $(1) $(ZIPALIGN) $(ZIP2ZIP)
	@echo "Uncompress dexs in: $$@"
@@ -3163,6 +3176,17 @@ $(hide) rm -f $@
$(hide) cp "$<" "$@"
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
# cp command instead of acp.
define copy-file-to-target-with-cp
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ ifdef my_register_name

  ifdef LOCAL_SOONG_LICENSE_METADATA
    # 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
    # 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.