Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

Commit

Permalink
Add -nounittests and -usesonarscanner parameters to run-sonar.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
davidy4ng authored Mar 17, 2017
1 parent 57f2e4d commit 17b311c
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/main/shell/run-sonar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,21 @@ function runCommand() {
## COMMAND LINE OPTIONS
vflag=""
nflag=""
unittests="on"
oclint="on"
fauxpas="on"
lizard="on"
sonarscanner=""

while [ $# -gt 0 ]
do
case "$1" in
-v) vflag=on;;
-n) nflag=on;;
-nooclint) oclint="";;
-nounittests) unittests="";;
-nooclint) oclint="";;
-nofauxpas) fauxpas="";;
-usesonarscanner) sonarscanner="on";;
--) shift; break;;
-*)
echo >&2 "Usage: $0 [-v]"
Expand Down Expand Up @@ -248,7 +253,7 @@ oclint-xcodebuild # Transform the xcodebuild.log file into a compile_command.jso


# Unit tests and coverage
if [ "$testScheme" = "" ]; then
if [ "$testScheme" = "" ] || [ "$unittests" = "" ]; then
echo 'Skipping tests as no test scheme has been provided!'

# Put default xml files with no tests and no coverage...
Expand Down Expand Up @@ -430,8 +435,21 @@ else
fi

# SonarQube
echo -n 'Running SonarQube using SonarQube Runner'
runCommand /dev/stdout sonar-runner
if [ "$sonarscanner" = "on" ]; then
echo -n 'Running SonarQube using SonarQube Scanner'
if hash /dev/stdout sonar-scanner 2>/dev/null; then
runCommand /dev/stdout sonar-scanner
else
echo 'Skipping sonar-scanner (not installed!)'
fi
else
echo -n 'Running SonarQube using SonarQube Runner'
if hash /dev/stdout sonar-runner 2>/dev/null; then
runCommand /dev/stdout sonar-runner
else
runCommand /dev/stdout sonar-scanner
fi
fi

# Kill progress indicator
stopProgress
Expand Down

0 comments on commit 17b311c

Please sign in to comment.