Add LOCAL_FINDBUGS_FLAGS to support custom findbugs flags.

Use LOCAL_FINDBUGS_FLAGS to specify findbugs command line flags.
To use findbugs filters:
LOCAL_FINDBUGS_FLAGS := -exclude $(LOCAL_PATH)/exclude.xml -include \
                        $(LOCAL_PATH)/include.xml

where exclude.xml and include.xml are filter files.
The build system automatically adds the filter files as dependency of
findbugs' output xml.

Bug: 24948760
Change-Id: I82502c0ade910c5255001fa5f390316137ce0be6
This commit is contained in:
Ying Wang 2015-10-21 10:30:51 -07:00
parent 597f384fb3
commit 702e01e258
2 changed files with 6 additions and 5 deletions

View File

@ -191,6 +191,7 @@ LOCAL_DATA_BINDING:=
LOCAL_DBUS_PROXY_PREFIX:=
LOCAL_INIT_RC:=
LOCAL_MODULE_HOST_OS:=
LOCAL_FINDBUGS_FLAGS:=
# arch specific variables
LOCAL_SRC_FILES_$(TARGET_ARCH):=

View File

@ -591,13 +591,13 @@ ifneq ($(GENERATE_DEX_DEBUG),)
endif
findbugs_xml := $(intermediates.COMMON)/findbugs.xml
$(findbugs_xml) : PRIVATE_AUXCLASSPATH := $(addprefix -auxclasspath ,$(strip \
$(call normalize-path-list,$(filter %.jar,\
$(full_java_libs)))))
$(findbugs_xml) : $(full_classes_jar)
$(findbugs_xml): PRIVATE_AUXCLASSPATH := $(addprefix -auxclasspath ,$(strip \
$(call normalize-path-list,$(filter %.jar,$(full_java_libs)))))
$(findbugs_xml): PRIVATE_FINDBUGS_FLAGS := $(LOCAL_FINDBUGS_FLAGS)
$(findbugs_xml) : $(full_classes_jar) $(filter %.xml, $(LOCAL_FINDBUGS_FLAGS))
@echo Findbugs: $@
$(hide) $(FINDBUGS) -textui -effort:min -xml:withMessages \
$(PRIVATE_AUXCLASSPATH) \
$(PRIVATE_AUXCLASSPATH) $(PRIVATE_FINDBUGS_FLAGS) \
$< \
> $@