-
-
Save steipete/1501754 to your computer and use it in GitHub Desktop.
git=`sh /etc/profile; which git` | |
version=`$git describe --tags --always` | |
count=`$git rev-list --all |wc -l` | |
echo -e "#define GIT_VERSION $version\n#define GIT_COMMIT_COUNT $count" > InfoPlist.h |
Nice! Your script doesn't show the tag, that's why I chose git describe. Otherwise pretty similar. The git-binary-lookup is nice!
When where and how do you make use of this script? I must be doing something wrong:
Edit schemes
Select Build->Pre-Actions
Provide Build Settings From (My App Target)
Pasting in the script
Now Run, or Select Product Build
I don't see anything in the project folder or the console that gives me any indication the this is working or not working.
Can I get a hint?
Got it ... found your blog post that references this.
What I'd like to see is a means of triggering git describe –abbrev=0 –tags
automatically based on the build configuration or the selected scheme, that way I don't need to have a separate target for the distribution.
In my projects I use something similar: