I wanted to avoid the command line build and archive since I read that it does not build a .ipa file with the provisioning profile embedded in it. Using that makes sending it out to testers much easier.
What I did was the following:
I have 4 configurations. Debug, Release, Ad Hoc Release, and App Store Release.
I use Debug and Release to build without doing a commit. I use the Ad Hoc when I want to send to beta testers, and the App Store for final testing and App Store submittal.
Here is the code that I added to my pre-build script.
# Get the version number from the .plist file
VER_NUM=`cat "${SRCROOT}/${INFOPLIST_FILE}" | grep -A 1 CFBundleVersion | grep string | sed 's/]*>//g' | sed 's/^[ ]*//'`
# Check build type to see if svn commit should be done
if [ "${BUILD_STYLE}" == "App Store Distribution" ]
then
SVN_COMMIT=yes
fi
if [ "${BUILD_STYLE}" == "Ad Hoc Distribution" ]
then
SVN_COMMIT=yes
fi
if [ "${SVN_COMMIT}" == "yes" ]
then
echo "Commiting the project to SVN"
BUILD_TIME=`date`
svn commit -m "\"Version ${VER_NUM} for ${BUILD_STYLE} ${BUILD_TIME}\""
fi
This was my quick and dirty answer to the problem. There has to be a more elegant solution, but this will work for now. If Apple would just add an environment variable to show that it is an archive build that would solve it.