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

Commit 772817c9 authored by Colin Cross's avatar Colin Cross Committed by Automerger Merge Worker
Browse files

Merge "Delay platform availability error for ALLOW_MISSING_DEPENDENCIES=true"...

Merge "Delay platform availability error for ALLOW_MISSING_DEPENDENCIES=true" am: 8b21e4e7 am: 3a6e1ec9

Original change: https://android-review.googlesource.com/c/platform/build/+/1414693

Change-Id: I9dd7764bf312dbb77ec9b987bc68fc1fd423d2e4
parents 6059d763 3a6e1ec9
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ $(strip $(foreach m,$(product_MODULES),\
      $(if $(filter true,$(ALL_MODULES.$(m).NOT_AVAILABLE_FOR_PLATFORM)),\
        $(m))))))

ifndef ALLOW_MISSING_DEPENDENCIES
  _violators_with_path := $(foreach m,$(sort $(_modules_not_available_for_platform)),\
    $(m):$(word 1,$(ALL_MODULES.$(m).PATH))\
  )
@@ -34,3 +35,22 @@ $(call maybe-print-list-and-error,$(_violators_with_path),\
Following modules are requested to be installed. But are not available \
for platform because they do not have "//apex_available:platform" or \
they depend on other modules that are not available for platform)

else

# Don't error out immediately when ALLOW_MISSING_DEPENDENCIES is set.
# Instead, add a dependency on a rule that prints the error message.
  define not_available_for_platform_rule
    not_installable_file := $(patsubst $(OUT_DIR)/%,$(OUT_DIR)/NOT_AVAILABLE_FOR_PLATFORM/%,$(1)))
    $(1): $$(not_installable_file)
    $$(not_installable_file):
	$(call echo-error,$(2),Module is requested to be installed but is not \
available for platform because it does not have "//apex_available:platform" or \
it depends on other modules that are not available for platform.)
	exit 1
  endef

  $(foreach m,$(_modules_not_available_for_platform),\
    $(foreach i,$(ALL_MODULES.$(m).INSTALLED),\
      $(eval $(call not_available_for_platform_rule,$(i),$(m)))))
endif