0

I am getting these error after creating a new Aggregate target with below script:

error:

oclint not found, analyzing stopped
Command /bin/sh failed with exit code 1

Run Script Shell: /bin/sh

Script:

source ~/.bash_profile

hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi

cd ${TARGET_TEMP_DIR}

if [ ! -f compile_commands.json ]; then
echo "[*] compile_commands.json not found, possibly clean was performed"
echo "[*] starting xcodebuild to rebuild the project.."
# clean previous output
if [ -f xcodebuild.log ]; then
rm xcodebuild.log
fi

cd ${SRCROOT}

xcodebuild clean

#build xcodebuild.log
xcodebuild | tee ${TARGET_TEMP_DIR}/xcodebuild.log
#xcodebuild <options>| tee ${TARGET_TEMP_DIR}/xcodebuild.log

echo "[*] transforming xcodebuild.log into compile_commands.json..."
cd ${TARGET_TEMP_DIR}
#transform it into compile_commands.json
oclint-xcodebuild

echo "[*] copy compile_commands.json to the project root..."
cp ${TARGET_TEMP_DIR}/compile_commands.json ${SRCROOT}/compile_commands.json

fi

echo "[*] starting analyzing"
cd ${TARGET_TEMP_DIR}
oclint-json-compilation-database | sed 's/\(.*\.\m\{1,2\}:[0-9]*:[0-9]*:\)/\1 warning:/'

Do I have to change xcode default script to bash? How would I do it?

MrEngineer13
  • 38,642
  • 13
  • 74
  • 93
Roopesh Mittal
  • 191
  • 2
  • 10

1 Answers1

1

You don't have OCLint in your path. TO get OCLint in your path you can try removing

source ~/.bash_profile

and replacing it with

OCLINT_HOME= **path to OClint downloaded and extracted folder**
export PATH=$OCLINT_HOME/bin:$PATH

you can try out this link for help :https://stackoverflow.com/a/30053104/3141464

Community
  • 1
  • 1
Dheeraj Singh
  • 5,143
  • 25
  • 33