0

以下のスクリプトを使用して新しい Aggregate ターゲットを作成した後、これらのエラーが発生します。

エラー:

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

スクリプト シェルの実行: /bin/sh

脚本:

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:/'

xcode のデフォルト スクリプトを bash に変更する必要がありますか? どうすればいいですか?

4

1 に答える 1

1

パスに OCLint がありません。パスにOCLintを取得するには、削除してみてください

source ~/.bash_profile

そしてそれを

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

このリンクでヘルプを試すことができます: https://stackoverflow.com/a/30053104/3141464

于 2015-05-08T14:13:32.023 に答える