summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@mapbox.com>2019-04-02 15:48:21 -0400
committerJulian Rex <julian.rex@mapbox.com>2019-04-02 15:48:21 -0400
commit01a47079ff915fe820f7a8620f42298129b85616 (patch)
tree2f39f7c79a764a39d6d79b65e69b8b2346ed31ec
parent60aa5c2589d4e5c2a84a6a81b4e36a9e9e44d8cd (diff)
downloadqtlocation-mapboxgl-01a47079ff915fe820f7a8620f42298129b85616.tar.gz
Experiment.
-rw-r--r--Makefile8
-rw-r--r--circle.yml2
-rwxr-xr-xscripts/clang-tools.sh6
3 files changed, 9 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index afbcd70d0f..85e4524bd6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
export BUILDTYPE ?= Debug
export IS_LOCAL_DEVELOPMENT ?= true
export WITH_CXX11ABI ?= $(shell scripts/check-cxx11abi.sh)
+export TARGET_BRANCH ?= master
+
ifeq ($(BUILDTYPE), Release)
else ifeq ($(BUILDTYPE), RelWithDebInfo)
@@ -191,12 +193,12 @@ compdb: $(BUILD_DEPS) $(TEST_DEPS) $(MACOS_COMPDB_PATH)/Makefile
.PHONY: tidy
tidy: compdb
- scripts/clang-tools.sh $(MACOS_COMPDB_PATH)
+ scripts/clang-tools.sh $(MACOS_COMPDB_PATH) $(TARGET_BRANCH)
.PHONY: check
check: compdb
- scripts/clang-tools.sh $(MACOS_COMPDB_PATH) --diff
-
+ @echo TARGET_BRANCH=$(TARGET_BRANCH)
+ scripts/clang-tools.sh $(MACOS_COMPDB_PATH) $(TARGET_BRANCH) --diff
endif
#### iOS targets ##############################################################
diff --git a/circle.yml b/circle.yml
index 063df5573b..1eda60b54b 100644
--- a/circle.yml
+++ b/circle.yml
@@ -502,7 +502,7 @@ jobs:
command: make compdb
- run:
name: Run Clang checks
- command: make check
+ command: make check TARGET_BRANCH=${CIRCLE_TARGET_BRANCH:master}
no_output_timeout: 20m
- save-dependencies: { ccache: false }
diff --git a/scripts/clang-tools.sh b/scripts/clang-tools.sh
index 8c2ccb329d..1e73951176 100755
--- a/scripts/clang-tools.sh
+++ b/scripts/clang-tools.sh
@@ -33,7 +33,7 @@ function run_clang_tidy() {
}
function run_clang_tidy_diff() {
- OUTPUT=$(git diff origin/release-liquid --src-prefix=${CDUP} --dst-prefix=${CDUP} | \
+ OUTPUT=$(git diff origin/$2 --src-prefix=${CDUP} --dst-prefix=${CDUP} | \
${CLANG_TIDY_PREFIX}/share/clang-tidy-diff.py \
-clang-tidy-binary ${CLANG_TIDY} \
2>/dev/null)
@@ -45,7 +45,7 @@ function run_clang_tidy_diff() {
function run_clang_format() {
echo "Running clang-format on $0..."
- DIFF_FILES=$(git diff origin/release-liquid --name-only *cpp)
+ DIFF_FILES=$(git diff origin/$2 --name-only *cpp)
echo "${DIFF_FILES}" | xargs -I{} -P ${JOBS} bash -c 'run_clang_format' {}
${CLANG_FORMAT} -i ${CDUP}/$0 || exit 1
}
@@ -54,7 +54,7 @@ export -f run_clang_tidy run_clang_tidy_diff run_clang_format
echo "Running Clang checks... (this might take a while)"
-if [[ -n $2 ]] && [[ $2 == "--diff" ]]; then
+if [[ -n $3 ]] && [[ $3 == "--diff" ]]; then
run_clang_tidy_diff $@
# XXX disabled until we run clang-format over the entire codebase.
#run_clang_format $@