1aba5f4cfSVladimir Kotal#!/bin/bash 2aba5f4cfSVladimir Kotal 3aba5f4cfSVladimir Kotal# 4cb86d517SVladimir Kotal# Do not run coverage for forks as most people do not have extra tools enabled 5*4ff8cd68SVladimir Kotal# for their fork. Avoid it also for release builds as that can fail such 6*4ff8cd68SVladimir Kotal# build unnecessarily. 7aba5f4cfSVladimir Kotal# 8aba5f4cfSVladimir Kotalextra_args="" 9*4ff8cd68SVladimir Kotalif [ "x$TRAVIS_REPO_SLUG" == "xoracle/opengrok" && "x$TRAVIS_BRANCH" == "xmaster" ]; then 103db07792SVladimir Kotal echo "Enabling Coveralls" 11b47b86e8SVladimir Kotal extra_args="jacoco:report coveralls:report" 1264cffec5SVladimir Kotal 1364cffec5SVladimir Kotal # 1464cffec5SVladimir Kotal # Sonar seems to only work on master branch commits. 1564cffec5SVladimir Kotal # 1664cffec5SVladimir Kotal if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then 1764cffec5SVladimir Kotal echo "Enabling Sonar" 18cb86d517SVladimir Kotal extra_args="$extra_args sonar:sonar" 19aba5f4cfSVladimir Kotal fi 2064cffec5SVladimir Kotalfi 21aba5f4cfSVladimir Kotal 229f2d396bSVladimir Kotalif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then 239866a0c8SVladimir Kotal JAVA_BASE="/c/Program Files/OpenJDK" 249866a0c8SVladimir Kotal JDK_DIR=$(find "$JAVA_BASE/" -type d -name 'openjdk*' -maxdepth 1 | head -1) 259866a0c8SVladimir Kotal export JAVA_HOME=${JAVA_HOME:-$JDK_DIR} 269866a0c8SVladimir Kotal echo "JAVA_HOME set to $JAVA_HOME" 279f2d396bSVladimir Kotal export PATH=${JAVA_HOME}/bin:${PATH} 289f2d396bSVladimir Kotal 299f2d396bSVladimir Kotal export PATH=${PATH}:/c/ProgramData/chocolatey/lib/universal-ctags/tools 309f2d396bSVladimir Kotal export PATH=${PATH}:/c/Program\ Files\ \(x86\)/Subversion/bin 319866a0c8SVladimir Kotal export PATH=${PATH}:${JAVA_HOME} 329f2d396bSVladimir Kotal 339f2d396bSVladimir Kotal # needs to be before the default Python 2 349f2d396bSVladimir Kotal export PATH=/c/Python38:${PATH} 359f2d396bSVladimir Kotal 369f2d396bSVladimir Kotal extra_args="$extra_args -Dorg.opengrok.indexer.analysis.Ctags=c:\\ProgramData\\chocolatey\\lib\\universal-ctags\\tools\\ctags.exe" 379f2d396bSVladimir Kotalfi 389f2d396bSVladimir Kotal 398aef88daSVladimir Kotalret=0 4086b0ab6bSAdam Hornacek./mvnw -B -V verify $extra_args || ret=1 419f2d396bSVladimir Kotal 429f2d396bSVladimir Kotalif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 4362e99791SVladimir Kotal echo "Checking Apiary blueprint format" 448aef88daSVladimir Kotal node dev/parse.js || ret=1 459f2d396bSVladimir Kotalfi 469f2d396bSVladimir Kotal 478aef88daSVladimir Kotalexit $ret 48