LoginSignup
9
9

More than 5 years have passed since last update.

Xcodeで特定のコードが含まれてたらビルドを止める

Last updated at Posted at 2017-08-17

デバッグ中とか仕込んだコードをリリースビルドに入れない努力。
RunScriptに入れて使ってください。うちでは // DEBUG: というのが含まれてればリリースビルドでは止めるはず・・・

// debugコードを検知したらビルドを止める
ctn=`find . -name "*.swift" -type f -print | xargs grep "// DEBUG:" | wc -l`

echo "${CONFIGURATION}"

if [ $ctn != 0 -a "${CONFIGURATION}" = "Release" ] ; then
    echo "error: Source has debug comment '// DEBUG: '. Please fix your code."
    return -1
else
    echo "no has debug comment | no release build"
fi
9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9