Skip to content

Commit 5d22b8c

Browse files
committed
First commit
0 parents  commit 5d22b8c

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

README

Whitespace-only changes.

autocommit-build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Xcode git autocommit script by Andre Arko
2+
# This script will automatically commit any changed files to the project's
3+
# git repository, in the branch "builds"
4+
5+
# If you use this script, you can create more typical commits in the master
6+
# branch with the commands:
7+
# git checkout master
8+
# git merge builds --squash
9+
10+
if [ -z "`git branch | grep builds`" ]; then
11+
git co -b builds
12+
else
13+
git co builds
14+
fi
15+
16+
git commit -a -m "`date +'Build on %F at %r'`"
17+
# ignore git-commit exiting >0, since nothing to commit is fine
18+
exit 0

git-version.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
3+
# Xcode auto-versioning script for git by Andre Arko
4+
# This script will set your CFBundleVersion number to the name of the most recent
5+
# git tag, and include the current commit's distance from that tag and sha1 hash
6+
7+
# With tag "v1.0", and two commits since then, the build will be:
8+
# v1.0 (b2 abc123)
9+
10+
# Create new versions with "git tag <version> -m <message>"
11+
12+
# based on the ruby script by Abizern which was
13+
# based on the git script by Marcus S. Zarra and Matt Long which was
14+
# based on the Subversion script by Axel Andersson
15+
16+
gitnum = `/usr/bin/env git describe --long`.chomp.split("-")
17+
18+
version = gitnum[0] + " (b#{gitnum[1]} #{gitnum[2]})"
19+
20+
info_file = ENV['BUILT_PRODUCTS_DIR'] + "/" + ENV['INFOPLIST_PATH']
21+
info = File.open(info_file, "r").read
22+
23+
version_re = /([\t ]+CFBundleVersion<\/key>\n[\t ]+).*?(<\/string>)/
24+
info =~ version_re
25+
bundle_version_string = $1 + version + $2
26+
27+
info.gsub!(version_re, bundle_version_string)
28+
File.open(info_file, "w") { |file| file.write(info) }
29+
puts "Set version string to '#{version}'"

0 commit comments

Comments
 (0)