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

Commit 00a0933a authored by Colin Cross's avatar Colin Cross Committed by Gerrit Code Review
Browse files

Merge "Don't store notice files for Soong modules" into main

parents 970bf093 acd61f92
Loading
Loading
Loading
Loading
+28 −27
Original line number Original line Diff line number Diff line
@@ -2,6 +2,25 @@
## Track NOTICE files
## Track NOTICE files
###########################################################
###########################################################


module_license_metadata := $(call local-meta-intermediates-dir)/$(my_register_name).meta_lic

$(foreach target,$(ALL_MODULES.$(my_register_name).BUILT) $(ALL_MODULES.$(my_register_name).INSTALLED) $(foreach bi,$(LOCAL_SOONG_BUILT_INSTALLED),$(call word-colon,1,$(bi))),\
  $(eval ALL_TARGETS.$(target).META_LIC := $(module_license_metadata)))

$(foreach f,$(my_test_data) $(my_test_config),\
  $(if $(strip $(ALL_TARGETS.$(call word-colon,1,$(f)).META_LIC)), \
    $(call declare-copy-target-license-metadata,$(call word-colon,2,$(f)),$(call word-colon,1,$(f))), \
    $(eval ALL_TARGETS.$(call word-colon,2,$(f)).META_LIC := $(module_license_metadata))))

ALL_MODULES.$(my_register_name).META_LIC := $(strip $(ALL_MODULES.$(my_register_name).META_LIC) $(module_license_metadata))

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-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.

  ifneq ($(LOCAL_NOTICE_FILE),)
  ifneq ($(LOCAL_NOTICE_FILE),)
    notice_file:=$(strip $(LOCAL_NOTICE_FILE))
    notice_file:=$(strip $(LOCAL_NOTICE_FILE))
  else
  else
@@ -26,25 +45,6 @@ ifdef LOCAL_NO_NOTICE_FILE
    notice_file :=
    notice_file :=
  endif
  endif


module_license_metadata := $(call local-meta-intermediates-dir)/$(my_register_name).meta_lic

$(foreach target,$(ALL_MODULES.$(my_register_name).BUILT) $(ALL_MODULES.$(my_register_name).INSTALLED) $(foreach bi,$(LOCAL_SOONG_BUILT_INSTALLED),$(call word-colon,1,$(bi))),\
  $(eval ALL_TARGETS.$(target).META_LIC := $(module_license_metadata)))

$(foreach f,$(my_test_data) $(my_test_config),\
  $(if $(strip $(ALL_TARGETS.$(call word-colon,1,$(f)).META_LIC)), \
    $(call declare-copy-target-license-metadata,$(call word-colon,2,$(f)),$(call word-colon,1,$(f))), \
    $(eval ALL_TARGETS.$(call word-colon,2,$(f)).META_LIC := $(module_license_metadata))))

ALL_MODULES.$(my_register_name).META_LIC := $(strip $(ALL_MODULES.$(my_register_name).META_LIC) $(module_license_metadata))

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-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.

  ifneq (,$(strip $(LOCAL_LICENSE_PACKAGE_NAME)))
  ifneq (,$(strip $(LOCAL_LICENSE_PACKAGE_NAME)))
    license_package_name:=$(strip $(LOCAL_LICENSE_PACKAGE_NAME))
    license_package_name:=$(strip $(LOCAL_LICENSE_PACKAGE_NAME))
  else
  else
@@ -136,8 +136,9 @@ else
  ALL_MODULES.$(my_register_name).NOTICE_DEPS := $(ALL_MODULES.$(my_register_name).NOTICE_DEPS) $(notice_deps)
  ALL_MODULES.$(my_register_name).NOTICE_DEPS := $(ALL_MODULES.$(my_register_name).NOTICE_DEPS) $(notice_deps)
  ALL_MODULES.$(my_register_name).IS_CONTAINER := $(strip $(filter-out false,$(ALL_MODULES.$(my_register_name).IS_CONTAINER) $(is_container)))
  ALL_MODULES.$(my_register_name).IS_CONTAINER := $(strip $(filter-out false,$(ALL_MODULES.$(my_register_name).IS_CONTAINER) $(is_container)))
  ALL_MODULES.$(my_register_name).PATH := $(strip $(ALL_MODULES.$(my_register_name).PATH) $(local_path))
  ALL_MODULES.$(my_register_name).PATH := $(strip $(ALL_MODULES.$(my_register_name).PATH) $(local_path))
endif


  ifdef notice_file
  ifdef notice_file
    ALL_MODULES.$(my_register_name).NOTICES := $(ALL_MODULES.$(my_register_name).NOTICES) $(notice_file)
    ALL_MODULES.$(my_register_name).NOTICES := $(ALL_MODULES.$(my_register_name).NOTICES) $(notice_file)
  endif  # notice_file
  endif  # notice_file
endif