Skip to content

Instantly share code, notes, and snippets.

@jdriscoll
Created October 28, 2011 19:17
Show Gist options
  • Save jdriscoll/1323205 to your computer and use it in GitHub Desktop.
Save jdriscoll/1323205 to your computer and use it in GitHub Desktop.
Xcode build script (Apple generic versioning tool)
#!/usr/bin/env sh
if git diff-index --quiet HEAD --; then
agvtool next-version -all
agvtool new-marketing-version "$1"
buildnum=`agvtool vers -terse`
git add .
git commit -m "New build: $1 ($buildnum)"
if [ "$2" = "--release" ]; then
git tag -a "$1" -m "Release $1 ($buildnum)"
echo "Release $1 ($buildnum) is ready to build. Be sure to push your tags."
else
echo "$1 ($buildnum) is ready to build."
fi
else
echo Commit your changes before building.
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment