Alok Bhatt | adb0367 | 2020-10-24 14:24:53 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | echo "---> cmake-sonarqube.sh starts" |
| 4 | |
| 5 | CMAKE_OPTS= |
| 6 | BUILD_DIR=$WORKSPACE/src |
| 7 | BUILD_WRAP_DIR=$WORKSPACE/bw-output |
| 8 | |
| 9 | |
| 10 | build_dir="${BUILD_DIR:-$WORKSPACE/build}" |
| 11 | build_wrap_dir="${BUILD_WRAP_DIR:-$WORKSPACE/bw-output}" |
| 12 | cmake_opts="${CMAKE_OPTS:-}" |
| 13 | make_opts="${MAKE_OPTS:-}" |
| 14 | |
| 15 | cd src || exit 1 |
| 16 | wget -q -O bw.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip |
| 17 | unzip -q bw.zip |
| 18 | sudo mv build-wrapper-* /opt/build-wrapper |
| 19 | |
| 20 | mkdir -p "$build_dir" |
| 21 | cd "$build_dir" || exit 1 |
| 22 | |
| 23 | |
| 24 | # $make_opts may be empty. |
| 25 | # shellcheck disable=SC2086 |
| 26 | /opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir "$build_wrap_dir" make $make_opts |
| 27 | |
| 28 | echo "---> cmake-sonarqube.sh ends" |