Posted By

sudarkoff on 09/11/08


Tagged

python xcode git


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

gartenstuhl


Git and XCode: A git build number script


 / Published in: Python
 

URL: http://www.cimgf.com/2008/04/13/git-and-xcode-a-git-build-number-script/

The script was modified slightly based on comments.

  1. import os
  2. from Foundation import NSMutableDictionary
  3.  
  4. version = os.popen4("git rev-parse --short HEAD")[1].read()
  5. info = os.environ['INFOPLIST_PATH']
  6.  
  7. plist = NSMutableDictionary.dictionaryWithContentsOfFile_(info)
  8. plist['CFBundleVersion'] = version
  9. plist.writeToFile_atomically_(info, 1)

Report this snippet  

You need to login to post a comment.