diff --git a/core/clear_vars.mk b/core/clear_vars.mk index f3929adc25..ef0b031095 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -125,6 +125,7 @@ LOCAL_ADDRESS_SANITIZER:= # Whether to keep the generated R/Manifest classes when building static Java library # with Android resource. false(default), or true LOCAL_KEEP_R_CLASS_IN_STATIC_JAVA_LIBRARY:= +LOCAL_LINT_FLAGS:= # Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to # iterate over thousands of entries every time. diff --git a/core/config.mk b/core/config.mk index b0b5082670..2af4f6e2a0 100644 --- a/core/config.mk +++ b/core/config.mk @@ -295,6 +295,7 @@ LLVM_RS_CC := $(HOST_OUT_EXECUTABLES)/llvm-rs-cc$(HOST_EXECUTABLE_SUFFIX) LLVM_RS_LINK := $(HOST_OUT_EXECUTABLES)/llvm-rs-link$(HOST_EXECUTABLE_SUFFIX) DEXOPT := $(HOST_OUT_EXECUTABLES)/dexopt$(HOST_EXECUTABLE_SUFFIX) DEXPREOPT := dalvik/tools/dex-preopt +LINT := prebuilts/sdk/tools/lint # ACP is always for the build OS, not for the host OS ACP := $(BUILD_OUT_EXECUTABLES)/acp$(BUILD_EXECUTABLE_SUFFIX) diff --git a/core/main.mk b/core/main.mk index 1ab9b6c0a6..317660f45e 100644 --- a/core/main.mk +++ b/core/main.mk @@ -817,6 +817,8 @@ $(call dist-for-goals,sdk win_sdk, \ ) endif +.PHONY: lintall + .PHONY: samplecode sample_MODULES := $(sort $(call get-tagged-modules,samples)) sample_APKS_DEST_PATH := $(TARGET_COMMON_OUT_ROOT)/samples diff --git a/core/package.mk b/core/package.mk index c689031370..3f911fb69b 100644 --- a/core/package.mk +++ b/core/package.mk @@ -407,4 +407,14 @@ endif PACKAGES := $(PACKAGES) $(LOCAL_PACKAGE_NAME) +# Lint phony targets +.PHONY: lint-$(LOCAL_PACKAGE_NAME) +lint-$(LOCAL_PACKAGE_NAME): PRIVATE_PATH := $(LOCAL_PATH) +lint-$(LOCAL_PACKAGE_NAME): PRIVATE_LINT_FLAGS := $(LOCAL_LINT_FLAGS) +lint-$(LOCAL_PACKAGE_NAME) : + @echo lint $(PRIVATE_PATH) + $(LINT) $(PRIVATE_LINT_FLAGS) $(PRIVATE_PATH) + +lintall : lint-$(LOCAL_PACKAGE_NAME) + endif # skip_definition