From 05eecea70b64095db2bc5f9f8aef7475964a9d7b Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Thu, 18 Jul 2013 21:59:52 -0700 Subject: Enable running cpplint.py on art C++ files when using mm and mmm Change-Id: I945bfc37c1e95310ee52e171faeeafc224934215 --- build/Android.cpplint.mk | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 build/Android.cpplint.mk (limited to 'build/Android.cpplint.mk') diff --git a/build/Android.cpplint.mk b/build/Android.cpplint.mk new file mode 100644 index 0000000000..eabaf31cca --- /dev/null +++ b/build/Android.cpplint.mk @@ -0,0 +1,54 @@ +# +# Copyright (C) 2011 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +ART_CPPLINT := art/tools/cpplint.py +ART_CPPLINT_FILTER := --filter=-whitespace/comments,-whitespace/line_length,-build/include,-readability/function,-readability/streams,-readability/todo,-runtime/references,-runtime/sizeof,-runtime/threadsafe_fn,-runtime/printf +ART_CPPLINT_SRC := $(shell find art -name *.h -o -name *$(ART_CPP_EXTENSION) | grep -v art/compiler/llvm/generated/) + +# "mm cpplint-art" to verify we aren't regressing +.PHONY: cpplint-art +cpplint-art: + $(ART_CPPLINT) $(ART_CPPLINT_FILTER) $(ART_CPPLINT_SRC) + +# "mm cpplint-art-all" to see all warnings +.PHONY: cpplint-art-all +cpplint-art-all: + $(ART_CPPLINT) $(ART_CPPLINT_SRC) + +OUT_CPPLINT := $(TARGET_COMMON_OUT_ROOT)/cpplint + +ART_CPPLINT_TARGETS := + +define declare-art-cpplint-target +art_cpplint_file := $(1) +art_cpplint_touch := $$(OUT_CPPLINT)/$$(subst /,__,$$(art_cpplint_file)) + +$$(art_cpplint_touch): $$(art_cpplint_file) $(ART_CPPLINT) art/build/Android.cpplint.mk + $(hide) $(ART_CPPLINT) $(ART_CPPLINT_FILTER) $$< + @mkdir -p $$(dir $$@) + $(hide) touch $$@ + +ART_CPPLINT_TARGETS += $$(art_cpplint_touch) +endef + +$(foreach file, $(ART_CPPLINT_SRC), $(eval $(call declare-art-cpplint-target,$(file)))) +#$(info $(call declare-art-cpplint-target,$(firstword $(ART_CPPLINT_SRC)))) + +include $(CLEAR_VARS) +LOCAL_MODULE := cpplint-art-phony +LOCAL_MODULE_TAGS := optional +LOCAL_ADDITIONAL_DEPENDENCIES := $(ART_CPPLINT_TARGETS) +include $(BUILD_PHONY_PACKAGE) -- cgit v1.2.3-59-g8ed1b