Merge "Copy generated $(PRODUCT_OUT)/module-info.json file to dist when SOONG_COLLECT_JAVA_DEPS flag is set."
diff --git a/core/base_rules.mk b/core/base_rules.mk
index adf61f1..dbd8930 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -274,6 +274,12 @@
   endif
 endif
 
+ifeq ($(LOCAL_IS_UNIT_TEST),true)
+  ifeq ($(LOCAL_IS_HOST_MODULE),true)
+    LOCAL_COMPATIBILITY_SUITE += host-unit-tests
+  endif
+endif
+
 ifeq ($(my_module_path),)
   install_path_var := $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS)
   ifeq (true,$(LOCAL_PRIVILEGED_MODULE))
diff --git a/core/definitions.mk b/core/definitions.mk
index daac652..5755deb 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -107,7 +107,7 @@
 # All tests that should be skipped in presubmit check.
 ALL_DISABLED_PRESUBMIT_TESTS :=
 
-# All compatibility suites mentioned in LOCAL_COMPATIBILITY_SUITES
+# All compatibility suites mentioned in LOCAL_COMPATIBILITY_SUITE
 ALL_COMPATIBILITY_SUITES :=
 
 # All compatibility suite files to dist.
diff --git a/core/tasks/platform_availability_check.mk b/core/tasks/platform_availability_check.mk
index 7ce6b40..1524758 100644
--- a/core/tasks/platform_availability_check.mk
+++ b/core/tasks/platform_availability_check.mk
@@ -17,6 +17,9 @@
 # Check whether there is any module that isn't available for platform
 # is installed to the platform.
 
+# Skip for unbundled builds that don't produce a platform image.
+ifeq (,$(TARGET_BUILD_UNBUNDLED))
+
 # Filter FAKE and NON_INSTALLABLE modules out and then collect those are not
 # available for platform
 _modules_not_available_for_platform := \
@@ -41,7 +44,7 @@
 # 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)))
+    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 \
@@ -54,3 +57,5 @@
     $(foreach i,$(filter-out $(HOST_OUT)/%,$(ALL_MODULES.$(m).INSTALLED)),\
       $(eval $(call not_available_for_platform_rule,$(i),$(m)))))
 endif
+
+endif