From 1db45ef2a216491f0e27769f43204f4fc1b73668 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 6 Jul 2020 14:14:47 -0700 Subject: [PATCH] Dist lint reports for apps Dist the transitive lint report for each unbundled app built by Soong when lint-check is on the command line. Bug: 153485543 Test: m TARGET_BUILD_APPS=Gallery2 lint-check dist Change-Id: Icd2b6f884396fa5f743746099301c325ca82a324 Merged-In: Icd2b6f884396fa5f743746099301c325ca82a324 (cherry picked from commit b84295242135cae66bee17c2cb284539487bd6e3) --- core/clear_vars.mk | 1 + core/main.mk | 8 ++++++++ core/soong_app_prebuilt.mk | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index b9f439fb59..f56be136fe 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -273,6 +273,7 @@ LOCAL_SOONG_EXPORT_PROGUARD_FLAGS := LOCAL_SOONG_HEADER_JAR := LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR := LOCAL_SOONG_LINK_TYPE := +LOCAL_SOONG_LINT_REPORTS := LOCAL_SOONG_PROGUARD_DICT := LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE := LOCAL_SOONG_DEVICE_RRO_DIRS := diff --git a/core/main.mk b/core/main.mk index 9e1d6b7024..357c70da33 100644 --- a/core/main.mk +++ b/core/main.mk @@ -1508,6 +1508,14 @@ ifneq ($(TARGET_BUILD_APPS),) $(if $(ALL_MODULES.$(m).BUNDLE),$(ALL_MODULES.$(m).BUNDLE):$(m)-base.zip)) $(call dist-for-goals,apps_only, $(apps_only_bundle_files)) + # Dist the lint reports if they exist. + apps_only_lint_report_files := $(foreach m,$(unbundled_build_modules),\ + $(foreach report,$(ALL_MODULES.$(m).LINT_REPORTS),\ + $(report):$(m)-$(notdir $(report)))) + .PHONY: lint-check + lint-check: $(foreach f, $(apps_only_lint_report_files), $(call word-colon,1,$(f))) + $(call dist-for-goals,lint-check, $(apps_only_lint_report_files)) + # For uninstallable modules such as static Java library, we have to dist the built file, # as . apps_only_dist_built_files := $(foreach m,$(unbundled_build_modules),$(if $(ALL_MODULES.$(m).INSTALLED),,\ diff --git a/core/soong_app_prebuilt.mk b/core/soong_app_prebuilt.mk index 01e980029b..faeb8ce44f 100644 --- a/core/soong_app_prebuilt.mk +++ b/core/soong_app_prebuilt.mk @@ -170,6 +170,10 @@ ifdef LOCAL_SOONG_BUNDLE ALL_MODULES.$(LOCAL_MODULE).BUNDLE := $(LOCAL_SOONG_BUNDLE) endif +ifdef LOCAL_SOONG_LINT_REPORTS + ALL_MODULES.$(my_register_name).LINT_REPORTS := $(LOCAL_SOONG_LINT_REPORTS) +endif + ifndef LOCAL_IS_HOST_MODULE ifeq ($(LOCAL_SDK_VERSION),system_current) my_link_type := java:system