Skip to content

Instantly share code, notes, and snippets.

@SergioEstevao
Created November 21, 2013 22:44
Show Gist options
  • Save SergioEstevao/7591170 to your computer and use it in GitHub Desktop.
Save SergioEstevao/7591170 to your computer and use it in GitHub Desktop.
A script for running OCLint in Jenkins and create PMD reports
#import path
export PATH=${PATH}:/usr/local/bin
#import what we have in bash_profile
source ~/.bash_profile
#check for oclint
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
hash xctool &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "xctool not found, analyzing stopped"
exit 1
fi
xctool -workspace MyProject.xcworkspace -scheme MyProject clean
xctool -workspace MyProject.xcworkspace -scheme MyProject -reporter json-compilation-database:compile_commands.json build
oclint-json-compilation-database \
-e Pods \
-- -rc=LONG_LINE=200 \
-rc=NCSS_METHOD=60 \
-rc=LONG_METHOD=100 \
-rc=MINIMUM_CASES_IN_SWITCH=1 \
-report-type pmd \
-o oclint.xml \
-max-priority-1 1000 \
-max-priority-2 1000 \
-max-priority-3 1000 \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment