From bb98638e9c3eb718c101ae0aa8e8d9d847a9df2a Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 5 Jan 2018 23:16:27 -0800 Subject: [PATCH] =?UTF-8?q?Use=20the=20git=20commit=20number=20as=20the=20?= =?UTF-8?q?build=20number=20in=20Info.plist.=20Use=20Curtis=20Herbert?= =?UTF-8?q?=E2=80=99s=20script:=20https://blog.curtisherbert.com/automated?= =?UTF-8?q?-build-numbers/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #203. --- Evergreen.xcodeproj/project.pbxproj | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Evergreen.xcodeproj/project.pbxproj b/Evergreen.xcodeproj/project.pbxproj index 8b60ee528..c33ea1d93 100644 --- a/Evergreen.xcodeproj/project.pbxproj +++ b/Evergreen.xcodeproj/project.pbxproj @@ -1045,6 +1045,7 @@ 849C645C1ED37A5D003D8FC0 /* Sources */, 849C645D1ED37A5D003D8FC0 /* Frameworks */, 849C645E1ED37A5D003D8FC0 /* Resources */, + 84C987A52000AC9E0066B150 /* ShellScript */, 84B06F681ED37B9000F0B54B /* Embed Frameworks */, ); buildRules = ( @@ -1385,6 +1386,22 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 84C987A52000AC9E0066B150 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# See https://blog.curtisherbert.com/automated-build-numbers/\n\ngit=`sh /etc/profile; which git`\nbranch_name=`$git symbolic-ref HEAD | sed -e 's,.*/\\\\(.*\\\\),\\\\1,'`\ngit_count=`$git rev-list $branch_name |wc -l | sed 's/^ *//;s/ *$//'`\nsimple_branch_name=`$git rev-parse --abbrev-ref HEAD`\n\nbuild_number=\"$git_count\"\nif [ $CONFIGURATION != \"Release\" ]; then\nbuild_number+=\"-$simple_branch_name\"\nfi\n\nplist=\"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\ndsym_plist=\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist\"\n\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $build_number\" \"$plist\"\nif [ -f \"$DSYM_INFO_PLIST\" ] ; then\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $build_number\" \"$dsym_plist\"\nfi"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 849C645C1ED37A5D003D8FC0 /* Sources */ = { isa = PBXSourcesBuildPhase;