From 62695ecf305c90dafd3f6344e1f5d1294c9e7093 Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Fri, 11 Oct 2013 01:31:13 -0700 Subject: [PATCH] Added automatic version generator script --- Cog.xcodeproj/project.pbxproj | 17 +++++++++++++++++ Scripts/genversion.sh | 10 ++++++++++ 2 files changed, 27 insertions(+) create mode 100755 Scripts/genversion.sh diff --git a/Cog.xcodeproj/project.pbxproj b/Cog.xcodeproj/project.pbxproj index 3b466bb34..52739dcad 100644 --- a/Cog.xcodeproj/project.pbxproj +++ b/Cog.xcodeproj/project.pbxproj @@ -1484,6 +1484,7 @@ 8E757AEC09F3265E0080F1EE /* CopyFiles */, 177FD1000B90CB570011C3B5 /* CopyFiles */, 07DFC3930ECDF80100DA400D /* CopyFiles */, + 8384911C1807E9ED00E7332D /* ShellScript */, ); buildRules = ( ); @@ -1847,6 +1848,22 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 8384911C1807E9ED00E7332D /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = Scripts/genversion.sh; + shellScript = ""; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 8D11072C0486CEB800E47090 /* Sources */ = { isa = PBXSourcesBuildPhase; diff --git a/Scripts/genversion.sh b/Scripts/genversion.sh new file mode 100755 index 000000000..cc6f1ae35 --- /dev/null +++ b/Scripts/genversion.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +hg_version=$(hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}') + +build_time=$(date) + +info_plist="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/Info.plist" +/usr/libexec/PlistBuddy -c "Set :CFBundleVersion '${hg_version}'" "${info_plist}" +/usr/libexec/PlistBuddy -c "Add :BuildTime date '${build_time}'" "${info_plist}" +