Last active
January 13, 2016 19:15
-
-
Save nevyn/da7f6b23050dce3bdb27 to your computer and use it in GitHub Desktop.
Git version into info.plist. Add GenerateGFVersion.sh as a build step first in your build process.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OUT=build/GFVersion.h | |
VERSION=`git describe | sed "y/-/./"` | |
SHORTVERSION=`echo $VERSION | cut -f 1-3 -d "."` | |
CONTENTS="#define GFVERSION $VERSION"$'\n'"#define GFSHORTVERSION $SHORTVERSION" | |
if [ -e $OUT ] | |
then | |
EXISTING=`cat $OUT` | |
fi | |
if [ "$EXISTING" = "$CONTENTS" ] | |
then | |
echo "Version unchanged" | |
exit 0 | |
fi | |
echo "Version changed" | |
mkdir -p build | |
echo "$CONTENTS" > $OUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
/// Retrieve version number of this library, roughly as outputted by git describe | |
extern NSString *GFGetVersion(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "GFGetVersion.h" | |
#import "../build/GFVersion.h" | |
#define REALSTR(x) #x | |
#define STR(x) REALSTR(x) | |
NSString *GFGetVersion(void) | |
{ | |
NSString *version = @STR(GFVERSION); | |
return version; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>CFBundleDevelopmentRegion</key> | |
<string>en</string> | |
<key>CFBundleExecutable</key> | |
<string>$(EXECUTABLE_NAME)</string> | |
<key>CFBundleIconFile</key> | |
<string></string> | |
<key>CFBundleIdentifier</key> | |
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | |
<key>CFBundleInfoDictionaryVersion</key> | |
<string>6.0</string> | |
<key>CFBundleName</key> | |
<string>$(PRODUCT_NAME)</string> | |
<key>CFBundlePackageType</key> | |
<string>APPL</string> | |
<key>CFBundleShortVersionString</key> | |
<string>GFSHORTAPPVERSION</string> <---- NOTE HERE | |
<key>CFBundleSignature</key> | |
<string>????</string> | |
<key>CFBundleVersion</key> | |
<string>GFAPPVERSION</string> <---- NOTE HERE | |
<key>Fabric</key> | |
<dict> | |
<key>APIKey</key> | |
<string>197595bba253e4e7b8a854885fe58d3bb2534ee4</string> | |
<key>Kits</key> | |
<array> | |
<dict> | |
<key>KitInfo</key> | |
<dict/> | |
<key>KitName</key> | |
<string>Crashlytics</string> | |
</dict> | |
</array> | |
</dict> | |
<key>LSMinimumSystemVersion</key> | |
<string>$(MACOSX_DEPLOYMENT_TARGET)</string> | |
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSAllowsArbitraryLoads</key> | |
<true/> | |
</dict> | |
<key>NSHumanReadableCopyright</key> | |
<string>Copyright © 2015 Lookback. All rights reserved.</string> | |
<key>NSMainNibFile</key> | |
<string>MainMenu</string> | |
<key>NSPrincipalClass</key> | |
<string>NSApplication</string> | |
<key>NSUserNotificationAlertStyle</key> | |
<string>banner</string> | |
<key>SUEnableAutomaticChecks</key> | |
<true/> | |
<key>SUFeedURL</key> | |
<string>https://s3-eu-west-1.amazonaws.com/lookback-mac-releases/appcast.xml</string> | |
</dict> | |
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//:configuration = Debug | |
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = -traditional | |
INFOPLIST_PREFIX_HEADER = $(SRCROOT)/build/GFAppVersion.h | |
INFOPLIST_PREPROCESS = YES | |
//:configuration = Release | |
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = -traditional | |
INFOPLIST_PREFIX_HEADER = $(SRCROOT)/build/GFAppVersion.h | |
INFOPLIST_PREPROCESS = YES | |
//:completeSettings = some | |
INFOPLIST_OTHER_PREPROCESSOR_FLAGS | |
INFOPLIST_PREPROCESSOR_DEFINITIONS | |
INFOPLIST_PREFIX_HEADER | |
INFOPLIST_PREPROCESS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment