diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-06-03 18:05:04 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-08-05 11:42:22 +0200 |
commit | 692fe1f3ffc8f4364b39c14aa7d90cec2ff5c0a6 (patch) | |
tree | 1d08af7d56e986dba2b548ff9b9a7e1a77c713ed /scripts | |
parent | e3ee55b28d0b230d054c9718f79a1f6d685cd62b (diff) | |
download | qtlocation-mapboxgl-692fe1f3ffc8f4364b39c14aa7d90cec2ff5c0a6.tar.gz |
[build] switch to CMake
This is very much a work in progress.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/clang-tools.sh | 6 | ||||
-rwxr-xr-x | scripts/generate-core-files.sh | 20 | ||||
-rwxr-xr-x | scripts/generate-test-files.sh | 20 | ||||
-rwxr-xr-x | scripts/travis_setup.sh | 4 |
4 files changed, 48 insertions, 2 deletions
diff --git a/scripts/clang-tools.sh b/scripts/clang-tools.sh index f26b065263..6a10740c77 100755 --- a/scripts/clang-tools.sh +++ b/scripts/clang-tools.sh @@ -18,6 +18,8 @@ command -v ${CLANG_TIDY} >/dev/null 2>&1 || { cd $1 +CDUP=$(git rev-parse --show-cdup) + function check_tidy() { echo "Running clang-tidy on $0..." if [[ -n $1 ]] && [[ $1 == "--fix" ]]; then @@ -34,7 +36,7 @@ function check_tidy() { function check_format() { echo "Running clang-format on $0..." - ${CLANG_FORMAT} -i ../../../$0 + ${CLANG_FORMAT} -i ${CDUP}/$0 } export CLANG_TIDY CLANG_FORMAT @@ -61,6 +63,6 @@ if [ -n $2 ] && [ $2 == "--diff" ]; then fi echo "All looks good!" else - git ls-files '../../../src/mbgl/*.cpp' '../../../platform/*.cpp' '../../../test/*.cpp' | \ + git ls-files '${CDUP}/src/mbgl/*.cpp' '${CDUP}/platform/*.cpp' '${CDUP}/test/*.cpp' | \ xargs -I{} -P ${JOBS} bash -c 'check_tidy' {} fi diff --git a/scripts/generate-core-files.sh b/scripts/generate-core-files.sh new file mode 100755 index 0000000000..a14239b8f2 --- /dev/null +++ b/scripts/generate-core-files.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +echo "# Do not edit. Regenerate this with ./scripts/generate-core-files.sh" > cmake/core-files.cmake +echo "" >> cmake/core-files.cmake +echo "set(MBGL_CORE_FILES" >> cmake/core-files.cmake +PREFIX= +for FILE in $(find include src -type f -a \( -name "*.hpp" -o -name "*.cpp" -o -name "*.h" -o -name "*.c" \) | perl -p -e "s/^((src|include)\/(mbgl\/)?(.+)\/\w+\.\w+)$/\$4#\$1/g" | sort) ; do + CURRENT_PREFIX="${FILE%#*}" + if [ "${PREFIX}" != "${CURRENT_PREFIX}" ]; then + if [ ! -z "${PREFIX}" ]; then echo "" >> cmake/core-files.cmake ; fi + echo " # ${CURRENT_PREFIX}" >> cmake/core-files.cmake + PREFIX="${CURRENT_PREFIX}" + fi + echo " ${FILE#*#}" >> cmake/core-files.cmake +done +echo ")" >> cmake/core-files.cmake +git diff cmake/core-files.cmake diff --git a/scripts/generate-test-files.sh b/scripts/generate-test-files.sh new file mode 100755 index 0000000000..0af6828c66 --- /dev/null +++ b/scripts/generate-test-files.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +echo "# Do not edit. Regenerate this with ./scripts/generate-test-files.sh" > cmake/test-files.cmake +echo "" >> cmake/test-files.cmake +echo "set(MBGL_TEST_FILES" >> cmake/test-files.cmake +PREFIX= +for FILE in $(find test -type f -a \( -name "*.hpp" -o -name "*.cpp" -o -name "*.h" -o -name "*.c" \) | sort) ; do + CURRENT_PREFIX=$(dirname ${FILE#test/}) + if [ "${PREFIX}" != "${CURRENT_PREFIX}" ]; then + if [ ! -z "${PREFIX}" ]; then echo "" >> cmake/test-files.cmake ; fi + echo " # ${CURRENT_PREFIX}" >> cmake/test-files.cmake + PREFIX="${CURRENT_PREFIX}" + fi + echo " ${FILE}" >> cmake/test-files.cmake +done +echo ")" >> cmake/test-files.cmake +git diff cmake/test-files.cmake diff --git a/scripts/travis_setup.sh b/scripts/travis_setup.sh index dfd045224a..ae8dda46b5 100755 --- a/scripts/travis_setup.sh +++ b/scripts/travis_setup.sh @@ -43,6 +43,10 @@ export DISPLAY=:99.0 mapbox_time "checkout_mason" \ git submodule update --init .mason +# Touch package.json so that we are definitely going to run an npm update action +mapbox_time "touch_package_json" \ +touch package.json + # Install and set up to load a more recent version of mesa mapbox_time "install_mesa" \ mason install mesa 11.2.2 |