File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 } '"
You can’t perform that action at this time.
0 commit comments