From f300c1800e4719f3a5a30d12609e200be04c49e7 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Sat, 9 Mar 2013 00:56:37 +0100 Subject: [PATCH] Auto-incrementing build script, I may regret this when it's 10,000 next week. --- Enjoyable.xcodeproj/project.pbxproj | 15 +++++++++++++++ Info.plist | 2 ++ 2 files changed, 17 insertions(+) diff --git a/Enjoyable.xcodeproj/project.pbxproj b/Enjoyable.xcodeproj/project.pbxproj index bf04acf..541a4b6 100644 --- a/Enjoyable.xcodeproj/project.pbxproj +++ b/Enjoyable.xcodeproj/project.pbxproj @@ -273,6 +273,7 @@ isa = PBXNativeTarget; buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Enjoyable" */; buildPhases = ( + EE3D898416EAAE1600596D1F /* Increment build number */, EED7E81616E7B547004A0BA4 /* Generate Help Index */, 8D1107290486CEB800E47090 /* Resources */, 8D11072C0486CEB800E47090 /* Sources */, @@ -335,6 +336,20 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + EE3D898416EAAE1600596D1F /* Increment build number */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Increment build number"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "#!/bin/sh\n\nplist=\"${PROJECT_DIR}/${INFOPLIST_FILE}\"\ndir=\"$(dirname \"$plist\")\"\n\n# Only increment the build number if source files have changed\nif [ -n \"$(find \"$dir\" \\! -path \"*xcuserdata*\" \\! -path \"*.git\" -newer \"$plist\")\" ]; then\n buildnum=$(/usr/libexec/Plistbuddy -c \"Print CFBundleVersion\" \"$plist\")\n if [ -z \"$buildnum\" ]; then\n echo \"No build number in $plist\"\n exit 2\n fi\n buildnum=$(expr $buildnum + 1)\n /usr/libexec/Plistbuddy -c \"Set CFBundleVersion $buildnum\" \"$plist\"\n echo \"Incremented build number to $buildnum\"\nelse\n echo \"Not incrementing build number as source files have not changed\"\nfi\n"; + }; EED7E81616E7B547004A0BA4 /* Generate Help Index */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/Info.plist b/Info.plist index 0a17c78..ad99f4a 100644 --- a/Info.plist +++ b/Info.plist @@ -45,6 +45,8 @@ 1.0 CFBundleSignature ???? + CFBundleVersion + 16 LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright -- 2.30.2