Skip to content

Instantly share code, notes, and snippets.

@madninja
madninja / Project-Prefix.pch
Created September 26, 2011 22:39
Project-Prefix.pch
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#define RGB(r,g,b) [UIColor colorWithRed:(r) green:(g) blue:(b) alpha:1]
#define RGBA(r,g,b,a) [UIColor colorWithRed:(r) green:(g) blue:(b) alpha:(a)]
#endif
@madninja
madninja / inject_version.sh
Created February 26, 2011 19:41
Inject git version info into Info.plist and iOS settings
#!/bin/bash
cd $PROJECT_DIR
BUILD_VERSION=`/usr/local/bin/git rev-parse --short HEAD`
cd "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app"
RELEASE_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" Info.plist)
/usr/libexec/PlistBuddy -c "Set CFBundleVersion $BUILD_VERSION" Info.plist
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:1:DefaultValue $RELEASE_VERSION ($BUILD_VERSION)" Settings.bundle/Root.plist