Auto-incrementing build script, I may regret this when it's 10,000 next week.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Fri, 8 Mar 2013 23:56:37 +0000 (00:56 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Fri, 8 Mar 2013 23:56:37 +0000 (00:56 +0100)
Enjoyable.xcodeproj/project.pbxproj
Info.plist

index bf04acf9122753f3d2df320a96187e36901b93b9..541a4b61d94be2bee68008d91a833a58a333e2e6 100644 (file)
                        isa = PBXNativeTarget;
                        buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Enjoyable" */;
                        buildPhases = (
+                               EE3D898416EAAE1600596D1F /* Increment build number */,
                                EED7E81616E7B547004A0BA4 /* Generate Help Index */,
                                8D1107290486CEB800E47090 /* Resources */,
                                8D11072C0486CEB800E47090 /* Sources */,
 /* 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;
index 0a17c785c0c849e63a713ce0fb374d52b5bd3778..ad99f4a6f9b24b013b592c867f7d572b11e70860 100644 (file)
@@ -45,6 +45,8 @@
        <string>1.0</string>
        <key>CFBundleSignature</key>
        <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>16</string>
        <key>LSApplicationCategoryType</key>
        <string>public.app-category.utilities</string>
        <key>NSHumanReadableCopyright</key>