X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fcmake-sonar.sh;h=e64ca69cf83803f80640dcff040565ca9557b67d;hb=a86c6e8d376c95aa00b179fce9d207e61c8f72d0;hp=43e776f84234c47d67b9e795d69c8e35d4e350f9;hpb=c63e147ab10c5b00b2dfdac6df62ee9ef6dd8442;p=releng%2Fglobal-jjb.git diff --git a/shell/cmake-sonar.sh b/shell/cmake-sonar.sh index 43e776f8..e64ca69c 100644 --- a/shell/cmake-sonar.sh +++ b/shell/cmake-sonar.sh @@ -20,6 +20,12 @@ make_opts="${MAKE_OPTS:-}" set -ex -o pipefail +export SET_JDK_VERSION="${SET_JDK_VERSION:-openjdk11}" +echo "$SET_JDK_VERSION" +bash <(curl -s https://raw.githubusercontent.com/lfit/releng-global-jjb/master/shell/update-java-alternatives.sh) +# shellcheck disable=SC1091 +source /tmp/java.env + cd /tmp || exit 1 wget -q -O /tmp/sonar-scan.zip \ "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip" @@ -37,8 +43,10 @@ cd "$build_dir" || exit 1 # shellcheck disable=SC2086 eval cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $cmake_opts .. +# $make_opts may be empty. +# shellcheck disable=SC2086 /opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir "$WORKSPACE/bw-output" \ - make "$make_opts" + make $make_opts /opt/sonar-scanner/bin/sonar-scanner \ -Dsonar.projectKey="${PROJECT_KEY}" \